Skip to content

feat(differ): add keyboard shortcuts for file navigation and font sizing#502

Merged
matt2e merged 2 commits intoblock:mainfrom
rnc505:robbyc/03-26-feat_differ_add_keyboard_shortcuts_for_file_navigation_and_font_sizing
Mar 27, 2026
Merged

feat(differ): add keyboard shortcuts for file navigation and font sizing#502
matt2e merged 2 commits intoblock:mainfrom
rnc505:robbyc/03-26-feat_differ_add_keyboard_shortcuts_for_file_navigation_and_font_sizing

Conversation

@rnc505
Copy link
Copy Markdown
Collaborator

@rnc505 rnc505 commented Mar 26, 2026

Stack

This is PR 4/4 in a stack of Differ improvements:

  1. Graphite stack support (feat(differ): add Graphite stack support for scoped PR diffs #499)
  2. Diff color contrast (feat(differ): improve diff color contrast with per-side tinting #500)
  3. Font sizing & titlebar fixes (feat(differ): fix font sizing, padding, and titlebar responsiveness #501)
  4. → Keyboard shortcuts (this PR)

Background

Differ lacked keyboard shortcuts for common review actions, requiring mouse interaction to navigate between files or adjust font size.

Overview of Changes

  • ] / [ to navigate to next/previous file in the diff list
  • Cmd+= / Cmd+- to increase/decrease both UI and code font size by 1px
  • Font size changes reflect live in the Settings panel
  • File navigation shortcuts are suppressed when focus is in input elements

Testing Performed

  • Manual testing of all shortcuts in review workflow
  • Verified shortcuts are suppressed in text inputs and textareas

Video testing (with all 4 from stack)

with gt installed without gt installed
Screen.Recording.2026-03-26.at.10.38.26.AM_compressed.mp4
Screen.Recording.2026-03-26.at.10.41.16.AM_compressed.mp4

Fixed the text overflow artifacts that you can see in the video

I just didn't want to rerecord
Screenshot 2026-03-26 at 11 20 05 AM
Screenshot 2026-03-26 at 11 20 00 AM
Screenshot 2026-03-26 at 11 19 57 AM


✨🤖 heavily assisted by AmpCode

@rnc505 rnc505 force-pushed the robbyc/03-26-feat_differ_add_keyboard_shortcuts_for_file_navigation_and_font_sizing branch from b8f7aca to 800f525 Compare March 26, 2026 15:50
@rnc505 rnc505 marked this pull request as ready for review March 26, 2026 16:23
Copy link
Copy Markdown

@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: 800f52578c

ℹ️ 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 +211 to +213
if (si && !args.mode) {
setMode('stack');
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prevent stale diff results after auto-switching to stack mode

After await loadRepoInfo(), this block immediately calls setMode('stack'), which triggers a second loadDiff() while the first loadDiff() (started inside loadRepoInfo) is still in flight. Because loadDiff() has no request token/cancellation, whichever response finishes last wins; on slower repos the earlier "All Changes" request can overwrite the stack results, leaving diffMode === 'stack' but showing the wrong file list. The same pattern is also used in handleFolderSelect, so the mismatch can occur both on startup and when switching repos.

Useful? React with 👍 / 👎.

@rnc505 rnc505 force-pushed the robbyc/03-26-feat_differ_add_keyboard_shortcuts_for_file_navigation_and_font_sizing branch 3 times, most recently from 7fc1449 to c0d93bf Compare March 27, 2026 01:30
rnc505 and others added 2 commits March 26, 2026 21:02
Fix several UI density and overflow issues:

- Replace hardcoded 9px font sizes with var(--size-xs) for section
  labels, dividers, and count capsules
- Bump mode-seg buttons from --size-xs to --size-sm for readability
- Fix titlebar overflow: add ellipsis truncation on branch name and
  repo button, allow titlebar-center to shrink
- Increase stack dropdown padding for better touch targets
- Add UI Font Size preference (--size-base) with stepper control
  in Settings panel, persisted to Tauri store

Amp-Thread-ID: https://ampcode.com/threads/T-019d28f5-71eb-7256-af52-1b4c406e53a7
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d28f5-71eb-7256-af52-1b4c406e53a7
Co-authored-by: Amp <amp@ampcode.com>
Add app-level keyboard shortcuts for faster review workflow:

- ] / [ to navigate to next/previous file in the diff list
- Cmd+= to increase both UI and code font size by 1
- Cmd+- to decrease both UI and code font size by 1
- Font size changes are reflected live in Settings panel
- File nav shortcuts are suppressed when focus is in inputs
@rnc505 rnc505 force-pushed the robbyc/03-26-feat_differ_add_keyboard_shortcuts_for_file_navigation_and_font_sizing branch from c0d93bf to 57300b6 Compare March 27, 2026 02:03
@matt2e matt2e merged commit eb1f154 into block:main Mar 27, 2026
3 checks passed
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.

2 participants