Skip to content

fix: align Home/End/Page Down shortcuts with arrow-key navigation - #10414

Closed
anishtsudo wants to merge 3 commits into
RaspberryPiFoundation:mainfrom
anishtsudo:anish/fix-navigator-home-end-review-b480
Closed

fix: align Home/End/Page Down shortcuts with arrow-key navigation#10414
anishtsudo wants to merge 3 commits into
RaspberryPiFoundation:mainfrom
anishtsudo:anish/fix-navigator-home-end-review-b480

Conversation

@anishtsudo

Copy link
Copy Markdown

The basics

The details

Resolves

Fixes #10186

Proposed Changes

Rewrite the opt-in Home / End / Page Down / Ctrl+Home / Ctrl+End shortcuts so they land on the same nodes as holding the matching arrow keys.

  • Home: first in-block node (usually the owning block). Full-block field blocks are treated as fields of their parent.
  • End: last same-row in-block node via In. Does not enter statement inputs. No-op if already there, or if focus is on a container nextConnection.
  • Page Down: last down-reachable node in the current stack via Down. Does not walk into inline value inputs.
  • Ctrl/Cmd+End: last top-level stack, then Down, then In to the end of that row.

Home/End/Page Down scoping lives in shortcut_items.ts. Navigator only exposes private walk helpers.

Reason for Changes

End was focusing unreachable container statement connections, and Page Down was walking into inline value inputs. Those destinations did not match arrow-key navigation.

Test Coverage

Jump shortcut mocha tests now use real focusNode() and assert the concrete destination node, not helper return values. Chrome mocha Jump shortcuts: 21 passing, 0 failing.

Documentation

Updated the keyboard navigation shortcut table in packages/docs/docs/guides/configure/keyboard-nav.mdx.

Additional Information

Based on fix/navigation-shortcuts.

Rewrite the opt-in jump shortcuts so they follow the same destinations
as holding arrow keys, scoped to the current block, stack, or workspace.
This fixes End focusing unreachable container statement connections and
stops Page Down from walking into inline value inputs.

Fixes RaspberryPiFoundation#10186
…inations

Move Home/End/Page Down scoping back into shortcut_items so Navigator is not
aware of those shortcuts, and combine leftover row/stack walks into a private
walkAlong helper. Update Jump shortcut tests to use real focusNode() and
assert the actual destination node instead of the shortcut helpers.
Chrome mocha showed Ctrl/Cmd+End focuses text_2's TEXT field, the last
same-row node after walking down the last top-level stack.
@anishtsudo
anishtsudo requested a review from a team as a code owner September 8, 2026 22:27
@anishtsudo
anishtsudo requested a review from maribethb September 8, 2026 22:27
@anishtsudo anishtsudo changed the title Anish/fix navigator home end review b480 fix: align Home/End/Page Down shortcuts with arrow-key navigation Sep 8, 2026
@github-actions github-actions Bot added the PR: fix Fixes a bug label Sep 8, 2026
@anishtsudo

Copy link
Copy Markdown
Author

#10404 is the original PR

@maribethb

Copy link
Copy Markdown
Contributor

Hi @anishtsudo, can you please push these commits to your original PR instead of opening a new one? Opening a new PR loses the context of the original review which is important when we're reviewing git history and because the original reviewer already has the context needed to do an effective review. Thanks!

@maribethb maribethb closed this Sep 9, 2026
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.

Additional shortcuts via registerNavigationShortcuts (Page Up / Down & Home / End)

2 participants