Skip to content

feat(gain): colored dashboard with efficiency meter and impact bars#129

Merged
pszymkowiak merged 2 commits intortk-ai:masterfrom
heAdz0r:feat/gain-dashboard-viz
Feb 15, 2026
Merged

feat(gain): colored dashboard with efficiency meter and impact bars#129
pszymkowiak merged 2 commits intortk-ai:masterfrom
heAdz0r:feat/gain-dashboard-viz

Conversation

@heAdz0r
Copy link
Contributor

@heAdz0r heAdz0r commented Feb 15, 2026

Summary

Upgrades rtk gain text output with rich terminal visualization — colored percentages, efficiency meter, impact bars, and styled headers. All features degrade gracefully to plain text when piped.

Before: Plain monochrome text with fixed-width columns.

After: Color-coded dashboard with visual metrics:

rtk gain -p dashboard

Visual features visible in screenshot:

  • Percentages: green (≥70%), yellow (≥40%), red (<40%)
  • Commands: bright cyan + bold
  • Efficiency meter: green/olive progress bar
  • Impact bars: cyan proportional blocks
  • Section headers: bold purple/green

Implementation Details

Visual Features Added

Feature Description TTY-aware
Efficiency meter ASCII progress bar ████░░░░ with % Yes
Colored percentages Green/yellow/red by savings tier Yes
Impact bars Proportional █░ per command Yes
Styled headers Bold green section titles Yes
Command styling Bright cyan command names Yes
History indicators ≥70%, ≥40%, <40% No (Unicode)
Dynamic columns Auto-sized based on data widths N/A
KPI layout Aligned key-value pairs N/A

TTY Detection

All colored output uses std::io::IsTerminal to detect whether stdout is a terminal:

  • Terminal: Full color via colored crate
  • Pipe/redirect: Plain text (no ANSI escapes)
  • JSON/CSV export: Unaffected (no visual changes)

Files Changed

File Changes Purpose
src/gain.rs +205 -42 Visualization helpers, styled output

Total: 205 lines added, 42 lines modified (single file)

No New Dependencies

Uses the existing colored crate (already in Cargo.toml) and std::io::IsTerminal (stable since Rust 1.70).

Security Compliance

  • No critical files modified: Only src/gain.rs (display-only module)
  • No Cargo.toml changes: No new dependencies
  • No user input handling: All display functions receive internal data
  • No network/filesystem access: Pure formatting logic

Verification

  • cargo build — compiles clean
  • cargo clippy — no errors
  • cargo test — all pre-existing tests pass
  • cargo fmt — formatted
  • TTY degradation verified (pipe output contains no ANSI escapes)

🤖 Generated with Claude Code

heAdz0r and others added 2 commits February 15, 2026 15:43
Upgrade `rtk gain` output with rich terminal visualization:
- Colored percentage cells (green ≥70%, yellow ≥40%, red <40%)
- Efficiency meter: ASCII progress bar with savings percentage
- Impact bars: proportional block charts per command
- Styled section headers (bold green)
- Command names in bright cyan
- History tier indicators (▲/■/•)
- Dynamic column widths for clean table alignment
- KPI-style key-value layout for summary metrics

All visual features are TTY-aware via std::io::IsTerminal — output
degrades gracefully to plain text when piped or redirected.

No new dependencies (uses existing `colored` crate).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shows colored terminal output of `rtk gain -p` with:
- Project-scoped token savings header
- Efficiency meter with color gradient
- Per-command table with colored Avg% and Impact bars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@pszymkowiak pszymkowiak left a comment

Choose a reason for hiding this comment

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

Display-only changes, no security concern, all tests pass. LGTM.

Minor nit: std::io::stdout().is_terminal() is called per-cell instead of once at the top — not blocking but worth cleaning up later. Also remove the // added comments before merge.

@pszymkowiak pszymkowiak merged commit 606b86e into rtk-ai:master Feb 15, 2026
2 checks passed
ahundt added a commit to ahundt/rtk that referenced this pull request Feb 16, 2026
Merged from upstream/master:
- feat(gain): colored dashboard with efficiency meter and impact bars (rtk-ai#129)
- refactor(init): add upsert_rtk_block for idempotent CLAUDE.md management (rtk-ai#123)
- feat(cargo): add cargo nextest support with failures-only output (rtk-ai#107)
- docs: version references to 0.16.0/0.18.0 in README, ARCHITECTURE, CHANGELOG
- ci: add validate-docs workflow

Conflict resolution in src/init.rs:
- Kept RtkBlockUpsert enum and upsert_rtk_block() from upstream
- Kept patch_instruction_file() from current branch (for @RTK.md references)
- Both features coexist: upsert_rtk_block for legacy --claude-md mode,
  patch_instruction_file for default @RTK.md reference mode

All 688 tests pass.
ahundt added a commit to ahundt/rtk that referenced this pull request Feb 23, 2026
Merged from upstream/master:
- feat(gain): colored dashboard with efficiency meter and impact bars (rtk-ai#129)
- refactor(init): add upsert_rtk_block for idempotent CLAUDE.md management (rtk-ai#123)
- feat(cargo): add cargo nextest support with failures-only output (rtk-ai#107)
- docs: version references to 0.16.0/0.18.0 in README, ARCHITECTURE, CHANGELOG
- ci: add validate-docs workflow

Conflict resolution in src/init.rs:
- Kept RtkBlockUpsert enum and upsert_rtk_block() from upstream
- Kept patch_instruction_file() from current branch (for @RTK.md references)
- Both features coexist: upsert_rtk_block for legacy --claude-md mode,
  patch_instruction_file for default @RTK.md reference mode

All 688 tests pass.
ahundt pushed a commit to ahundt/rtk that referenced this pull request Feb 23, 2026
…tk-ai#129)

* feat(gain): add colored dashboard with efficiency meter and impact bars

Upgrade `rtk gain` output with rich terminal visualization:
- Colored percentage cells (green ≥70%, yellow ≥40%, red <40%)
- Efficiency meter: ASCII progress bar with savings percentage
- Impact bars: proportional block charts per command
- Styled section headers (bold green)
- Command names in bright cyan
- History tier indicators (▲/■/•)
- Dynamic column widths for clean table alignment
- KPI-style key-value layout for summary metrics

All visual features are TTY-aware via std::io::IsTerminal — output
degrades gracefully to plain text when piped or redirected.

No new dependencies (uses existing `colored` crate).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add dashboard visualization screenshot

Shows colored terminal output of `rtk gain -p` with:
- Project-scoped token savings header
- Efficiency meter with color gradient
- Per-command table with colored Avg% and Impact bars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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