feat(ui): add Cmd+Up/Down shortcuts to navigate between projects and diff files#488
feat(ui): add Cmd+Up/Down shortcuts to navigate between projects and diff files#488
Conversation
When a project is selected, Cmd+ArrowUp navigates to the previous project and Cmd+ArrowDown navigates to the next project in the list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…is open Guard selectPreviousProject and selectNextProject so they no-op when a dialog (role="dialog"), diff overlay (.diff-modal-backdrop), or the settings view is active. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… viewer When viewing a diff, Cmd+ArrowUp selects the previous file and Cmd+ArrowDown selects the next file in the file list sidebar. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Navigate files in the same order they appear in the sidebar (depth-first through the needs-review tree, then the reviewed tree) instead of using the flat file entries array which has a different ordering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0481d0be6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if ((event.key === 'ArrowUp' || event.key === 'ArrowDown') && event.metaKey) { | ||
| event.preventDefault(); | ||
| event.stopPropagation(); | ||
| const currentPath = diffViewer.state.selectedFile; |
There was a problem hiding this comment.
Skip file-nav shortcut while text inputs are focused
The new Cmd+↑/↓ handler runs for every keydown in the diff modal and immediately calls preventDefault, but unlike the existing Escape/A handlers it does not ignore input targets. When a user is typing in a comment/search field and presses Cmd+↑ or Cmd+↓ for normal cursor movement, the modal navigates files instead and suppresses native text-editing behavior. This makes editing workflows unreliable in the modal; add an early guard for input/textarea/contenteditable targets before handling file navigation.
Useful? React with 👍 / 👎.
…cuts Replace per-keystroke listProjects() IPC calls in selectPreviousProject and selectNextProject with a shared reactive projectsList store. The store is populated by ProjectsList/ProjectHome when they load projects, eliminating redundant round-trips and preventing race conditions on rapid keypresses. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update the three ProjectHome handlers (project-setup-progress, handleRepoSelected, removeBranch) to call setProjects() so the shared projectsList store stays in sync after repos are added or removed. Without this, Cmd+Up/Down navigation could target stale project entries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a scrollIfActive Svelte action to the project row button that calls
scrollIntoView({ block: 'nearest' }) whenever the project becomes the
selected one, keeping the active project visible in the sidebar.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Test plan
🤖 Generated with Claude Code