feat(cardinal): switch between search input and results panel using arrow keys#194
Merged
feat(cardinal): switch between search input and results panel using arrow keys#194
Conversation
There was a problem hiding this comment.
Pull request overview
Enables seamless keyboard navigation between the search input and the files results list, addressing issue #189 by allowing ArrowDown to enter results (and ArrowUp to return to search) without requiring a mouse click.
Changes:
- Add an
onNavigateFromSearchToResultscallback inuseFilesTabStatethat triggers when ArrowDown reaches the newest history tail. - Update
Appto select the first result + blur the search input when navigating from search → results, and add separate focus helpers (focusSearchInputvsfocusAndSelectSearchInput). - Extend global hotkey handling to return focus to the search input when ArrowUp is pressed on the first result row; update and add tests covering the new navigation flows.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cardinal/src/hooks/useFilesTabState.ts | Adds optional callback to transition from search input to results when ArrowDown hits history tail. |
| cardinal/src/hooks/useAppWindowListeners.ts | Renames quick-launch focus handler to focusAndSelectSearchInput and updates effect deps accordingly. |
| cardinal/src/hooks/useAppHotkeys.ts | Tracks activeRowIndex and adds ArrowUp behavior to move focus back to search from the first result. |
| cardinal/src/App.tsx | Implements navigation from search → results (select first row + blur input) and introduces separate focus helpers. |
| cardinal/src/hooks/tests/useFilesTabState.test.ts | Adds unit tests for ArrowDown-to-results behavior at history tail and modifier handling. |
| cardinal/src/hooks/tests/useAppWindowListeners.test.ts | Updates tests to reflect focusAndSelectSearchInput rename. |
| cardinal/src/hooks/tests/useAppHotkeys.test.ts | Updates tests for new options and adds coverage for ArrowUp from first result returning focus to search. |
| cardinal/src/tests/App.searchNavigation.test.tsx | Adds integration-style test asserting ArrowDown from search selects first result and blurs search input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
fixes #189