Skip to content

Terminal canvas wears the terminal theme (black keyboard flash) - #2

Merged
karngyan merged 4 commits into
mainfrom
worktree-terminal-canvas-bg
Aug 8, 2026
Merged

Terminal canvas wears the terminal theme (black keyboard flash)#2
karngyan merged 4 commits into
mainfrom
worktree-terminal-canvas-bg

Conversation

@karngyan

@karngyan karngyan commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

The bug

Opening the phone keyboard pins the terminal pane to the visual viewport; the band below it — and rubber-band overscroll past the page — shows the document canvas. The canvas followed the app scheme (--flue-canvas, prefers-color-scheme), not the terminal theme, so a dark OS under a light terminal theme flashed black on every keyboard open.

The fix

While a terminal is mounted, the html element wears the terminal palette's background, painted through one paintGround helper at every site that paints the pane — mount, OS scheme change, theme apply, cross-tab theme sync — and handed back on unmount. The restore is guarded (surrenders only what the effect still owns), matching the answer viewport.ts's disposer gave the same teardown question.

Also in the branch: CLAUDE.md recording the new workflow rule — main is protected, everything lands by PR.

Tests: canvas paint + theme-change + hand-back, the no-claw-back guard, pane half pinned, afterEach canvas reset. Web suite 601/601 incl. the Tailwind prose-scanner build guard; tsc clean.

🤖 Generated with Claude Code

karngyan and others added 4 commits August 8, 2026 18:27
The pane stops at the visual viewport while a phone keyboard is up, and
rubber-band overscroll runs past the page; both bands showed the
document canvas, which followed the app scheme rather than the terminal
theme — a dark OS under a light terminal put a black flash behind every
keyboard open. The canvas now takes the terminal palette's background at
every site that paints the pane, and hands its colour back on unmount so
the rest of the app keeps the stylesheet's.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The review pointed at viewport.ts, which litigated this exact teardown
question two commits ago and answered with a guarded release; the canvas
restore now gives the same answer. A cleanup that unconditionally wrote
its saved colour back could claw the canvas from a replacement owner
that painted first. Also pinned in test: the pane half of paintGround,
and an afterEach reset so a canvas leak fails locally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CLAUDE.md records the workflow for agent sessions: branch always, PR
always, and the test surface to run before pushing — including the
Tailwind prose-scanner guard that makes comment-writing in web/ a
build concern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same signature to the byte as 2026-08-07 — subscriber closed over an
empty ring at 0.00s, ubuntu only, on a PR touching neither session nor
any Go file. The follow-up note said instrument if it recurs; recurred,
so the note now says what to log.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@karngyan
karngyan merged commit c362cbd into main Aug 8, 2026
1 check passed
karngyan added a commit that referenced this pull request Aug 8, 2026
PR #2 recorded the second sighting and asked for instrumentation; this
branch is the diagnosis and the fix, so the merged note keeps the
second sighting's forensics and retires the instrumentation ask.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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