Skip to content

feat(chat): worker card floats as a small pill above the message box and opens a card - #47980

Merged
AmethystLiang merged 3 commits into
mainfrom
AmethystLiang/worker-card-ticker
Nov 24, 2026
Merged

AmethystLiang merged 3 commits into
mainfrom
AmethystLiang/worker-card-ticker

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The full-width "N workers" table above the chat box is now one small pill floating just above the message box. It shows the worker that most needs you (a question first, then a failure, then running work) and "+N" for the rest. Press it and a small card opens upward with one line per worker. Nothing is drawn behind the pill or the card, so the chat stays readable around them.

Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​883 $\color{#cf222e}{\Huge{\mathbf{−}}}$​220 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​663
Prod 34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1677 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1267 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​410

What Changed

  • Pill: centered just above the message box: status mark, the most relevant worker's title (truncated) and a muted "+N". Pick order: waiting on you > failed > running > queued > done, newest first within each. 28px tall, card surface, 1px border, small shadow, at most min(320px, pane − 40px) wide. Its title fades in when it changes. With no listed rows it still shows when the agent reports unlisted background work ("Background work running", so Stop all stays reachable) or when the worker read failed ("Workers couldn't load").
  • Card: opens upward over the pill with an 8px gap, min(320px, pane − 24px) wide, no header, title or close button. It closes on a pill press, Escape (focus back to the pill) or a press outside. Presses inside a dialog a row opened, a toast, or Jump to latest do not fold it.
  • Rows: 30px with a full-width hover fill: status mark (question = amber icon, failed = red dot, running = yellow spinner, queued = grey ring, done = green dot), the title once (a waiting worker shows its question), the time in tabular numbers, then Stop or Clear and an arrow on hover or focus. No column headers and no "Status unavailable" text. Six rows show, then the card scrolls (fewer in a short pane). A press anywhere on a row opens the worker, as before.
  • Footer: "Stop all" (agents that can only stop everything) and "Clear failed" show in a slim footer only when they apply.
  • Keyboard: Up/Down move between rows, Home/End jump, Enter opens, Down past the last row returns to the pill; Up/Down on the open pill enter the list. A row whose details are still loading keeps focus when they arrive; a pending move never takes focus back once you put it elsewhere.
  • Transcript and Jump to latest: while the pill shows, the transcript keeps 36px (pill + 8px) at its end so the last message is never under it, and a reader following the end stays there when the pill appears. Jump to latest rides 8px above the pill, or above the open card, in the same centered slot.
  • Dialogs: a worker's result or details dialog returns focus to its row, or to the pill in its own chat pane if the row left.
  • Motion (card fade + 4px slide in 120ms, pill title fade 150ms) is off under reduced motion. New strings go through i18n (pillLabel with plural forms and others; Korean included). Strings the old table used and nothing references any more are removed.

Checked against comparable products.

Why

The docked table covered the end of the conversation with a solid band, repeated the ticket name in front of every title and showed column headers and "Status unavailable" text. The pill keeps the same information and controls one press away and leaves the transcript visible.

Linked Issue

Maintainer task; no separate issue.

Visual Proof

Component fixtures with invented workers (no real data).

Light Dark
1 worker, folded
3 workers, folded / open
20 workers, folded / open
Waiting on you leads
Jump to latest stacked over the pill
300px pane, long titles
Row hover (Stop + arrow), footer (Stop all, Clear failed)

Testing

  • tests/tools/worker-dock-rendered/run.mjs drives the built fixtures in headless Chromium with real layout, 70 checks, all passing: pill open/fold by click, Enter, Space and touch; Escape with focus back to the pill; outside press; Up/Down/Home/End/Enter on rows, including 100 workers whose details load late and a failed read that recovers on the next key press; a focus move during End is not taken back; wheel, touch and keyboard scrolling of 20 rows with six visible; 300px pane; Jump to latest stacked 8px above the pill and above the open card, and a full click on it at normal and 250px heights; last transcript line clear of the pill; needs-you ordering; hover Stop and arrow; Stop, Clear, Clear failed, Stop all, restore; result and details dialogs return focus within their own pane; remote chats show no dead controls; unlisted work keeps Stop all. The same suite against main's code fails every pill check (only the unchanged Stop, Clear, remote and completion behaviour passes there).
  • Unit tests updated for the row and strip; pnpm check:changed passed earlier on this branch; CI is the full gate for the final head.
  • Every added check fails without this change and avoids the test anti-patterns.

Performance

Row details are read only while the card is open, as before. The folded pill needs one title; when its worker's details are missing it asks once for the window around that worker (the same one-shot read the list already uses; at most three tries per roster change). Rows and their 30s age tickers render only while the card is open; the pill has no timer. The transcript observes one more box (its padded frame) with its existing ResizeObserver, and the card's height is observed only while it is open.

Risk

Level: Medium. Renderer only; no data, IPC or persistence change. The riskiest part is keyboard and focus handling in a virtualized list whose details arrive late; if it went wrong, a key press could land on the wrong row or focus could fall to the page. Rollback: plain revert.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable.

Notes

No security, saved-data, remote-host or platform-specific behaviour changes. Remote chats keep their read-only rows.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (CI will cover)

@AmethystLiang
AmethystLiang marked this pull request as ready for review November 24, 2026 02:33
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The worker dock changes from an in-flow roster to a floating pill and expandable card. The card adds ordered worker rows, lazy detail loading, keyboard navigation, and footer actions. Status wiring distinguishes incomplete work from unavailable worker reads. Dialogs restore focus to the opener or its pane. Transcript spacing, fixtures, and rendered checks are updated.

Merge Risk: Moderate · previous review 4aed8

The floating worker pill and card work in the main flows, but several open issues remain. A worker whose detail reads fail three times can stay stuck on "Loading worker…". Visible rows in small rosters may not load their details. There are also smaller focus, accessibility-label and fixture gaps. These should be addressed or explicitly accepted before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the worker card becomes a small pill above the message box that opens a card. The changeset replaces the docked worker table with a floating pill and an upward-opening…
Description check Passed The description follows the template. It has an ELI5, What Changed, Why, Visual Proof with before/after images, Testing with a headless Chromium suite, a Performance statement, Risk with level and rol…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the worker card becomes a small pill above the message box that opens a card. The changeset replaces the docked worker table with a floating pill and an upward-opening card, so the title matches the primary change. It is a single, concise sentence in conventional commit form.

Full details: Description check

Explanation

The description follows the template. It has an ELI5, What Changed, Why, Visual Proof with before/after images, Testing with a headless Chromium suite, a Performance statement, Risk with level and rollback, and Notes. Some template items are blank or unfilled: the 'Fixes #' issue link is replaced by 'Maintainer task; no separate issue', the AI Disclosure and Review headings are empty, and the final checklist item for pnpm lint/typecheck/test/build is unchecked. The author does not state whether the 'Visual Proof' shows a before state, and the images are fixture-based. These gaps are minor relative to the overall completeness.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@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: 11

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 846fd5eb-0a87-4170-b99f-58a87ca415ab
Commits

Reviewing files that changed from the base of the PR and between 4a4cbdf and a8886d8.

Files selected for processing: 37

  • src/renderer/src/components/native-chat/appearance/native-chat-appearance-style.ts
  • src/renderer/src/components/native-chat/tools/tasks/NativeChatBackgroundTasksStatus.test.tsx
  • src/renderer/src/components/native-chat/tools/tasks/NativeChatBackgroundTasksStatus.tsx
  • src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.test.tsx
  • src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/NativeChatWorkerDock.fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/NativeChatWorkerDockFrame.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockCardFooter.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockGlyph.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockHarness.fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockHeader.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockItem.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockPill.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockProviderDetailsDialog.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockResultDialog.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockResultDialogSlot.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRoster.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRow.test.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRow.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRowAction.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-card-focus.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-detail-reads.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-scroll.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-card-order.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-focus-return.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-labels.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-pane-fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-roster-budget.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-scroll-anchor.ts
  • src/renderer/src/components/native-chat/viewport/scroll/NativeChatJumpToLatest.tsx
  • src/renderer/src/components/native-chat/viewport/scroll/use-native-chat-transcript-resize.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json
  • tests/tools/worker-dock-rendered/fixture-session.mjs
  • tests/tools/worker-dock-rendered/loading-and-layer-checks.mjs
  • tests/tools/worker-dock-rendered/run.mjs
Files with no reviewable changes: 6

  • src/renderer/src/components/native-chat/tools/tasks/dock/NativeChatWorkerDock.fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockHeader.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockItem.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRow.test.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-scroll.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-roster-budget.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

// One fixed bottom gap: the last row never hangs its controls; rail padding covers its 34px macOS overlay.
export function nativeChatTranscriptOuterClass(railVisible: boolean): string {
return `native-chat-transcript-inset pt-10 pb-5 ${railVisible ? 'px-9' : 'px-3 sm:px-4'}`
return `native-chat-transcript-inset pt-10 pb-[calc(var(--spacing)*5+var(--native-chat-worker-pill-room,0px))] ${railVisible ? 'px-9' : 'px-3 sm:px-4'}`

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 · Functional Correctness · Quick win

Remove the pill room from the transcript's bottom padding in dock fit mode.

In dock fit mode, the worker pill is in normal flow, so it takes its own height. The transcript still adds --native-chat-worker-pill-room as bottom padding. That reserves the pill's space twice. The extra gap can also reduce transcript height in short panes. Add a dock-fit override that uses the base bottom gap only.

Suggested fix

--- "a/src/renderer/src/components/native-chat/appearance/native-chat-appearance-style.ts"
+++ "b/src/renderer/src/components/native-chat/appearance/native-chat-appearance-style.ts"
@@ -21,7 +21,7 @@
 export const NATIVE_CHAT_APPEARANCE_ROOT_CLASS = 'native-chat-appearance bg-chat-canvas'
 // One fixed bottom gap: the last row never hangs its controls; rail padding covers its 34px macOS overlay.
 export function nativeChatTranscriptOuterClass(railVisible: boolean): string {
-  return `native-chat-transcript-inset pt-10 pb-[calc(var(--spacing)*5+var(--native-chat-worker-pill-room,0px))] ${railVisible ? 'px-9' : 'px-3 sm:px-4'}`
+  return `native-chat-transcript-inset pt-10 pb-[calc(var(--spacing)*5+var(--native-chat-worker-pill-room,0px))] [[data-native-chat-dock-fit~=dock]_&]:pb-[calc(var(--spacing)*5)] ${railVisible ? 'px-9' : 'px-3 sm:px-4'}`
 }
 export const NATIVE_CHAT_TRANSCRIPT_COLUMN_CLASS =
   'mx-auto flex w-full max-w-(--chat-content-max-width) flex-col gap-5 px-[5px]'
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
return `native-chat-transcript-inset pt-10 pb-[calc(var(--spacing)*5+var(--native-chat-worker-pill-room,0px))] ${railVisible ? 'px-9' : 'px-3 sm:px-4'}`
return `native-chat-transcript-inset pt-10 pb-[calc(var(--spacing)*5+var(--native-chat-worker-pill-room,0px))] [[data-native-chat-dock-fit~=dock]_&]:pb-[calc(var(--spacing)*5)] ${railVisible ? 'px-9' : 'px-3 sm:px-4'}`

if (focusedNow && focusedNow !== document.body) {
return
}
const next = items[Math.min(saved.index, items.length - 1)]

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 · Functional Correctness · Quick win

Use the focused row’s latest position when it leaves.

Focus B in [A, B, C, D], then remove A. B stays focused, but its saved index is still 1. If B is then cleared, the handoff selects D instead of C. Update the saved index while B remains present, then use that index when B leaves. If no earlier row moved, the handoff should still select the row that replaces B.

): (anchor: string) => void {
const reads = useRef(new Map<string, { tries: number; pending: boolean }>())
useEffect(() => {
reads.current = new Map()

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 · Stability & Availability · Quick win

Keep in-flight reads across roster changes.

If a worker joins while a read for A is pending, the roster reset discards A’s pending record. The next navigation to A can start a duplicate read before the first one settles. Reset the retry budget separately from in-flight tracking. A roster change can then renew A’s budget without allowing a second request while the first is pending.

return useCallback(
(anchor: string) => {
const read = reads.current.get(anchor) ?? { tries: 0, pending: false }
if (!loadWindow || read.pending || read.tries >= MAX_TRIES) {

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.

Major · Functional Correctness · Heavy lift

Give users a way to retry after the detail-read limit.

If three requests for the same worker fail, keyboard navigation, scrolling, and reopening the card cannot retry that worker while the identity list stays unchanged. Even after the connection recovers, the row can still say “Loading worker…” and cannot be opened. Keep the cap for automatic reads, but expose a failed state with an explicit Retry action that can start a fresh attempt.

<div className="flex gap-2">
{[0, 1].map((pane) => (
<div key={pane} data-fixture-pane={pane} className="min-w-0 flex-1">
{workerDockFixturePane(<Harness count={2} failed={1} command details open />)}

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 · Functional Correctness · Quick win

Keep each pane's actions in its own harness.

This scene mounts two Harness instances. Each instance replaces window.api.runtime.call, so the second instance handles requests from both panes. Both instances also use the same SOURCE and dispatch IDs.

If you clear dock:0 in pane 0, the second instance removes dock:0 from pane 1. Pane 0 remains unchanged. Give each pane distinct identities and route mock requests to the matching harness. Keep the existing single-pane action behavior.

pane.style.setProperty(JUMP_LIFT, PILL_ROOM)
}
}
}, [card, open])

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 · Functional Correctness · Quick win

Recompute the Jump to latest lift when the card mounts after the roster was hidden.

When expanded stays true and the roster hides, the hook's dependencies do not change. Opening the card later does not rerun the lift effect, so Jump to latest is not raised above the new card. Gating the hook's open value on shown makes the effect rerun when the card mounts.

Suggested fix

-  useWorkerDockJumpLift(card, props.expanded)
+  useWorkerDockJumpLift(card, props.expanded && shown)

})
useLayoutEffect(measure, [measure, props.expanded, props.narrow, orderHeld, items])
const shown = total > 0 || identities.length > 0 || Boolean(props.incomplete)
useLayoutEffect(measure, [measure, props.expanded, items.length])

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 · Functional Correctness · Quick win

Recalculate the card budget when the footer changes height.

If Stop all becomes available while a short pane is open, the footer can mount without a change to items.length, props.expanded, or the pane’s size. The card keeps its old row budget, and its extra height consumes the space reserved for Jump to latest. Remeasure on footer presence and height changes. Keep the existing pane observer for pane resizes.

Comment on lines +188 to +196
const missing = visibleItems.find(
(item) =>
item.end > top &&
item.start < bottom &&
items[item.index] &&
!props.rows.has(items[item.index].id)
)
if (missing) {
loadWindow(items[missing.index].id)

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 · Functional Correctness · Quick win

Skip missing rows that cannot start a detail read.

In a virtualized card, if the first visible missing row exhausts its attempts, .find() still selects it. loadWindow then returns without starting a read. A later visible row that the host could load from a different window stays unloaded. Make the wrapper report whether it started a read, and continue scanning when it declines. Keep the one-new-read limit for each scan.

Comment on lines +190 to +191
item.end > top &&
item.start < bottom &&

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.

Major · Functional Correctness · Quick win

Use real row positions for detail reads in small rosters.

For 30 or fewer workers, useNativeChatToolRunWindow returns start: 0 and end: 0 for every row. Since scrollTop is nonnegative, item.end > top rejects every row. If the pill’s worker is loaded but a lower visible worker is not, opening or scrolling the card never requests that worker’s details. Use the mounted rows’ offsets in small mode and keep the virtualizer offsets in large mode.

onMouseDown={keepFocus}
onClick={onJump}
className="absolute bottom-3 left-1/2 flex h-8 -translate-x-1/2 items-center gap-1.5 rounded-full border border-transparent bg-[color-mix(in_srgb,var(--secondary-foreground)_5%,var(--secondary))] px-3 text-xs font-medium text-[color-mix(in_srgb,var(--secondary-foreground)_75%,black)] shadow-floating transition-[opacity,translate,background-color,color] duration-150 ease-out hover:bg-[color-mix(in_srgb,var(--secondary-foreground)_10%,var(--secondary))] dark:bg-accent dark:text-[color-mix(in_srgb,var(--accent-foreground)_75%,white)] dark:hover:bg-[color-mix(in_srgb,var(--accent-foreground)_8%,var(--accent))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none data-[shown=false]:pointer-events-none data-[shown=false]:translate-y-1 data-[shown=false]:opacity-0"
className="absolute bottom-[max(calc(var(--spacing)*3),var(--native-chat-worker-jump-lift,0px))] left-1/2 flex h-8 -translate-x-1/2 items-center gap-1.5 rounded-full border border-transparent bg-[color-mix(in_srgb,var(--secondary-foreground)_5%,var(--secondary))] px-3 text-xs font-medium text-[color-mix(in_srgb,var(--secondary-foreground)_75%,black)] shadow-floating transition-[opacity,translate,background-color,color] duration-150 ease-out hover:bg-[color-mix(in_srgb,var(--secondary-foreground)_10%,var(--secondary))] dark:bg-accent dark:text-[color-mix(in_srgb,var(--accent-foreground)_75%,white)] dark:hover:bg-[color-mix(in_srgb,var(--accent-foreground)_8%,var(--accent))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none data-[shown=false]:pointer-events-none data-[shown=false]:translate-y-1 data-[shown=false]:opacity-0"

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 · Functional Correctness · Quick win

Apply the open-card lift only when the card overlays the transcript.

In fit mode, the open card is in flow below the transcript. The lift at WorkerDockPill.tsx:141 still adds the full card height, so Jump to latest rises above the transcript's bottom edge by that height. In a short pane, the transcript can shrink to its minimum, and the button can then extend above the transcript's top edge and overlap the pane title actions. Clipping depends on pane overflow, which this review did not confirm.

Limit the card-height term to the non-fit case. In fit mode, the lift should stay at the pill room (PILL_ROOM), because the card does not sit over the transcript there. Outside fit mode, keep the current calc(PILL_ROOM + card height + 8px) lift.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/worker-card-ticker branch from a8886d8 to ee0fa1d Compare November 24, 2026 02:58

@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: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0bc8c042-8476-461b-8199-4981822e80da
Commits

Reviewing files that changed from the base of the PR and between a8886d8 and ee0fa1d.

Files selected for processing: 7

  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRoster.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRow.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRowAction.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-scroll-anchor.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json
  • tests/tools/worker-dock-rendered/run.mjs
Files skipped from review as they are similar to previous changes: 2

  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

}
}}
>
<WorkerDockGlyph glyph={row ? workerDockGlyph(row) : 'queued'} />

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 · Functional Correctness · Quick win

Do not show a queued glyph for an unavailable worker.

A loaded, non-retired worker in unavailable previously showed no status glyph. The row still omits its status label, but workerDockGlyph now displays the same glyph as a queued worker. Keep the glyph's space without drawing a mark for this state. Preserve the loading glyph and the glyphs for known states.

className={cn(
'pointer-events-none absolute inset-y-0 right-0 flex items-center gap-1 rounded-r-md bg-accent pr-2 pl-1.5',
pending
? 'opacity-100 [&>*]:pointer-events-auto'

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 · Functional Correctness · Quick win

Keep the arrow click-through when the row is pending.

The pending selector enables pointer events on every direct child, including the arrow SVG. A click on the painted arrow targets the overlay instead of the row's open button. Exclude the SVG as the nonpending branch does, or enable pointer events only on the action wrapper. Keep the pending action visible. (tailwindcss.com)

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/worker-card-ticker branch from ee0fa1d to 10bb6f6 Compare November 24, 2026 03:10

@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: 8

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5db59dc9-2951-4c83-bf70-410132c7a1f4
Commits

Reviewing files that changed from the base of the PR and between ee0fa1d and 10bb6f6.

Files selected for processing: 13

  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockHarness.fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockPill.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRoster.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-card-budget.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-detail-reads.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-feed.test.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-feed.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-focus-return.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-pane-fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-seed-fixture.ts
  • src/renderer/src/components/native-chat/viewport/scroll/NativeChatJumpToLatest.tsx
  • tests/tools/worker-dock-rendered/loading-and-layer-checks.mjs
  • tests/tools/worker-dock-rendered/run.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment on lines +28 to +31
read.tries++
read.pending = true
reads.current.set(anchor, read)
void loadWindow(anchor)

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 · Stability & Availability · Quick win

Retry the top-row read after the feed starts listening.

WorkerDockRoster requests the top worker's row once, in an effect that depends only on missingTop and loadWindow (WorkerDockRoster.tsx:161-165). When the roster mounts, that effect can run before the parent feed subscribes. In that case WorkerDockFeed.window returns without an RPC (worker-dock-feed.ts:185-188). The hook still counts the attempt and clears pending (use-worker-dock-detail-reads.ts:28-39). A collapsed feed subscribes with includeRows: false (worker-dock-feed.ts:124, NativeChatStructuredSessionStatus.tsx:68), so its snapshot carries no row details for the top row. Activation does not issue a window read, and later visibility changes do not re-run the effect because the top ID and loader are unchanged. The collapsed pill can keep its fallback title until the card opens or the top worker changes.

Make the top-row request run again when the feed gains its first listener. Also do not count a request that the feed resolves without an RPC against the three-try limit.

Comment on lines +2 to +3
export function workerDockOpenerPane(opener: HTMLElement): Element | null {
return opener.closest('[data-native-chat-root]')

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 · Functional Correctness · Quick win

Capture the originating chat pane before the opener can detach.

The result slot reads the opener's pane in a layout effect. If the row is removed in the same commit that first exposes the dialog, the effect reads a detached opener. workerDockOpenerPane then returns null. When the dialog closes, returnWorkerDockFocus cannot find the pill or composer in that pane, so focus is not returned to the chat.

The slot must record the pane while the opener is still attached. Capture it on the opener-open path, before the row can unmount, or use the same render-time capture pattern as WorkerDockProviderDetailsDialog.tsx. The chosen mechanism is open. The required behavior is that the saved pane must come from the attached opener.

// The host's first 50 are newer queued workers; the two older running ones lead the card unloaded.
export const reorderOpen720 = defineFixture({
width: 720,
render: () => workerDockFixturePane(<Harness count={51} failed={0} reorder lazy={50} open />)

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 · Functional Correctness · Quick win

Seed two unloaded leading rows in the reorder fixture.

With count={51}, seed indices 49 and 50 are running. lazy={50} preloads index 49, so only one leading row starts unloaded. Use count={52} with lazy={50} to put both running rows outside the preloaded set. This makes the fixture exercise the two-placeholder case described above it.

Comment on lines +68 to +72
'{{count}} workers, latest: {{title}}',
{
count: total,
title,
defaultValue_one: '{{count}} worker, latest: {{title}}'

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 · Functional Correctness · Quick win

Do not call the selected worker “latest.”

If an older worker fails and a newer worker is running, the pill selects the failure. Its accessible name still calls that worker “latest.” Use wording that does not imply chronological order, and keep the localized singular and plural forms.

const ownJump = Boolean(
pane?.contains(target) && target.closest('[data-native-chat-jump-latest]')
)
if (!ownJump && !target.closest(KEEPS_CARD_OPEN)) {

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 · Functional Correctness · Heavy lift

Limit the outside-press exception to overlays owned by this card.

A press in any application popper leaves the card open, even if the popper belongs to a different feature. The selector checks the type of overlay but not its owner. Track which overlay this card opened and exempt only that overlay. Keep the separate exception for this pane’s Jump to latest button.

Comment on lines +148 to +149
setHeld(null)
props.onExpandedChange(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.

Minor · Functional Correctness · Quick win

Discard the scroll anchor when the card closes.

Scroll down in a small roster, close it, then reopen it without scrolling. The new viewport starts at the top, but the anchor still refers to the previous viewport. When worker details next update, preserveAnchor can move the new viewport back to the old position. Clear the anchor when the viewport closes or unmounts. Keep anchor restoration for updates within the same opening.

Also applies to: 379-380

const firstVisibleKey = visibleItems[0]?.index
useEffect(loadVisibleWindow, [firstVisibleKey, props.rows, loadVisibleWindow])
const drawnKey = visibleItems.map((item) => item.index).join(',')
useEffect(loadVisibleWindow, [drawnKey, props.rows, props.expanded, loadVisibleWindow])

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 · Functional Correctness · Quick win

Scan for missing details when the viewport grows.

Near the end of a virtualized roster, overscan can already include a missing row below the viewport. If the pane grows, that row can become visible without a scroll event or a change to drawnKey. The row remains a placeholder until another event triggers a read. Rerun the scan when the viewport height changes. Keep the intersection check so overscan alone does not start a read.

</div>
</>
<WorkerDockCardFooter
stopAll={props.stopAll}

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 · Functional Correctness · Quick win

Keep keyboard focus in the dock when Stop all disappears.

If a keyboard user activates Stop all and the provider then withdraws that control while workers remain listed, the footer removes the focused button. The row-removal handler has no saved row for a footer control, so it cannot restore focus. Return focus to the pill if the removed control still owned focus. Do not move focus if the user already moved elsewhere.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/worker-card-ticker branch from 10bb6f6 to f1af055 Compare November 24, 2026 05:26

@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

Nitpick comments: 1

src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockHarness.fixture.tsx: 1

81-81: Trivial · Maintainability & Code Quality · Quick win

Keep the fixture detail loader stable across rerenders.

The read hook uses loader identity to distinguish a replacement feed. This function gets a new identity whenever Harness rerenders, including when start() adds a worker while reads are held. The next visible-row scan can then start another read for an already-pending anchor.

Wrap this function with the imported useLatestHandler. That preserves access to current rows without making an ordinary fixture update look like a feed replacement. It also lets rendered checks exercise same-feed pending-read deduplication.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc4a6159-2717-4f7e-88a1-5a3cba1d1ff1
Commits

Reviewing files that changed from the base of the PR and between 10bb6f6 and f1af055.

Files selected for processing: 7

  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockHarness.fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRoster.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-card-focus.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-detail-reads.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-focus-return.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-pane-fixture.tsx
  • src/renderer/src/i18n/locales/en.json
Files skipped from review as they are similar to previous changes: 1

  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

// or the worker read failed (which claims nothing about whether anything runs).
const unlisted = items.length === 0 && Boolean(props.incomplete)
const unread = items.length === 0 && !unlisted && Boolean(props.unavailable)
const shown = items.length > 0 || unlisted || unread

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 · Functional Correctness · Quick win

Restore pane focus when the focused pill disappears.

If the collapsed pill has focus and the last worker leaves, shown becomes false. The roster returns null, but its hooks remain mounted. No row focus was recorded, and the focus hook's unmount cleanup does not run. Focus therefore falls to the page instead of the pane's message box.

Track whether the disappearing pill owned focus. Restore focus to that pane's editor only in that case. Preserve focus if the user already moved elsewhere.

…and opens a card

- test(chat): open a retained provider failure from its row
- fix(chat): worker card uses theme tokens, drops unused dock strings
- test(chat): match the mixed-kind worker row label
- fix(chat): worker card keeps Stop all, focus and Jump to latest reachable
- fix(chat): worker card compiles under React Compiler; add unlisted-work strings
- fix(chat): worker card keeps focus where the user put it and Jump to latest clickable
- chore(chat): type-safe harness registry in the worker dock fixture
- fix(chat): worker card rows keep the full width for titles; the list fades where rows are out of view
- fix(chat): worker card keeps Jump to latest, detail reads and focus reliable in edge cases
- fix(chat): worker card lint clean without a hook suppression or type casts
- fix(chat): worker card returns focus to the real message box; a replaced feed's reads don't block the new one
…lready moved

Focus that moved to another pane before the dialog handed it back stays there; only focus that fell to the page returns to the opener, the pane's pill or the pane's editor.
@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/worker-card-ticker branch from f1af055 to 4aed8d8 Compare November 24, 2026 06:13

@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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2022e5b6-2805-4524-8b4b-64bfb46b50be
Commits

Reviewing files that changed from the base of the PR and between f1af055 and 4aed8d8.

Files selected for processing: 10

  • src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.test.tsx
  • src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/NativeChatWorkerDock.fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRowAction.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-feed.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-focus-return.test.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-focus-return.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json
Files skipped from review as they are similar to previous changes: 3

  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment on lines +114 to +119
dock={
<>
{dock(expanded, rows)}
{footer}
</>
}

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 · Functional Correctness · Quick win

Forward the dock prop from NativeChatComposerField, or stop passing it from the fixture.

NativeChatComposerFieldProps declares dock, and the fixture passes the worker dock and failure footer through it. NativeChatComposerField does not destructure dock and does not spread the remaining props. The supplied element never renders.

Fixtures that depend on the dock content can fail. The Stop and Retry helpers can throw when their controls are absent. Render dock in the component's dock slot, or remove the prop from the fixture if the slot is not meant to be used there.

Suggested change

Add dock to the destructured parameters and render it where the composer dock slot belongs. The exact placement needs the component's JSX structure, which the inspected output does not show in full. Confirm the slot's location before editing.

…ck fixture, reads a row's state from its name in the stop check
@AmethystLiang
AmethystLiang merged commit 60b0cba into main Nov 24, 2026
55 checks passed
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.

1 participant