Repository navigation
feat: consistent focus ring and reliable focus restoration - #108
Merged
Merged
Conversation
nextestudios
force-pushed
the
feature/31-focus-restoration
branch
2 times, most recently
from
September 27, 2026 02:43
f498670 to
16a80c7
Compare
- One focus token (Theme.ApplyFocus) for list rows, menus and dialogs; the ListView's native selection highlight is off so there is a single ring. - When the focused item disappears (delete, move, external change), focus moves to the next surviving item in the previous order, else the previous one. Fixes focus skipping a survivor after deleting several marked items. - Opening a folder measures the list and scrolls the focused item into view before the first frame; moving focus only restyles the two affected rows. - After a modal closes, keyboard focus returns to the root if the focused XAML element left the tree; empty menus can no longer divide by zero. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nextestudios
force-pushed
the
feature/31-focus-restoration
branch
from
September 27, 2026 02:45
16a80c7 to
f737a91
Compare
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.
Summary
Theme.ApplyFocus(3 px accent border + soft fill) is used by list rows, menus and dialogs; the on-screen keyboard already uses the same tokens. The ListView's native selection highlight is turned off (SelectionMode.None) so there is exactly one focus visual. Cut rows dim their content, not the ring.FileListState.SetItemsnow moves focus to the next item that survived in the previous order (else the previous one) when the focused item disappears. Before, it reused the old index, which skipped a survivor after deleting several marked items (regression test inStateTests).UpdateLayout) and scrolled to the focused item before the first frame; focus moves only restyle the two affected containers.% 0would throw).Testing
Deleting_marked_items_moves_focus_to_the_next_survivor_not_the_same_index.docs/TESTING.md): ring legibility at TV distance/4K, keyboard still responsive after closing menus/dialogs (incl. mouse click on an option), focus after multi-delete in a large folder, focus visible on the first frame after Back in a folder with thousands of items.Closes #31
🤖 Generated with Claude Code