Skip to content

feat(ui): add Cmd+Up/Down shortcuts to navigate between projects and diff files#488

Merged
matt2e merged 7 commits intomainfrom
command-up-and-down
Mar 26, 2026
Merged

feat(ui): add Cmd+Up/Down shortcuts to navigate between projects and diff files#488
matt2e merged 7 commits intomainfrom
command-up-and-down

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Mar 26, 2026

Summary

  • Add Cmd+Up/Down keyboard shortcuts to navigate between projects in the sidebar
  • Add Cmd+Up/Down shortcuts within the diff viewer to navigate between changed files
  • Suppress project-level shortcuts when a modal or diff viewer is open to avoid conflicts
  • Ensure diff viewer navigation follows the sidebar's visual file order

Test plan

  • Verify Cmd+Up/Down navigates between projects in the sidebar
  • Open a diff viewer and verify Cmd+Up/Down navigates between changed files
  • Confirm project shortcuts are suppressed when a modal or diff is open
  • Verify file navigation order matches the sidebar visual order

🤖 Generated with Claude Code

matt2e and others added 4 commits March 26, 2026 15:08
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>
@matt2e matt2e requested review from baxen and wesbillman as code owners March 26, 2026 05:10
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +409 to +412
if ((event.key === 'ArrowUp' || event.key === 'ArrowDown') && event.metaKey) {
event.preventDefault();
event.stopPropagation();
const currentPath = diffViewer.state.selectedFile;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

matt2e and others added 3 commits March 26, 2026 16:32
…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>
@matt2e matt2e merged commit 0de9ad9 into main Mar 26, 2026
4 checks passed
@matt2e matt2e deleted the command-up-and-down branch March 26, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant