Skip to content

Migrate the TUI stack to charmbracelet v2 - #48

Merged
gurnben merged 1 commit into
mainfrom
feat/charmbracelet-v2
Oct 30, 2026
Merged

gurnben merged 1 commit into
mainfrom
feat/charmbracelet-v2

Conversation

@gurnben

@gurnben gurnben commented Oct 30, 2026

Copy link
Copy Markdown
Member

Summary

The charmbracelet v2 line landed under new module paths (charm.land/<lib>/v2), and the six dependency-bot v2 PRs (#29/#30/#31/#33/#34/#40) sat unmergeable because the API changes need a real migration. This is that migration, done in one place — merging this lets us close those bot PRs as superseded.

  • bubbletea v2: View() returns tea.View; alt-screen and mouse mode moved from program options onto the view itself; KeyMsg became an interface with KeyPressMsg as the concrete press type.
  • bubbles v2: viewport dimensions behind SetWidth/SetHeight/Width()/Height() accessors.
  • lipgloss v2: no global renderer — Style rendering always emits full-fidelity ANSI, and downsampling moved to the output layer. Every styled print in cmd/ goes through the profile-aware lipgloss writers (per-call TTY detection, so output capture in tests still works). Non-TTY output stays exactly as plain as v1 made it.
  • huh v2 / glamour v2: same constructor shapes; wired through the new module paths.

Verification

  • Full race suite, vet, staticcheck clean.
  • Live PTY on the v2 stack: monitor (full-screen frame + streaming replay + quit), skills picker, report browser, huh v2 init wizard.
  • Color behavior both ways: real terminal keeps colors, pipes stay ANSI-free (runs | cat -v clean).
  • init --yes idempotent smoke green.

💘 Generated with Crush

The charmbracelet v2 line landed under new module paths (charm.land/
<v2>), and the dependency bot's six v2 PRs sat unmergeable because the
API changes need a real migration. This is that migration, in one
place, verified end to end.

The mechanical surface: View() now returns tea.View — alt-screen and
mouse mode moved from program options onto the view itself; viewport
dimensions went behind SetWidth/SetHeight accessors; KeyMsg became an
interface with KeyPressMsg as the concrete press type; lipgloss.Color
turned from a type into a constructor returning color.Color.

The subtle one: lipgloss v2 removed the global renderer, so Style
rendering now always emits full-fidelity ANSI — downsampling moved to
the output layer. Every styled print in cmd/ therefore goes through
the profile-aware lipgloss writers (per-call TTY detection, so output
capture still works), which keeps non-TTY output exactly as plain as
v1 made it. Verified both ways: a real terminal keeps its colors, a
pipe stays clean.

All three full-screen TUIs verified live in a PTY on the v2 stack
(monitor replay with frame and streaming, skills picker, report
browser), the huh v2 init wizard renders, and the race suite is green.

💘 Generated with Crush

Assisted-by: Crush:rits/zai-org/glm-5-3
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