You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(desktop): upgrade the chat-chrome invariant to a rendered computed-style contract #1312
Part of #1303 (surfaced by Codex review of #1308).
Context
#1308 deleted scripts/check-chat-chrome-screenshot.mjs, which inspected rendered pixels of the chat chrome to assert: the shell gutter is visibly distinct from the content card, there is no dark 1px seam at the sidebar/content boundary, and the bottom rounded corners expose shell/shadow pixels.
The surviving apps/desktop/src/main/__tests__/chat-chrome-no-gradient-contract.test.ts is a source-string contract: it reads the renderer CSS and regex-matches the first rule body for each selector. That locks the source declarations (flat --surface-canvas shell, no linear-gradient, no border-right on the darwin session panel, 12px radius + box-shadow on the floating card) but not the rendered cascade — a later @layer override, an adjacent element's shadow, a token merge, or clipping could pass the source test while the rendered UI regresses. So the rendered chat-chrome invariant the deleted pixel script guarded is not fully replaced.
Acceptance
Upgrade the chat-chrome invariant to a rendered computed-style contract. Pattern: scripts/check-chat-marker-computed-style.mjs loads the built renderer CSS into a headless Electron window and reads getComputedStyle.
Assert the rendered facts the pixel script used to check: shell background differs from the content card, no sidebar/content seam (no effective 1px dark border), the content card has a 12px radius and a non-empty box-shadow.
Green in both light and dark. The existing source-string contract can stay as a fast pre-check; the rendered contract is the authoritative lock.
Notes
Per AGENTS.md, computed-style/text contracts are the repo's preferred regression lock over fixed screenshots, so this aligns the chat-chrome invariant with that convention instead of restoring the pixel matrix.
One scope note against the acceptance text: after two external review rounds the contract is moving from the suggested standalone headless-Electron script into a Playwright e2e spec that reads getComputedStyle from the real booted shell, forcing data-os and light/dark in-page so the darwin glass cascade is still covered on the Linux runner. The synthetic mirror DOM produced fidelity defects in two consecutive review rounds (missing painters, then a wrong gutter painter model), and the raw-electron CI step hit the documented --no-sandbox trap, so the standalone shape was costing more than it bought. The asserted rendered facts stay exactly as listed here (shell/card contrast, no seam, 12px radius, edge shadow, light and dark), with stricter corner and shadow precision. The source-string contract stays as the fast pre-check.
Activity
test(desktop): add rendered computed-style contract for the chat chrome
test(desktop): pin the chat-chrome mirror classes and point to the re…
Astro-Han commentedon Jul 22, 2026
Working on this in #1318.
One scope note against the acceptance text: after two external review rounds the contract is moving from the suggested standalone headless-Electron script into a Playwright e2e spec that reads
getComputedStylefrom the real booted shell, forcingdata-osand light/dark in-page so the darwin glass cascade is still covered on the Linux runner. The synthetic mirror DOM produced fidelity defects in two consecutive review rounds (missing painters, then a wrong gutter painter model), and the raw-electron CI step hit the documented--no-sandboxtrap, so the standalone shape was costing more than it bought. The asserted rendered facts stay exactly as listed here (shell/card contrast, no seam, 12px radius, edge shadow, light and dark), with stricter corner and shadow precision. The source-string contract stays as the fast pre-check.test(desktop): lock the chat chrome with a rendered computed-style e2…
test(desktop): lock the chat chrome with a rendered computed-style e2…
test(desktop): lock the chat chrome with a rendered computed-style e2…
test(desktop): lock the chat chrome with a rendered computed-style e2…