Repository navigation
feat(desktop): swap changes-sidebar clicks to open file, cmd-click for diff - #5979
Conversation
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit ab794e5 on Jul 27, 2026 3:16am UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe changes sidebar now resolves plain clicks to file intents and modifier clicks to diff intents. File-row dropdown and context-menu shortcuts are derived from the diff tier, while Open File shortcut labels are removed. ChangesChanges sidebar intent and shortcut alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
Swaps the click behavior on changed-file rows in the v2 changes sidebar: a plain click now opens the rendered file, and cmd/ctrl-click opens the diff view (previously the reverse).
The
sidebarFileLinkspreference stores generic actions (pane/newTab/external) per modifier tier; the diff-vs-file semantic for the changes sidebar is resolved inchangesSidebarFilePolicy.intentFor, so the swap is a one-line flip there and propagates to both sidebar renderers (list + tree), tooltip hints, and menu shortcut chips — including for users with an already-persisted preference. Shift-click (diff in new tab) and cmd+shift-click (external editor) are unchanged.Also moves the ⌘ shortcut chip in the row context/dropdown menus from "Open File" to "Open Diff", since "file" is now the plain-click action and never sits on a modifier tier.
The v1 legacy changes sidebar (
screens/main/.../FileItem.tsx) has its own hardcoded handling and is intentionally untouched.Test Plan
bun test changesSidebarFilePolicy.test.ts— updated expectations pass (plain → file, ⌘ → diff, tier lookups)bun run lintcleanbun run typecheck(apps/desktop) cleanhttps://claude.ai/code/session_01DiEVMcd9RDKJz9vPGD3ojY
Summary by cubic
Swapped click behavior in the v2 Changes sidebar: plain click now opens the file, and Cmd/Ctrl-click opens the diff. Existing
sidebarFileLinkspreferences still apply; tooltips and menu shortcut chips are updated; shift-modifier actions are unchanged; the legacy v1 sidebar is not affected.Written for commit ab794e5. Summary will update on new commits.
Summary by CodeRabbit