Add TUI config options, Apps column, and analyzer fixes#189
Conversation
Formatting config: - currency_symbol: configurable cost prefix (default "$") - cost_decimal_places: configurable cost precision (default 2) TUI config (all backward-compatible via serde defaults): - default_view: open in daily/weekly/monthly/yearly - default_tab: open on a named tool tab - confirm_quit: require a second 'q' to quit - hidden_columns: hide individual aggregate-table columns - accent_color: recolor title, tabs, and selected row - color_costs: tint Cost cells by magnitude (relative to view max) - show_header: toggle the title banner Apps column: - Add apps map to DailyStats with ref-counted merge logic - Render contributing tools per period in the All Tools view - Auto-collapse the column on single-tool tabs where it is empty Analyzers: - claude_code: populate session_name from in-file summary so the live session view shows real titles instead of the upload path - copilot: honor a provider-reported cost when present, otherwise price counted tokens via the shared pricing table (matches the other analyzers) Tests: apps ref-counting, parse_accent, cost_heat, AggregateViewMode::from_config, and Copilot cost coverage.
📝 WalkthroughWalkthroughAdds configurable currency symbol and cost decimal places to ChangesConfigurable Currency, TUI Appearance, and Analyzer Cost/Session Improvements
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Please verify whether Cloud needs any changes or not. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/config.rs`:
- Around line 73-78: The new config fields currency_symbol, cost_decimal_places,
and the tui fields were added to the struct (in the formatting and tui sections
spanning lines 73-78 and 81-127) but the set_config_value function (starting at
line 378) does not yet handle these fields, causing them to be rejected as
unknown keys when users try to set them via CLI. Update the set_config_value
function to add match cases or conditional branches that handle all the new
field names (currency_symbol, cost_decimal_places, and the tui fields) so they
can be properly set through the config set command, ensuring the function routes
values to the correct struct fields using the appropriate setter logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 69d37cc2-0273-450d-9204-c0832ed5193b
📒 Files selected for processing (9)
src/analyzers/claude_code.rssrc/analyzers/copilot.rssrc/config.rssrc/main.rssrc/tui.rssrc/tui/tests.rssrc/types.rssrc/utils.rssrc/utils/tests.rs
The new formatting/tui options were settable only by editing ~/.splitrail.toml directly. Make them first-class CLI options so the `config set` / `config show` contract is consistent with the existing fields. - set_config_value: add arms for currency-symbol, cost-decimal-places, default-view, default-tab, confirm-quit, hidden-columns (comma-split), accent-color, color-costs, show-header - show_config: display all new fields; default-tab shows "All Tools" when empty, hidden-columns shows "None" when empty - main.rs: list the new keys (and upload-today-only) in the Set help - Extend set_config_value_behaviour to round-trip every new key
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/config.rs`:
- Around line 459-480: Add validation and normalization for the three enum-like
TUI config fields in the config parsing logic. For `default-view`, normalize the
input by trimming and converting to lowercase, then validate against the set of
allowed view options; reject with an error if the value is unknown. For
`accent-color`, apply the same normalization (trim and lowercase) and validate
against the supported color palette; return an error for invalid colors. For
`hidden-columns`, trim each column name (already done) but also validate that
each column name matches a known/valid column identifier, rejecting the entire
field if any column is unrecognized. This ensures typos and casing differences
are caught immediately during configuration load rather than causing silent
failures later.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bccb2a76-fa33-45a5-bb50-eb19591b56b1
📒 Files selected for processing (2)
src/config.rssrc/main.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main.rs
Formatting config:
TUI config (all backward-compatible via serde defaults):
Apps column:
Analyzers:
Tests: apps ref-counting, parse_accent, cost_heat, AggregateViewMode::from_config, and Copilot cost coverage.
Summary by CodeRabbit