Configurable sidebar detail for worktree rows - #71
Conversation
|
Looking for opinions on this. I could go two ways with this:
For (1), a few future ideas I had:
All of the above are complicated with multiple agents running at once or mixed agents (Codex + Claude). If I had this option today, I would probably set it to None. |
|
I like the change you made in this PR to make it optional. I can't really see it getting more noisy from here. Like you said, most of the additional information belongs in the context sidebar. I am personally on the fence between Diff and None. Diffs are useful to understand the magnitude of the changes on the worktree. It's a decent way of understanding "okay that one is going to take me X minutes to review" or "okay that one is X% risky" naming nit. It's hard to figure out what "Sidebar" means in this context so I can see the settings being a bit confusing to people. We likely should use a preview based thing (like you have in the big UX change) |
|
One thing that I could find useful in the worktree sidebar is knowing who's PR I am reviewing. Now that I have been reviewing PRs within harness for a while the juggling of PRs is sometimes like "wait which one was this again..." |
Do you care to know that before switching to a worktree? The changes on main for the PR panel show the assignee avatar now. |
Ah, this gives me other ideas that remove the need to make this configurable. Instead of showing the details all the time, this could be shown some other ways:
Or, this isn't a global setting. This is context based depending on the status of the worktree. If it's something you created, maybe you care about age and whether or not it's about to be merged. If it's something someone else created (and you're reviewing), you care about the size of it and who's assigned. If it's something that's inflight (no PR yet), you care about something else. WDYT? |
2746cc1 to
630cf7c
Compare
|
Here's another variation... there's a default setting used (diff, PR, age, none) and a shortcut (cmd+I) that cycles through them. So you could configure this to None, but temporarily look at the others |
33bc7dc to
67db9c0
Compare
Introduces a 'worktreeDetail' setting (diff | age | pr | none, default diff) that controls the extra info rendered on the right side of each worktree row in the sidebar. The diff stat (existing behavior) keeps its place; the new modes are: - age — relative worktree age (e.g. '3h', '5d', '1.5y'; years switch in at >= 365 days) - pr — first assignee's avatar, milestone title, and #NNN pill (avatar on the far right) - none — hide the detail The detail hides on hover so the row action buttons can appear in its place. Wires the setting through the standard slice path (shared reducer, event variant, persistence, IPC handler, backend method, ElectronAPI type) and adds the picker to Settings → Worktrees, sitting below the Setup & teardown scripts block. A small mock sidebar row above the options gives a real-time preview of the configured choice, including the hover-to-reveal-actions behavior. Cmd+I cycles a per-client override (diff → age → pr → diff) without touching the configured default. The override is renderer-only transient state (useSyncExternalStore in src/renderer/worktree-detail-override.ts), matches how sidebar widths / modal visibility are scoped, and resets on reload. 'none' is deliberately skipped from the cycle so the hotkey never just hides the detail. Pure helper formatWorktreeAge lives in src/renderer/components/worktree-detail.ts with vitest coverage for hour/day/year boundaries and edge cases (missing createdAt, clocks in the future). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cycle now rotates diff → age → pr → none → diff so the override hotkey can also hide the detail entirely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
67db9c0 to
e68e0cf
Compare
|
@frenchie4111 I'm not sure what the configuration looks like on your side, but it might make sense to enable the Merge queue. That way we can submit things for merge without having to update/rebase the PR first. |
Summary
Adds a Worktree details picker in Settings → Worktrees (below Setup & teardown scripts) that controls what extra info renders on the right side of each sidebar row. Default is unchanged (
diff), so existing users see no behavior change unless they pick a different option.Modes
+N −Mfrom PR additions/deletions<1h/Nh/Nd/N.Ny, years switch in at ≥365 days)#NNNpillThe detail hides on hover so the existing Snooze / Remove action buttons can appear in its place — no real estate lost.
Cmd+I cycle (transient override)
A new hotkey
Cmd+Icycles the displayed detail throughdiff → age → pr → diffwithout changing the configured default.'none'is intentionally skipped so the hotkey never just blanks the row. The override is per-client renderer state (a tinyuseSyncExternalStorecell insrc/renderer/worktree-detail-override.ts) — no IPC, no persistence, resets on reload. Matches how sidebar widths / modal visibility are scoped per CLAUDE.md's slice-vs-useState guidance.Live preview
A mock sidebar row above the option buttons in Settings updates in real time as you pick an option, including the same
group-hover:hidden/hidden group-hover:flexTailwind pattern as the realWorktreeTab— hover the preview to see the Snooze + Remove icons swap in.Wiring
Standard slice path: shared reducer + event variant, persisted with default-omitted serialization (
'diff'not written toconfig.json), IPC handler with validation for all four values, backend method, ElectronAPI type. The PR-mode render only fires for worktrees that already have aprStatus; otherwise nothing renders (same silent no-op as the diff mode when there's no PR yet).Pure helper
formatWorktreeAgelives insrc/renderer/components/worktree-detail.tswith vitest coverage for hour/day/year boundaries and edge cases (missingcreatedAt, clocks in the future).Test plan
npm run typecheckcleannpx electron-vite buildcleannpx vitest run src/renderer/components/worktree-detail.test.ts src/shared/state/settings.test.ts— age helper + settings reducer passdiff → age → pr → diffwithout touching the Settings picker; reload and confirm the override is gone#NNN, and far-right avatar render correctlydiff) is omitted fromconfig.jsonrather than written