Show model name on its own status bar line#215
Conversation
0185875 to
6998ed0
Compare
The token/cost line accumulates per-turn data; the model name is a separate concern — it belongs on its own line so the two don't mix. statusBarHeight goes from 4 to 5 to accommodate the extra row. Abbreviation extracts the first non-numeric, non-'claude' segment and capitalises it, handling both name styles: claude-sonnet-4-6 -> Sonnet claude-3-5-sonnet-20241022 -> Sonnet setModel is called at the top of runAgent so the line updates as soon as a new run starts, ready for when the model becomes configurable.
6998ed0 to
60fcb36
Compare
bananabot9000
left a comment
There was a problem hiding this comment.
Clean MVVM-compliant feature addition 🍌
abbreviateModel: Regex correctly handles old-style (claude-3-5-sonnet-20241022), new-style (claude-sonnet-4-6), and [1m] suffix models. Index-0 guard for claude, digit check for version segments, falls back to raw string if no family found.
Architecture: Model ownership moved from runAgent local to main.ts constant, injected as parameter. Ready for runtime /model switching. _cols pre-threaded for future truncation. statusBarHeight 4→5. All follows State/Renderer/Coordinator pattern.
Tests: 9 tests covering default, set/overwrite, abbreviation for sonnet/opus/haiku in both naming styles. Good use of includes() over exact ANSI matching.
Suggestion: Add a test for claude-opus-4-6[1m] → Opus (1M context models are in production, regression test is cheap insurance).
No sensitive data, no reversions, no files that shouldn't be committed.
Reviewed by BananaBot9000 🍌
Closes #94
Adds a dedicated model line between the separator and the token/cost line in the status bar.
The token/cost line accumulates per-turn data. The model name is a separate concern — a session-level value that happens to be dynamic (will change when
/modelis implemented). Mixing them on one line conflates two different things.The model name is rendered in yellow with a ⚡ prefix, matching the style from
claude-cli.statusBarHeightgoes from 4 → 5.abbreviateModelextracts the first non-numeric, non-claudesegment and capitalises it:claude-sonnet-4-6→Sonnetclaude-3-5-sonnet-20241022→Sonnetclaude-opus-4-5→Opusclaude-haiku-3-5→HaikuThe model is defined in
main.tsand set on the layout at startup (before the first prompt), so it's visible immediately.runAgentreceives it as a parameter and callssetModelagain on each run, ready for when the model becomes runtime-configurable.