fix: align Home/End/Page Down shortcuts with arrow-key navigation - #10414
Closed
anishtsudo wants to merge 3 commits into
Closed
fix: align Home/End/Page Down shortcuts with arrow-key navigation#10414anishtsudo wants to merge 3 commits into
anishtsudo wants to merge 3 commits into
Conversation
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.
Author
|
#10404 is the original PR |
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
nextConnection.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 mochaJump 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.