Skip to content

fix(sidebar): bold unvisited agent rows in the compact sidebar too - #22870

Closed
drakeo338 wants to merge 2 commits into
stablyai:mainfrom
drakeo338:claude/22857-fix
Closed

drakeo338 wants to merge 2 commits into
stablyai:mainfrom
drakeo338:claude/22857-fix

Conversation

@drakeo338

Copy link
Copy Markdown
Contributor

ELI5

A finished agent's row in the compact sidebar looked the same as one you'd already checked. Now it stays bold until you open it.

What Changed

Fixes #22857. DashboardAgentRow (full mode) already bolds an unvisited-finished agent via isUnvisited; CompactAgentRow never got that prop. Added it, applied the same bold/muted split, wired from WorktreeCardAgents via the same memo the full-mode row already reads.

Why

Compact is the default mode; the store already tracked the right state, it just never reached this row.

Linked Issue

Fixes #22857

Visual Proof

N/A, no Electron app here to screenshot — a class toggle mirroring DashboardAgentRow's styling, asserted by the new test.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Ran vitest run on the two affected test files on HEAD: 31 passed. Full lint/typecheck/build not run.

AI Disclosure

Claude (Anthropic, Sonnet 5) via Claude Code; a human reviewed and authorized it.

Review

AI review: renderer-only styling change, no platform code — cross-platform/SSH/agent-type unaffected, no new inputs/IO, no perf/security concern.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Covered above.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — only ran the scoped vitest command above, not the full suite.

DashboardAgentRow (full mode) already bolds a finished agent's leading
text until the user visits its tab, via isUnvisited. CompactAgentRow
never got that prop, so the compact sidebar always rendered every row
at the same muted weight and a user could not tell a just-finished
agent from one they had already checked.

Add isUnvisited to CompactAgentRowProps and apply the same
font-semibold/text-foreground vs font-normal/text-muted-foreground
split DashboardAgentRow uses, then wire it from WorktreeCardAgents'
renderCompactAgentBranch using the unvisitedByPaneKey memo that
renderAgentBranch already reads for the full-mode row.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ Minor suggestions only — the fix is correct and matches full mode; one coverage gap inline.

Reviewed changes

  • Compact row accepts isUnvisited — CompactAgentRow gains the optional prop and applies the same font-semibold text-foreground / font-normal text-muted-foreground/90 split as DashboardAgentRow, with twMerge collapsing the focused-visited case to font-normal text-foreground.
  • Wiring from the sidebar — renderCompactAgentBranch passes isUnvisited={unvisitedByPaneKey[agent.paneKey] ?? false}, the same per-card memo the full row already reads (ackAt < agent.entry.stateStartedAt).
  • Tests — new happy-dom worktree-card-compact-agent-row.unvisited.test.tsx renders the component directly for both prop values; the two compact focus tests in WorktreeCardAgents.test.tsx now pin stateStartedAt: 0 so the row reads visited, with expected class strings updated.

Verified locally: the 31 tests in both files pass and oxlint is clean on all four changed files.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f91c6505-b03b-416c-aa55-b439f642aeb2

📥 Commits

Reviewing files that changed from the base of the PR and between c27a195 and e2ec568.

📒 Files selected for processing (1)
  • src/renderer/src/components/sidebar/WorktreeCardAgents.unvisited-wiring.test.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Compact agent rows now receive the pane-keyed unvisited state. Unvisited rows display leading text in semibold foreground styling; visited rows retain normal muted styling unless focused. Tests cover unvisited and visited styling, and update focus-dimming assertions.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to e2ec5

Compact rows receive the unvisited state, and the regression test covers the relevant styling path. No identified issue prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: making unvisited agent rows bold in the compact sidebar.
Description check ✅ Passed The description covers the user impact, implementation, reason, linked issue, visual-proof status, automated testing, AI disclosure, review considerations, and checklist. It also clearly states that m…
Linked Issues check ✅ Passed The PR satisfies issue #22857. WorktreeCardAgents passes unvisitedByPaneKey[agent.paneKey] to CompactAgentRow. CompactAgentRow applies font-semibold text-foreground to unvisited rows and kee…
Out of Scope Changes check ✅ Passed The changed production files implement the unvisited signal and compact-row emphasis required by issue #22857. The changed tests verify styling, prop wiring, and existing focus behavior. No unrelated …
  • Fix all pre-merge checks with AI

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1b262981-8079-40eb-ae13-649738dad652

📥 Commits

Reviewing files that changed from the base of the PR and between 646e9a5 and c27a195.

📒 Files selected for processing (4)
  • src/renderer/src/components/sidebar/WorktreeCardAgents.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCardAgents.tsx
  • src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx
  • src/renderer/src/components/sidebar/worktree-card-compact-agent-row.unvisited.test.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment on lines +339 to +340
// Why: bold the row until the user visits its tab (useAutoAckViewedAgent auto-acks on focus, muting it).
isUnvisited={unvisitedByPaneKey[agent.paneKey] ?? false}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '80,115p' src/renderer/src/components/sidebar/WorktreeCardAgents.tsx
sed -n '245,276p' src/renderer/src/components/sidebar/WorktreeCardAgents.tsx
rg -n "unvisitedByPaneKey|isUnvisited|stateStartedAt|status ===|status:" src/renderer/src/components/sidebar/WorktreeCardAgents.tsx src/renderer/src/components/dashboard/DashboardAgentRow.tsx src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx

Repository: stablyai/orca

Length of output: 6352


🏁 Script executed:

#!/bin/bash
sed -n '1,380p' src/renderer/src/components/sidebar/WorktreeCardAgents.tsx
printf '\\n--- referenced definitions ---\\n'
rg -n --glob '*.ts' --glob '*.tsx' "selectAcknowledgedAgentTimes|type .*Agent|interface .*Agent|rowSource|stateStartedAt|isFinished|status.*finished|finished.*status" src/renderer/src | head -240
printf '\\n--- compact row and dashboard styling ---\\n'
sed -n '220,250p' src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx
sed -n '248,270p' src/renderer/src/components/dashboard/DashboardAgentRow.tsx
printf '\\n--- relevant PR diff ---\\n'
git diff --unified=30 646e9a5b02514795af5139961ccca225dfa01b12 c27a1953b7077da7b39b543ce52dfa05a9f9cad9 -- src/renderer/src/components/sidebar/WorktreeCardAgents.tsx

Repository: stablyai/orca

Length of output: 41265


🏁 Script executed:

#!/bin/bash
printf '%s\\n' '--- row type and data builder ---'
rg -n -C 8 "export type DashboardAgentRow|type DashboardAgentRow|interface DashboardAgentRow|function useDashboardData|useDashboardData" src/renderer/src/components/dashboard/useDashboardData.ts src/renderer/src/components/dashboard src/renderer/src/components/sidebar/useWorktreeAgentRows.ts src/renderer/src/components/sidebar 2>/dev/null | head -260
printf '%s\\n' '--- worktree row hook ---'
sed -n '1,280p' src/renderer/src/components/sidebar/useWorktreeAgentRows.ts
printf '%s\\n' '--- acknowledgement selector ---'
sed -n '1,240p' src/renderer/src/components/sidebar/worktree-card-agent-ack-inputs.ts
printf '%s\\n' '--- status and retained entry contracts ---'
rg -n -C 12 "export (type|interface) AgentStatusEntry|type AgentStatusEntry|interface AgentStatusEntry|RetainedAgentEntry|state:.*working|state:.*done|state:.*waiting|state:.*idle" src/shared src/renderer/src/store src/renderer/src/components/dashboard/useDashboardData.ts src/renderer/src/components/sidebar | head -360

Repository: stablyai/orca

Length of output: 41755


🏁 Script executed:

#!/bin/bash
printf '%s\\n' '--- row builder ---'
sed -n '1,340p' src/renderer/src/components/sidebar/worktree-agent-rows.ts
printf '%s\\n' '--- row selectors ---'
sed -n '1,280p' src/renderer/src/components/sidebar/worktree-agent-row-selectors.ts
printf '%s\\n' '--- status type ---'
sed -n '1,240p' src/shared/agent-status-types.ts
printf '%s\\n' '--- decay helper ---'
rg -n -C 15 "agent-row-decay|decay|buildWorktreeAgentRows|rowSource:|state:" src/renderer/src/components/sidebar src/renderer/src/lib/agent-row-decay-state.ts | head -360

Repository: stablyai/orca

Length of output: 41973


Restrict isUnvisited to finished agents.

buildWorktreeAgentRows includes live working, blocked, and waiting entries in agents. The acknowledgement comparison does not check agent.entry.state, so an unacknowledged active agent can receive isUnvisited={true}. CompactAgentRow then renders that active row with bold foreground text.

Suggested fix
-      out[agent.paneKey] = ackAt < agent.entry.stateStartedAt
+      out[agent.paneKey] =
+        agent.entry.state === 'done' && ackAt < agent.entry.stateStartedAt

…ardAgents

pullfrog's review on stablyai#22870 pointed out that the compact tests in
WorktreeCardAgents.test.tsx force stateStartedAt: 0, so they never
exercise the isUnvisited prop the fix wires from WorktreeCardAgents
into CompactAgentRow — only the isolated CompactAgentRow test does,
which passes regardless of the parent wiring. Deleting the
isUnvisited={...} line from renderCompactAgentBranch left every test
green.

WorktreeCardAgents.test.tsx is already at the oxlint max-lines cap for
test files (800 non-blank/non-comment lines), so this integration
regression goes in its own file with a trimmed mock harness rather
than growing that one further.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

This run re-reviewed the delta since the prior pullfrog review — the follow-up commit e2ec568, which adds one integration regression test.

  • Pinned the compact isUnvisited wiring — new WorktreeCardAgents.unvisited-wiring.test.tsx renders WorktreeCardAgents in compact mode with an unacknowledged agent (stateStartedAt: 1000) and asserts the bold font-semibold text-foreground leading span. Verified by mutation that it fails if the isUnvisited={...} wiring line is removed, so the integration path flagged in the prior review is now covered.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@drakeo338

Copy link
Copy Markdown
Contributor Author

Good catch to double-check, but I think this is fine as-is. isUnvisited here is the same unvisitedByPaneKey[agent.paneKey] that the full-mode row already passes to DashboardAgentRow (WorktreeCardAgents.tsx lines 99-106 and 269) — neither checks state. The dashboard board computes the identical unrestricted signal in dashboard-row-bucket.ts, on purpose, so board and sidebar agree. "Unvisited" means "state changed since you last looked," not "finished." I added a test exercising a state: 'working' agent expecting bold, which the done-only restriction would break. Restricting compact would reintroduce the mismatch this PR fixes.

nwparker added a commit that referenced this pull request Sep 27, 2026
Show unread emphasis in compact workspace rows using the existing pane acknowledgment state.

Based on drakeo338’s bounded PR #22870. pinhaum reported #22857 and proposed the broader #22899 variant; the local candidate preserves the existing acknowledgement policy.

Co-authored-by: drakeo338 <[email protected]>
@drakeo338 drakeo338 closed this Sep 29, 2026
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.

[Bug]: Sidebar agent rows don't mark a finished agent the user hasn't seen (compact mode)

1 participant