Skip to content

Match transparent canvas backgrounds to the active theme - #2700

Merged
jonathanKingston merged 3 commits into
mainfrom
copse/from-id-be0d523a-d366-449e-ad4b-ae568a0f13-1e2561
Sep 20, 2026
Merged

jonathanKingston merged 3 commits into
mainfrom
copse/from-id-be0d523a-d366-449e-ad4b-ae568a0f13-1e2561

Conversation

@jonathanKingston

Copy link
Copy Markdown
Collaborator

Transparent inline canvases were composited against different surfaces: the visible webview exposed Copse's active theme, while the hidden agent mirror defaulted to white. A dark-theme canvas could therefore disagree with its preview even though both loaded the same artifact bytes.

This change samples Copse's resolved body background (including UI tint) and uses it as the hidden BrowserWindow's compositor backdrop. The visible webview host explicitly uses the same base theme surface. Artifact CSS remains authoritative, so an artifact that paints its own background still overrides the default; a fully transparent sampled color falls back to the resolved boot theme.

The focused Electron regression emits both a transparent artifact and one with an explicit background. It checks the preview pixel against the active tinted theme, checks the open canvas host against the app surface, verifies the explicit artifact color wins, and saves the transparent dark-theme state for review.

Validation:

  • pnpm test -- canvas-agent-mirror — 11 passed
  • pnpm run build — passed
  • Typecheck, type-aware lint, formatting, demo-site consistency, and dead-code analysis — passed after the final edits
  • pnpm run check:oracle — 262 specs live, 15 invariants passed
  • pnpm run check:e2e-syntax — 289 files parsed cleanly

The full pnpm run check could not complete its unit phase in this command sandbox: unrelated watcher tests receive EMFILE, fixed /tmp paths receive EPERM, and a later durable rerun stalled behind the inaccessible orphaned test process. The focused local Electron spec also stopped before Copse launched because Chromium could not create its extension-unpack temp directory. CI should run tests/e2e/canvas-background-parity.e2e.ts and publish the visual evidence.

Co-Authored-By: Copse noreply@copse.dev
Copse-Models: acp:codex-acp#gpt-5.6-sol, acp:claude-acp#claude-fable-5-1[1m]

Co-Authored-By: Copse <noreply@copse.dev>

Copse-Models: gpt-6, acp:claude-acp#claude-fable-5-1[1m]
github-actions Bot added a commit that referenced this pull request Sep 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🖥️ PR preview

@copse-release-bot

Copy link
Copy Markdown
Contributor

Reference screenshots ready for review

Review GitHub’s image diffs in screenshot PR #2710.
Merge it (or enable auto-merge) to apply the accepted PNGs to copse/from-id-be0d523a-d366-449e-ad4b-ae568a0f13-1e2561.

Rendered for eb434cc8bbd1 by CI run 35477648789; the immutable artifact is reference-screenshot-candidates-35477648789.

If this source branch moves, a later successful render closes the stale review PR and replaces this link.

@jonathanKingston
jonathanKingston merged commit 0a7a096 into main Sep 20, 2026
41 of 43 checks passed
@jonathanKingston
jonathanKingston deleted the copse/from-id-be0d523a-d366-449e-ad4b-ae568a0f13-1e2561 branch September 20, 2026 14:10
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