Skip to content

mac: conch shot photographs the app in its real appearance - #296

Merged
stupart merged 1 commit into
mainfrom
fix/shot-appearance
Sep 16, 2026
Merged

stupart merged 1 commit into
mainfrom
fix/shot-appearance

Conversation

@stupart

@stupart stupart commented Sep 16, 2026

Copy link
Copy Markdown
Owner

conch shot has been photographing the app in the wrong appearance, and I believed it all night.

DebugSnapshot captures with view.cacheDisplay(in:to:) — an offscreen re-render. The Mac palette is dynamic colours (NSColor(name: nil) { appearance in … }) which resolve against the current drawing appearance, and an offscreen draw does not inherit the window's. On a light system every snapshot came back dark.

That matters more than a wrong-coloured PNG. conch shot exists precisely so UI work can be verified without capturing the screen, and it is the tool I used to "verify" a night of changes — the transcript's reading rhythm, the floating composer, the 52 pt header, the folded tool run, the sidebar. Every one of those was judged in a theme the user never sees. A screenshot tool that lies is worse than no screenshot tool, because it is believed.

The fix is to draw inside window.effectiveAppearance.performAsCurrentDrawingAppearance { … }.

Guard

ui-snapshot.test.ts already pins that this tool never captures the screen. It now also pins that it photographs the app as it actually looks: the wrapper is present, the draw happens inside it (a wrapper that doesn't contain the call is decoration), and there is exactly one cacheDisplay so a second can't creep in outside the appearance.

mutation result
the wrapper is dropped and it draws in whatever theme is current 1 fail
the wrapper stays but the draw moves outside it 1 fail
a second draw creeps in outside the appearance 1 fail

Gate

bun test 2301/0 exit 0 (2300 on main plus this guard) · tsc --noEmit exit 0 · swift test 131/0 · Mac xcodebuild BUILD SUCCEEDED · iOS xcodebuild BUILD SUCCEEDED (performAsCurrentDrawingAppearance is macOS 11+; the target is 14.0).

Why this is first

Tyler's feedback was that the shipped app doesn't match the mockups and the JS lab felt better. Before changing any pixels I need a camera that tells the truth — otherwise I'd be tuning a light app by looking at dark renders of it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SfEX6bfwCGXtThk1JRNmsE

DebugSnapshot captures with view.cacheDisplay, an offscreen re-render. The
palette is dynamic NSColors that resolve against the CURRENT DRAWING
appearance, and an offscreen draw does not inherit the window's -- so on a
light system every snapshot came back dark.

That is worse than a wrong-coloured PNG. conch shot exists so UI work can be
checked without capturing the screen, and it is what I used to "verify" a
night of changes: the reading rhythm, the floating composer, the 52pt header,
the folded tool run, the sidebar. All of them were judged in a theme the user
never sees. A screenshot tool that lies is worse than none, because it is
believed.

Now the draw happens inside
window.effectiveAppearance.performAsCurrentDrawingAppearance.

ui-snapshot.test.ts already pinned that this tool never captures the screen;
it now also pins that the draw sits INSIDE the wrapper (a wrapper that does
not contain the call is decoration) and that there is exactly one cacheDisplay
so a second cannot creep in outside the appearance.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SfEX6bfwCGXtThk1JRNmsE
@stupart
stupart merged commit b447f1e into main Sep 16, 2026
2 checks passed
@stupart
stupart deleted the fix/shot-appearance branch September 16, 2026 20:11
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