Skip to content

fix: nest trashcan and zoom as separate focus trees - #10271

Open
mikeharv wants to merge 4 commits into
RaspberryPiFoundation:mainfrom
mikeharv:trash-focus
Open

fix: nest trashcan and zoom as separate focus trees#10271
mikeharv wants to merge 4 commits into
RaspberryPiFoundation:mainfrom
mikeharv:trash-focus

Conversation

@mikeharv

@mikeharv mikeharv commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9792

Proposed Changes

Make the trashcan and each zoom control their own IFocusableTree (nested under the workspace for DOM lookup), while keeping them as native Tab stops.

  1. Add WorkspaceControlNavigator, a no-op navigator so arrow keys do not move focus from chrome into blocks
  2. Register/unregister trash and zoom control trees with FocusManager; nest them from WorkspaceSvg.getNestedTrees()
  3. Remove FOCUSABLE component registration for these controls
  4. Introduce INavigator so workspace-control navigators can implement the navigator API without extending Navigator (avoids a circular import seen in the first commit)
  5. Tests for Tab-restore behavior, workspace tabbability while chrome is focused, canvas/trash/zoom DOM order, and arrow no-ops from chrome

Reason for Changes

Trash and zoom live inside the workspace's focusable svgGroup_ and are also extra tab stops. This made them feel like both separate tab stops and part of the workspace. Tab skipped the workspace if a workspace control had previously been focused, and arrow keys jumped focus from the controls onto blocks.

Nesting them as separate trees fixes this.

Test Coverage

  • restore previously focused block after focusing trash
  • workspace root becomes tabbable again when a control is focused
  • canvas -> trash -> zoom DOM order under the workspace SVG group
  • arrow key from trash/zoom doesn't do anything

Additional Information

This was the first attempt at addressing the linked issue. An alternative was pursued later which removed the IFocusable implementation from the trash and zoom controls altogether. If that work is approved/merged, this branch can be closed. That work is here:

@github-actions github-actions Bot added the PR: fix Fixes a bug label Aug 13, 2026
@github-actions github-actions Bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Aug 14, 2026
@github-actions github-actions Bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Aug 14, 2026
@mikeharv
mikeharv marked this pull request as ready for review August 14, 2026 19:29
@mikeharv
mikeharv requested a review from a team as a code owner August 14, 2026 19:29
@mikeharv
mikeharv requested a review from gonfunko August 14, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v13.0.0-beta.2] Trashcan focus and focus outlines

2 participants