feat(tui): add configurable status line#86
Open
hakula139 wants to merge 10 commits into
Open
Conversation
Reframe the earlier usage-only design around the full status-line feature. The updated research keeps Claude Code, Codex, opencode, and the local setup as references while making the oxide-code choice explicit: a typed ordered roster of built-in segments first, with command hooks and account-limit telemetry deferred. The design now documents configurable ordering, implemented segment names, usage/cost data flow, default order, and the boundaries for later billing and task metadata work.
Replace the fixed status bar layout with an ordered built-in segment roster driven by [tui].status_line and OX_STATUS_LINE. The renderer keeps styling in the active theme, omits unavailable segments, and drops lower-utility segments before clipping core model/run-state information on narrow terminals. Thread Anthropic usage through the agent loop so the TUI can show cache-aware context pressure and an in-process estimated session cost. Pricing now lives on the model catalogue instead of a parallel matcher, with per-model rate rows for the known Claude catalogue. Update user docs, roadmap status, crate-tree notes, and snapshots to match the new status-line surface.
Anthropic's current lifecycle table still lists Opus 4.1 as active, so treating it as unknown would break explicit dated-id users and suppress available session-cost estimates. Keep Opus 4 deprecated and non-selectable, but restore the Opus 4.1 catalogue row with its higher first-party pricing. The picker remains curated to the latest Opus default.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Keep the latest provider usage for context pressure and auto-compaction, but accumulate every model request in a turn for billing estimates. Multi-round tool turns otherwise charged only the final assistant response and under-reported the status-line session cost.
A failed mid-session resume leaves the user on the current session, so clearing auto-compaction and status-line usage state made the still-active session lose context pressure and cost accounting. Return whether the swap succeeded and reset state only after an actual session change.
The configurable current-time segment was rendered from wall-clock time but idle status bars never marked the app dirty. Track the displayed minute for status lines that include current-time and request a repaint when it changes, without waking bars that do not render time.
An empty status-line roster hides the run state and interrupt affordances without making that tradeoff explicit. Validate both OX_STATUS_LINE and TOML status_line after parsing so launch fails with an actionable error instead of drawing blank chrome.
Remove stale wording that treated token and cost status as wholly deferred after the configurable status line shipped. Keep the remaining roadmap focused on extensions such as account-level billing, detailed cost commands, and persisted restore.
Add focused tests for the user-visible status-line branches Codecov highlighted: current-time rendering, final-segment truncation at very narrow widths, and priority-based omission before context, model, and run state are dropped.
The status-line cost estimate reads the active prompt-cache TTL through the client. Extend the existing config exposure test so the accessor stays covered without adding a getter-only test case.
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.
Summary
Adds a configurable TUI status line backed by an ordered roster of built-in segments. The default line now shows project location, branch, model / effort, cache-aware context use, estimated in-process session cost, run state, and thread title while letting users reorder or omit segments through config.
[tui].status_lineandOX_STATUS_LINE.Design decisions
/modelaliases and picker rows stay focused on the current defaults.Changes
config.rs,config/file.rsStatusLineSegment, default segment order, TOML parsing for[tui].status_line,OX_STATUS_LINEenv support, and non-empty roster validation.agent.rs,agent/event.rs,client/anthropic/*,model.rsUsageUpdated, accumulate estimated session cost across every model request in a turn, and store first-party Claude rates beside model metadata.main.rs,tui/app.rs,tui/components/status.rs,tui/components/status/line.rs,tui/theme.rsslash.rs,slash/context.rs,slash/model.rs,prompt/environment.rstui/components/snapshots/*,tui/snapshots/*docs/research/tui/status-line.md,docs/design/tui/status-line.md,docs/guide/configuration.md,docs/guide/theming.md,docs/roadmap.mdREADME.md,CLAUDE.md,docs/design/README.md,docs/research/README.md,docs/design/agent/auto-compaction.md,docs/design/slash/compact.mdTest plan
cargo fmt --all --checkcargo buildcargo clippy --all-targets -- -D warnings: zero warningscargo test: 2039 tests passcargo llvm-cov --ignore-filename-regex 'main\\.rs': 98.64% line coveragepnpm lint: 0 errorspnpm spellcheck: 0 issues