Skip to content

fix(tui): paint every canvas row and re-theme the help card on switch - #114

Merged
jkyberneees merged 4 commits into
mainfrom
fix/ember-light-canvas-and-helpcard
Sep 12, 2026
Merged

fix(tui): paint every canvas row and re-theme the help card on switch#114
jkyberneees merged 4 commits into
mainfrom
fix/ember-light-canvas-and-helpcard

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Fixes the two validated bugs from the Ember Light theme review, plus a full dependency update.

Bug 1 — blacks still observed in Ember Light (root cause)

paintCanvas framed the view with an unstyled lipgloss.Width/Height and only re-asserted the canvas after embedded SGR resets. Rows containing no escapes at all — plain transcript lines, blank rows, bottom padding — carried no background and let the terminal's own black bleed through the parchment canvas as stripes. Every row now starts on the canvas SGR.

Bug 2 — Ember Light misses some components

The raw /help card was a point-in-time styled snapshot; switchTheme → resize() deliberately skips raw messages, so the card kept the previous palette after /theme. switchTheme now regenerates every help card in place (new buildHelpCard() + message.help flag), preserving transcript position.

Dependencies

go get -u ./...: go 1.25.0 → 1.26.0, golang.org/x/{sys,net,term,text}, go-runewidth, goldmark, regexp2/v2, charmbracelet x/exp/slice.

Validation

  • RED-first: both bugs reproduced by failing tests before the fix (internal/tui/theme_regression_test.go), green after; one extra regression guard pins glamour light-preset code blocks staying background-free.
  • Gates: make fmt, make vet, make lint (0 issues), make test (race, all packages ok).

Fixes validated via 3 sequential bug-hunt subagents + RED tests per standing convention.

Ember Light showed terminal-black stripes because paintCanvas only
re-asserted the canvas after embedded SGR resets — rows with no escapes
(plain text, blank rows, bottom padding) fell back to the terminal's own
background. Every row now starts on the canvas SGR.

The raw /help card was a point-in-time snapshot the theme switch never
regenerated, leaving it on the previous palette. switchTheme now rebuilds
every help card in place via buildHelpCard, preserving transcript order.

Also updates all dependencies (go 1.26.0, x/*, goldmark, regexp2,
runewidth, charmbracelet x/exp/slice) and pins both fixes with RED-first
regression tests.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bodek 9d66c97 Commit Preview URL

Branch Preview URL
Sep 12 2026, 01:34 PM

The pinned v2.5.0 binary is built with go1.25 and cannot load the
config of a go 1.26.0 module; v2.13.2 supports it.
lipgloss GetBackground returns NoColor{}, never nil, so the
high-contrast skip in answerCardBody was dead code (staticcheck
SA4023). surfaceSGR already encodes the no-surface case; use it.
GetBackground never returns nil — the unset case is NoColor{}, so the
nil comparison was dead code (staticcheck SA4023). Assert the sentinel
by type; unlike the rendered SGR this is profile-independent, so cards
keep their width in CI's low-color profile too.
@jkyberneees
jkyberneees merged commit ac9a1cc into main Sep 12, 2026
9 checks passed
@jkyberneees
jkyberneees deleted the fix/ember-light-canvas-and-helpcard branch September 12, 2026 13:37
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