feat(desktop): swap changes-sidebar clicks to open file, cmd-click for diff

Merged
AV
4mo ago
+21-20

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 sidebarFileLinks preference stores generic actions (pane/newTab/external) per modifier tier; the diff-vs-file semantic for the changes sidebar is resolved in changesSidebarFilePolicy.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 lint clean
  • bun run typecheck (apps/desktop) clean
  • Manual: click a changed file in the sidebar → rendered file opens; ⌘-click → diff opens; menu chips show ⌘ on "Open Diff"

https://claude.ai/code/session_01DiEVMcd9RDKJz9vPGD3ojY


Open in Stage

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 sidebarFileLinks preferences still apply; tooltips and menu shortcut chips are updated; shift-modifier actions are unchanged; the legacy v1 sidebar is not affected.

Summary by CodeRabbit

  • Bug Fixes
    • Updated Changes sidebar click behavior so regular clicks open files, while modifier-clicks open diffs.
    • Corrected shortcut hints to appear on “Open Diff” actions instead of “Open File.”
    • Updated context menu behavior and shortcut mappings for consistent file and diff actions.