dashboard: restore focus when the Command Palette closes over an open modal (excluded from #9198)

Open
#9,206 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript

Research direction

Start by tracing how the dashboard Command Palette opens and closes, how modal focus traps are managed, and where overlay tests cover keyboard behavior. Add coverage for opening the palette over New Session, restoring focus on close, and keeping Tab inside the modal; the issue also calls for an owner-path check. Done means all three close methods restore focus, with a fallback to the topmost modal when the original element is gone.

Written by the indexing model from the issue text.

Description

bug dashboard from-review

Context

This is excluded from #9198 and PR #9205, which harden the overlay-roster test guard and change only tests. The full review of #9205 classified it as a product change, so it is tracked here instead of being folded into a test-only PR. The behaviour predates #9196.

Description

When the Command Palette opens over a still-open modal (for example New Session) and then closes, focus is not returned to the element in the modal that held it before the palette opened. Since #9196 the palette is topmost, so Escape correctly closes only the palette. Focus after that close is not managed, though. A keyboard user can lose their place in the modal, and focus may land outside the modal's focus trap.

Acceptance Criteria

  • Closing the palette, by Escape, by selecting an action or by clicking outside, restores focus to the element that had it when the palette opened, when that element is still in the DOM. When it is not, focus goes to the topmost open modal's first focusable element.
  • Focus stays inside the topmost modal's trap after the palette closes.
  • A test covers palette-over-modal: focus is restored and Tab stays inside the modal. A mutation that removes the restore turns it red.
  • An owner-path check on the dashboard: open New Session, focus a field, open the palette, press Escape, and confirm the same field has focus.
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 3m
Merged PRs (30d)
333

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.