Repository navigation
Upgrade Charm terminal stack to v2 - #18
Merged
Merged
Conversation
There was a problem hiding this comment.
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.Colorto Go’s standardimage/colorinterface 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
tea.View, removing the old imperative program-option setup;image/colorinterface for theme palettes;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 verifygofmt/git diff --checkgo vet ./...go test -race -cover ./...codexometer --version