feat: add full-surface TUI theme pack#356
Conversation
Add gtuvbox, Tokyo Night, Catppuccin, Solarized, Gruvbox, and One Dark as first-class TUI themes. Preserve and expand the built-in themes with theme-specific surface colors, fix CLI/settings theme precedence, and repaint the overview chart background when switching themes. Update the README theme documentation to match the shipped options.
|
@Felictycf is attempting to deploy a commit to the Inevitable Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
2 issues found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/tokscale-cli/src/tui/ui/stats.rs">
<violation number="1" location="crates/tokscale-cli/src/tui/ui/stats.rs:146">
P2: Selected graph-cell highlight can become unreadable because theme foreground may not contrast with heatmap backgrounds.</violation>
</file>
<file name="crates/tokscale-cli/src/tui/ui/bar_chart.rs">
<violation number="1" location="crates/tokscale-cli/src/tui/ui/bar_chart.rs:54">
P2: The added background repaint runs only for non-empty data; empty-data early return still skips repaint, leaving stale chart area on theme/data transitions.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Keep the overview chart background in sync even when the chart data becomes empty. Use contrast-aware foreground colors for selected contribution graph cells so the highlight stays readable across themes.
|
Addressed the two cubic findings in follow-up commit
Re-ran:
@cubic-dev-ai please re-run review. |
@Felictycf I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
2 issues found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/tokscale-cli/src/tui/ui/bar_chart.rs">
<violation number="1" location="crates/tokscale-cli/src/tui/ui/bar_chart.rs:50">
P2: Background repaint is bypassed in degenerate chart sizes because the early zero-dimension return happens before the new clear loop, allowing stale themed cells during compressed layouts.</violation>
<violation number="2" location="crates/tokscale-cli/src/tui/ui/bar_chart.rs:52">
P2: Empty-data repaint path updates only style and can leave stale chart glyphs in the buffer.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| let buf = frame.buffer_mut(); | ||
| let bar_count = data.len(); | ||
|
|
||
| for y in area.y..(area.y + area.height) { |
There was a problem hiding this comment.
P2: Background repaint is bypassed in degenerate chart sizes because the early zero-dimension return happens before the new clear loop, allowing stale themed cells during compressed layouts.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/tokscale-cli/src/tui/ui/bar_chart.rs, line 50:
<comment>Background repaint is bypassed in degenerate chart sizes because the early zero-dimension return happens before the new clear loop, allowing stale themed cells during compressed layouts.</comment>
<file context>
@@ -51,6 +47,16 @@ pub fn render_stacked_bar_chart(frame: &mut Frame, app: &App, area: Rect, data:
let buf = frame.buffer_mut();
let bar_count = data.len();
+ for y in area.y..(area.y + area.height) {
+ for x in area.x..(area.x + area.width) {
+ buf[(x, y)].set_style(Style::default().bg(app.theme.background));
</file context>
|
|
||
| for y in area.y..(area.y + area.height) { | ||
| for x in area.x..(area.x + area.width) { | ||
| buf[(x, y)].set_style(Style::default().bg(app.theme.background)); |
There was a problem hiding this comment.
P2: Empty-data repaint path updates only style and can leave stale chart glyphs in the buffer.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/tokscale-cli/src/tui/ui/bar_chart.rs, line 52:
<comment>Empty-data repaint path updates only style and can leave stale chart glyphs in the buffer.</comment>
<file context>
@@ -51,6 +47,16 @@ pub fn render_stacked_bar_chart(frame: &mut Frame, app: &App, area: Rect, data:
+ for y in area.y..(area.y + area.height) {
+ for x in area.x..(area.x + area.width) {
+ buf[(x, y)].set_style(Style::default().bg(app.theme.background));
+ }
+ }
</file context>
| buf[(x, y)].set_style(Style::default().bg(app.theme.background)); | |
| buf[(x, y)] | |
| .set_char(' ') | |
| .set_style(Style::default().bg(app.theme.background)); |
63e6d84 to
bef1da8
Compare
Summary
gtuvbox,tokyo-night,catppuccin,solarized,gruvbox, andone-darkas first-class TUI themes--themeis omitted and repaint the Overview chart background correctly when switching themesWhat Changed
Tokens per Daysection could keep the previous theme's background after a theme switchTesting
cargo test -p tokscale-cli themecargo test -p tokscale-cli stacked_bar_chart_repaints_background_when_theme_changestokscale --theme purpleNotes
cargo test -p tokscale-clistill reports two unrelated pre-existing failures intui::datacost assertions:test_data_loader_loads_agent_usage_from_roocode_filestest_data_loader_keeps_synthetic_gateway_messages_under_original_clientSummary by cubic
Adds a full-surface TUI theme pack with six new themes and consistent theming across the UI. Also fixes chart background repainting (including empty-data cases) and improves selection readability in the Stats heatmap; the theme flag now respects saved settings.
New Features
--themeflag is optional; if omitted, the persisted setting is used. CLI value still overrides settings.colorPalettevalues; “p” now cycles through all 15.Bug Fixes
Written for commit 616b225. Summary will update on new commits.