Skip to content

fix(native-chat): paint the worker dock row's hover fill in one layer - #51963

Merged
AmethystLiang merged 2 commits into
mainfrom
AmethystLiang/fix-worker-row-hover
Nov 29, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
AmethystLiang/fix-worker-row-hover

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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.tsx draws a row's hover look with two elements:

  • the row's own hover:bg-accent;
  • the end cover (data-worker-dock-hover). It paints the same bg-accent over the row's end, holds Stop, and appears with group-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 LayerTree of a hovered running row shows this:

  • Before: list layer + spinner layer + a full-row ::after overlap layer (plus a 20×20 Stop layer at narrow widths).
  • After: no ::after or Stop layer. Any overlap layer after a spinner starts at a whole row.

Two class changes in WorkerDockRow.tsx:

  • The row gets isolate, so z-order stays inside the row.
  • The status-mark slot gets 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:

  • Dropping the end cover's own fill and hiding the age under Stop: this changes truncation and layout.
  • will-change on the row: the row would still split at the spinner inside it.
  • Stopping the spinner's compositor animation: out of scope, and that stepped animation is deliberate.

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.

After: dark, 720px pane
After: light, 300px pane

The pointer entering a running row, one image per compositor frame, timestamps relative to pointer entry. Base, then head:

Before: dark, 720px
After: dark, 720px
Before: light, 300px
After: light, 300px

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.

  • isolate makes a stacking context; that adds no compositor layer by itself.
  • The z-index and pointer-events-none on a 12px slot change only paint order and hit testing.
  • Per hovered running row, the full-row ::after overlap layer and the Stop layer go away. The overlap layers I measured are the same size or smaller (narrow case: 215x64 cut mid-row becomes 215x32 whole rows).
  • A hover now repaints one layer instead of two.
  • Workload: the dock shows at most six rows, and it can have several running spinners. Row count doesn't change any of this.
  • No timings were taken; this section is reasoning from the code and the layer tree.

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. isolate keeps 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

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)
  • I stated the risk: what could break, for whom, and how to back it out
  • 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). Run locally: lint, web typecheck and the dock/tasks tests. CI ran the full set and it is green.

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.
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The worker dock row now creates a local stacking context. Its status mark is positioned above the row action and made pointer-transparent, so pointer input can reach the row’s open button. The status mark’s contents and rendering logic are unchanged.

Merge Risk: Minimal · up to 11661

This is a small styling change to the worker dock row's stacking and pointer handling. Presses still pass through the status mark to the row. Whether the hover paint split is fixed has not been confirmed in a real chat, but no concrete defect has been found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: a hover-fill paint fix for the native-chat worker dock row, moving it into one compositor layer. It matches the raw summary (isolation and z-order change on WorkerDockRow) …
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.
Description check Passed The description follows the repository template closely: it has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and…
Full details: Title check

Explanation

The title names the change: a hover-fill paint fix for the native-chat worker dock row, moving it into one compositor layer. It matches the raw summary (isolation and z-order change on WorkerDockRow) and the PR objectives. It is specific and follows the conventional-commit style. The title does not mention the z-index or pointer-events mechanism, but it is not overly broad.

Full details: Description check

Explanation

The description follows the repository template closely: it has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist sections. Each section is substantively filled with a clear before/after, mechanism, rejected alternatives, layer-tree evidence, and a stated risk level with a revert path. Gaps: the Linked Issue section states 'None' rather than linking an issue, which the template marks as required for outside contributors; the author says they are an internal contributor, and the template exempts maintainers from opening needless issues, so this is a minor concern. The Testing section honestly marks manual testing as unchecked and states the live real-chat check was inconclusive. The Visual Proof section provides before/after images, which satisfies the requirement. Performance is reasoned rather than measured, and the author says so. The Review section is brief but present.

  • 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

Recent 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: 5d00ac10-b120-4faa-bcf4-17799ca4f530
Commits

Reviewing files that changed from the base of the PR and between 31c94ba and 1166127.

Files selected for processing: 1

  • src/renderer/src/components/native-chat/tools/tasks/dock/WorkerDockRow.tsx

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

@AmethystLiang
AmethystLiang merged commit beaecb7 into main Nov 29, 2026
56 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