Skip to content

Upgrade Charm terminal stack to v2 - #18

Merged
merefield merged 4 commits into
mainfrom
agent/charm-v2
Aug 17, 2026
Merged

merefield merged 4 commits into
mainfrom
agent/charm-v2

Conversation

@merefield

Copy link
Copy Markdown
Owner

Why

Codexometer was still built on Bubble Tea 1.2.4 and Lip Gloss 1.0.0. Moving to their current stable v2 releases keeps the terminal foundation supported and picks up the current input, Unicode-width, colour-profile, and rendering APIs without changing the dashboard's established behaviour.

What changed

  • upgrade Bubble Tea to 2.0.8, Lip Gloss to 2.0.6, and Charm ANSI helpers to 0.11.8;
  • migrate keyboard and mouse handling to the typed v2 event model;
  • declare alternate-screen and mouse modes through tea.View, removing the old imperative program-option setup;
  • use Go's standard image/color interface for theme palettes;
  • adapt the shared frame primitive to Lip Gloss v2's inclusive border sizing while preserving existing responsive dimensions;
  • retain the existing explicit hit-testing geometry and its interaction contract tests;
  • bump the maintained source version to 0.7.6 and document the v2 stack.

No unused Bubbles dependency or broad widget rewrite is introduced: the benchmark table, monitor graph, and mouse regions remain local because replacing them would be a higher-risk behavioural change rather than a low-risk rationalisation.

User impact

The interface, hotkeys, mouse controls, inline mode, themes, and responsive layouts remain unchanged. The application now uses the maintained Charm v2 APIs and their newer terminal rendering foundation.

Validation

  • go mod verify
  • gofmt / git diff --check
  • go vet ./...
  • go test -race -cover ./...
  • local Linux build and codexometer --version
  • cross-builds for Linux, macOS, and Windows on amd64 and arm64

@merefield
merefield marked this pull request as ready for review August 16, 2026 22:56
@merefield
merefield requested a lite review from Copilot August 16, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request upgrades Codexometer’s terminal UI foundation to the Charm v2 stack (Bubble Tea v2 + Lip Gloss v2 + updated ANSI helpers) while aiming to preserve existing dashboard behavior, layouts, and interaction contracts.

Changes:

  • Upgrades Bubble Tea/Lip Gloss dependencies and updates module sums.
  • Migrates UI input handling to Bubble Tea v2’s typed keyboard/mouse event model and moves alt-screen/mouse mode enabling into tea.View.
  • Switches theme palettes from lipgloss.Color to Go’s standard image/color interface and adjusts the shared frame primitive for Lip Gloss v2 sizing semantics.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.md Updates documented version and notes Bubble Tea/Lip Gloss v2 usage.
main.go Switches Bubble Tea import path to v2 and defers terminal mode selection to the UI view.
main_test.go Updates expected --version output to v0.7.6.
internal/version/version.go Bumps maintained fallback version to 0.7.6.
internal/version/version_test.go Updates fallback-version assertion to 0.7.6.
internal/ui/view.go Changes View() to return tea.View, declares terminal modes, and factors rendering into render().
internal/ui/view_test.go Updates rendering tests to call render() and adds coverage for declared terminal modes.
internal/ui/theme.go Converts palette color types to image/color.Color and keeps theme definitions aligned with v2 styling.
internal/ui/tabs.go Updates imports and adjusts tab rendering helpers to use image/color.Color.
internal/ui/tabs_test.go Updates mouse/key event construction for Bubble Tea v2 typed messages.
internal/ui/quota_status.go Adapts quota health color selection to return image/color.Color.
internal/ui/quota_status_test.go Updates expected color types to image/color.Color.
internal/ui/quota_api_eq_test.go Switches view rendering assertions to use render() output.
internal/ui/monitor.go Updates Lip Gloss import path to v2.
internal/ui/monitor_test.go Updates keyboard/mouse event tests to Bubble Tea v2 typed messages and uses render().
internal/ui/model.go Migrates Update loop to v2 key/mouse message types and introduces inline-mode state.
internal/ui/model_test.go Updates key/mouse helpers and rendering assertions for Bubble Tea/Lip Gloss v2 behavior.
internal/ui/meters.go Updates meter rendering signatures to accept image/color.Color.
internal/ui/meters_test.go Updates Lip Gloss import path to v2.
internal/ui/benchmark.go Updates Lip Gloss import path to v2.
internal/ui/benchmark_test.go Migrates benchmark interaction tests to Bubble Tea v2 typed messages and uses render().
go.mod Upgrades Bubble Tea/Lip Gloss to v2 module paths and refreshes indirect dependencies.
go.sum Updates dependency checksums to match the v2 terminal stack.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@merefield
merefield merged commit 38f2f9f into main Aug 17, 2026
8 of 9 checks passed
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.

2 participants