Repository navigation
Conversation
The experimental card style mapped every quiet status to the same branch/PR glyph, so a workspace that finished its work and a workspace that went to sleep looked identical. Sleeping workspaces now show a Moon in the status lane and dim the row. Sleep is keyed on runtime liveness (no live PTY, no browser tabs, no fresh agent activity), not on status, because a slept workspace keeps its retained done rows and still reports 'done'. The same liveness verdict already drives the hide-sleeping filter, including its SSH-gap protection. The dim redefines the theme's own tokens on the sleeping row with an oklab mix of the sidebar foreground into the sidebar surface. Opacity or a painted veil dims toward whatever is behind the card, which collapses to nothing on a custom background and shrinks as the surface lightens; a token mix is a fixed perceptual step on any theme and keeps themed hues instead of greying them. Legacy card style is untouched.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change updates Priority: ➖ Normal 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation For Resolution Implement the remaining coding requirements from Full details: Docstring CoverageExplanation Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 16 files. (1 skipped: 1 unsupported.)
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 |
There was a problem hiding this comment.
Important
One required CI gate fails: the new translate() key is missing from en.json. Add it with pnpm run sync:localization-catalog and commit the regenerated catalog.
Reviewed changes
- Sleep verdict hook — new
useIsSleepingWorktreetreats a workspace as asleep when it has no live PTY, no browser tabs, and no fresh agent activity. - Sleeping status glyph —
WorktreeCardStatusSlotshows a moon plus ansr-onlySleepinglabel ahead of the PR and branch lanes in the new card style. - Row dim —
WorktreeCardSurfacewraps parent content indata-worktree-sleeping-dimandmain.cssre-derives--foreground/--muted-foreground/--muted/--borderas oklab mixes of the theme's own sidebar anchors. - Tests — new hook suite, expanded status-slot coverage, affiliate-list-mode dim assertions, a CSS pin test, and sleep mocks added to eight existing
WorktreeCard.*suites.
The 31 tests across the three primary suites pass. The localization catalog verifier does not — details inline.
ℹ️ Nitpicks
worktree-card-surface.tsx:72says "Same token as the disconnected dim", but the disconnected dim two lines below isopacity-60, not a token mix — the wording implies the two share a token.WorktreeCardSurfaceandWorktreeCardStatusSlotboth calluseIsSleepingWorktree, so each card runs the hook twice (~8 store subscriptions). The surface already computesisSleeping; passing it down as a prop would drop the duplicate and guarantee the dim and the glyph read the same value.- The removed test
uses context-aware branch or folder path accessible copywas the only cover for thebranchIdentityLabelprop; consider keeping an assertion for it.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ping label Review found two problems with the first pass. The sleep hook re-derived liveness instead of reusing isInactiveWorkspace, and the two definitions already disagreed: a fresh interrupted agent kept the row awake here while the filter's isFreshNonDoneAgentStatus treated the same workspace as sleeping. The hook now calls the filter's own predicate, with the live-agent set cached per store generation so every card does not rescan the status map, so the moon and the filter cannot drift apart. The new 'Sleeping' translate() key was never added to en.json, which fails the localization catalog and extraction CI jobs.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Incremental re-review of e8911a7, which resolves both findings from the prior review. Only three files changed since ae83b05: the hook, its test, and en.json.
- Shared sleep predicate —
useIsSleepingWorktreenow delegates toisInactiveWorkspace/getWorktreeIdsWithLiveAgentfromworktree-activity-state.ts, the same predicate the hide-sleeping filter uses, so the moon and the filter cannot diverge. The fresh-interrupted-agent drift is gone with it. - Per-generation live-agent cache — the whole-store live-agent scan is cached at module scope, keyed on
agentStatusByPaneKey,tabsByWorktree, and the epoch-samplednow, so it runs once per store generation instead of once per card. - Localization key —
auto.components.sidebar.WorktreeCardStatusSlot.sleepingadded toen.json;verify:localization-catalogandverify:localization-extractionboth pass locally. - Parity tests — a stale-agent-row case and a parameterized assertion that the hook matches
isInactiveWorkspaceacross four runtime shapes.
The cache is sound: getWorktreeIdsWithLiveAgent is pure in its three cached keys, so a cache hit returns exactly what a recompute would, and any mutation that can change membership replaces the agentStatusByPaneKey or tabsByWorktree identity and forces a rebuild. The hook reads the real state.agentStatusEpoch, never the kanban sentinel 0, so it cannot evict the shared epoch-clock sample. The hook suite (8 tests), the status-slot suite, and the affiliate-list-mode suite pass locally.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
nwparker
left a comment
There was a problem hiding this comment.
Reviewed independently. Focused tests (36/36), changed-code quality, typecheck, and diff checks pass. No correctness or compatibility issues found.

ELI5
In the new sidebar card style, a workspace that had finished its work and a workspace that had gone to sleep looked exactly the same. This PR gives sleeping workspaces a moon icon and dims the row, so you can tell at a glance which ones are still awake.
What Changed
Before: with the experimental new worktree card style on, every quiet workspace — active, finished, or asleep — rendered the same branch/PR glyph in the status lane. A completed-but-awake card and a sleeping card were pixel-identical, so the only way to tell them apart was to open them.
After: a sleeping workspace shows a moon in the status lane (with a
Sleepinglabel for screen readers) and its row is dimmed. Awake workspaces keep the branch or PR glyph exactly as before, and the legacy card style is untouched.Two mechanisms:
Sleep is keyed on runtime liveness, not status.
useIsSleepingWorktreetreats a workspace as asleep when it has no live PTY, no browser tabs, and no fresh agent activity. Status alone is wrong here: a slept workspace keeps its retained done rows, so it still reportsdone— which is exactly why the two states collapsed together. The hook callsisInactiveWorkspace— the same predicate the hide-sleeping filter decides with, including its SSH-gap protection — so the moon and that filter cannot drift apart. The filter's live-agent set is cached per store generation, so adding the hook does not make every card rescan the agent-status map.The dim redefines theme tokens, it does not paint over the card. On the sleeping row,
--foreground,--muted-foreground,--mutedand--borderare re-derived as anoklabmix of--worktree-sidebar-foregroundinto--worktree-sidebar. Because those are the same two anchors every other sidebar token is built from, the dim scales with whatever theme, tint, or custom background the user has set, and descendants inherit it through the tokens they already use.Why
The status lane in the new card style is the only place a workspace's state is visible, and it was reporting the same thing for two states a user acts on differently. Colour alone would not fix it — the legacy green/grey dots are unreadable for colourblind users, and moving to shape plus dim is what the new style was for.
Alternatives considered for the dim, and why they were rejected:
opacityon the row. Opacity dims toward whatever is painted behind the card. On a near-black custom background it collapsed to almost nothing, and on a lighter sidebar the same alpha is a much smaller perceptual step, so the cue faded exactly where it was needed.bg-sidebar/NNveil. Same failure, more sharply: when the card already sits on the sidebar colour, painting the sidebar colour over it is a no-op.backdrop-grayscale/saturate. Readable, but it strips hue, so a custom-themed sidebar lost its colour on sleeping rows.The
oklabtoken mix is a fixed perceptual step rather than a backdrop-dependent one, so it holds on black, on a tinted sidebar, and on light themes, and it keeps themed hues. Measured in a blue-tinted sidebar: awake title 8.91:1 contrast, sleeping title 2.93:1 — clearly de-emphasised, still readable.The amber unread badge is outside that token family, so an unread sleeping workspace stays noticeable without a z-index workaround.
Linked Issue
Fixes #19624
Related to #20807 — that issue asks for sleep to be legible rather than invisible, and lists "no dimmed asleep state" as its first problem. This PR delivers that affordance at the workspace level in the sidebar. It does not close #20807, which also covers the pane-level slept notice and making the Agent sleep setting discoverable outside Settings → Experimental.
Visual Proof
Before (left): in the new card style, an awake workspace and a sleeping one render identically — same branch glyph, same brightness.
After (right): the sleeping workspace shows a moon and a dimmed row. Shown across three sidebar appearances — a tinted dark theme, a near-black custom background, and the default dark theme — to show the dim holds its strength on each rather than washing out.
Testing
Manually tested on macOS in a real Orca window against several sidebar appearances: default dark, a near-black custom background, a light theme, and a green custom terminal-matched theme. Verified that a sleeping workspace reads as dimmed with a moon in every one, that awake workspaces are unchanged, that the legacy card style still shows its green/grey dots, and that controls on a dimmed card still respond.
Automated:
use-worktree-sleep-state.test.tsx— the liveness verdict, including a retained-done workspace with no runtime resolving as sleeping, and the SSH-gap case.WorktreeCardStatusSlot.test.tsx— sleeping beats both the branch and PR lanes, an awakedoneworkspace with a branch identity still renders the branch glyph, andSleeping · Unreadis announced.WorktreeCard.affiliate-list-mode.test.tsx— the dim wrapper is present only for sleeping workspaces in the new style, absent when awake and in legacy, and carries no opacity or filter class.worktree-card-active-style.test.ts— pins the CSS rule tooklaband the two theme anchors, so a future edit cannot silently reintroduce a backdrop-dependent dim.pnpm typecheck, the changed-code quality gate, and the sidebar suites (307 files, 2596 tests) pass locally.AI Disclosure
Claude Opus 4.5.
Review
Cross-platform: renderer-only, CSS and React; no platform branches, paths, or shortcuts involved.
SSH and remote: the sleep verdict reuses the existing liveness helpers, which already treat loss of contact with an SSH host as unverifiable rather than dead, so a reachability gap cannot make a live remote workspace render as asleep.
Agents, integrations, git providers: provider-neutral. The branch and PR lanes are unchanged, and the sleeping state takes precedence over both without inspecting the provider.
Performance: the hook reads the same store slices the card already subscribes to, through the existing selector cache, with no new subscriptions or timers. The dim is static CSS with no filter or backdrop work, so it does not add a compositing layer.
UI quality: styling uses theme tokens only, with no raw colours, so it follows any theme or custom tint. Legacy card style untouched; the experimental style is behind its existing setting.
Security: no new IPC, no process spawning, no user input handling, no network access.
Backwards compatibility: no wire, settings, or persisted-state changes.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
The change is scoped to the experimental new card style. Mobile is unaffected — the sidebar card surface is desktop renderer code.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)