Skip to content

fix(desktop): upgrade the chat-chrome invariant to a rendered computed-style contract #1312

Closed

Description

@Astro-Han

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.

Activity

  1. added 2 commits that reference this issue on Jul 22, 2026
    b8271d1
    6d3a0db
  2. self-assigned this
    on Jul 22, 2026
  3. Astro-Han commented on Jul 22, 2026

    @Astro-Han
    ContributorAuthor

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

  4. added 3 commits that reference this issue on Jul 22, 2026
    d88f2c4
    c2f34af
    4836711
  5. added a commit that references this issue on Jul 22, 2026
    5328bc0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions