Repository navigation
fix(native-chat): paint the worker dock row's hover fill in one layer - #51963
Conversation
The running spinner is its own compositor layer and the row's stretched hit area covers it, so the hit area, the end cover and Stop moved to a separate overlap layer while the row's hover fill stayed in the list's. One hover was two paints that could land on different frames. Paint the status mark last inside an isolated row so the whole row stays in one layer. No pixel changes in rest, hover, focus or Stop states.
The mark now paints above the row's Stop/Clear wrapper; at very narrow rows their boxes can meet. The mark is decorative, so it takes no presses.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
Hovering a row in the native-chat worker dock could paint its hover fill in two halves (one part, then the other). This change keeps the whole row in one compositor layer, so the fill appears as one piece. Nothing else looks different.
What Changed
WorkerDockRow.tsxdraws a row's hover look with two elements:hover:bg-accent;data-worker-dock-hover). It paints the samebg-accentover the row's end, holds Stop, and appears withgroup-hover:opacity-100.A running worker's spinner is a CSS transform animation, so it gets its own compositor layer. The open button's full-row
::after(absolute inset-0, the hit area and focus ring) covers that spinner. Chromium therefore moved the::after, the end cover and Stop into a separate overlap layer above the spinner, while the row's fill stayed in the list's layer. One hover became two paints in two layers, and those could land on different frames.The CDP
LayerTreeof a hovered running row shows this:::afteroverlap layer (plus a 20×20 Stop layer at narrow widths).::afteror Stop layer. Any overlap layer after a spinner starts at a whole row.Two class changes in
WorkerDockRow.tsx:isolate, so z-order stays inside the row.pointer-events-none relative z-20. The spinner now paints last in the row, so nothing in the row paints after it and the whole row stays in one layer. The mark is decorative, so presses pass through to the row's hit area. Even on very narrow rows, where the mark's box meets Stop's, Stop still takes the press.Why
The fill and the end cover are meant to look like one surface. They were drawn in two compositor layers, so they could update on different frames. Raising the status mark keeps the row in one layer without changing what any state looks like.
Alternatives I rejected:
will-changeon the row: the row would still split at the spinner inside it.No comparable: mechanical.
Linked Issue
None. This is an internal fix from the owner's queue, and no GitHub issue exists for it.
Visual Proof
Component fixtures with invented data.
States on this branch, top to bottom: rest, hover, row keyboard focus, Stop keyboard focus, Stop hover. Each is pixel-identical to base.
The pointer entering a running row, one image per compositor frame, timestamps relative to pointer entry. Base, then head:
Testing
Tested on macOS only (headed Chromium and Electron 45). This is a CSS-only change, and the renderer is Chromium on every platform.
20 static states are pixel-identical between base and head: rest, hover, row keyboard focus ring, Stop focus ring, and Stop hover with its tooltip, in dark and light, at 720px and 300px panes (component fixtures, invented data).
Hit testing is unchanged: the mark, the title and the right padding open the row, and Stop hits Stop. On forced 40px rows, where the mark and Stop overlap, Stop still wins.
The dock/tasks vitest suites pass (96/96). Web typecheck and lint pass.
Never reproduced under automation. The two-halves paint did not show in automated hover captures, even on base. I recorded every compositor frame of the pointer entering a running row in headed Chromium and in Electron, and saw 0 mixed frames before and after. The layer split is shown in the layer tree; the frame captures only show that the change causes no regression.
Live real-chat check: inconclusive. I tried a running worker in a fresh, isolated dev profile with a throwaway folder and an invented task title. Both agent providers available in that profile hit usage limits before a worker could start, so no live row was hovered.
Deciding check: a hands-on hover of a running worker row in a real chat.
I manually tested these changes locally. This was not checked by hand in a real chat; see the repro gap above. All checks are scripted fixture checks.
Automated tests added/updated, or explained why not below. No new test: this changes only paint order and hit testing, and jsdom unit tests cannot observe compositor layers. The existing dock suites still pass.
Every added test fails without this change. Not applicable: no test added.
Performance
The diff adds three utility classes per worker-dock row. There is no new JS, state, subscription, IPC or layout work.
isolatemakes a stacking context; that adds no compositor layer by itself.pointer-events-noneon a 12px slot change only paint order and hit testing.::afteroverlap layer and the Stop layer go away. The overlap layers I measured are the same size or smaller (narrow case:215x64cut mid-row becomes215x32whole rows).Risk
The riskiest part is the raised status mark. If the z-order were wrong, the mark could cover something in the row, or a press on it could miss the row. The mark is
pointer-events-none, and every row state is pixel-identical to base in both themes at 720px and 300px.isolatekeeps the new z-index inside the row. The change has no data, settings, IPC, SSH or mobile impact. To back it out, a plain revert of the two commits is enough.Level: Low
AI Disclosure
Internal contributor.
Review
Code review: an internal two-reviewer round passed on this change.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). Run locally: lint, web typecheck and the dock/tasks tests. CI ran the full set and it is green.