feat(tui): wire [ui.statusline] template into the modern status bar - #571
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ddf5cbc6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| frame.render_widget(Paragraph::new(line), area); | ||
| return; |
There was a problem hiding this comment.
Preserve dynamic status after rendering a custom strip
With any custom template configured, this return skips not only the built-in turn/token/cost strip but every status element below it: the minimal-skin mode badge, context warning, streaming/waiting spinner, permission indicator, toast, and queue state. Since the template is meant to replace only the metrics strip, template users instead get a static bar during active turns, and minimal-skin users cannot see their permission mode; render the template into the spans and continue through the dynamic-status logic.
Useful? React with 👍 / 👎.
| app.statusline_enabled = statusline_cfg.enabled; | ||
| app.statusline_template = statusline_cfg.template; |
There was a problem hiding this comment.
Refresh statusline settings after runtime config changes
These fields are copied only during startup, so /profile load, which replaces engine.state().config, cannot apply a profile's ui.statusline settings. The slash-command bridge subsequently synchronizes theme and edit mode but never these new fields, leaving the previous enabled/template values displayed until restart; synchronize them from the engine after a runtime config replacement.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ddf5cbc6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| frame.render_widget(Paragraph::new(line), area); | ||
| return; |
There was a problem hiding this comment.
Preserve live status segments with custom templates
When [ui.statusline].template is set, this early return bypasses the remainder of draw_status, including the minimal-skin permission-mode badge, streaming/tool spinner, action-required state, toast/status messages, queue and selection indicators, and session ID. Consequently, any custom-template user loses live progress information, and combining it with /minimal makes the active permission mode invisible despite the invariant immediately below. Use the rendered template only in place of the metrics spans, then continue appending the live status segments.
Useful? React with 👍 / 👎.
| app.statusline_enabled = statusline_cfg.enabled; | ||
| app.statusline_template = statusline_cfg.template; |
There was a problem hiding this comment.
Refresh status-line configuration after cross-project resume
These fields are copied only at TUI startup, while a cross-project /resume later makes finish_cwd_adoption adopt the destination project's Config without updating either App mirror. If the source and destination projects have different [ui.statusline] settings, the resumed session therefore continues displaying or hiding the source project's bar until restart even though the engine now holds the destination configuration. Synchronize both fields from cfg.ui.statusline during project adoption.
AGENTS.md reference: AGENTS.md:L129-L129
Useful? React with 👍 / 👎.
StatusLineConfig and render_statusline_template existed and were tested
but never called. Honour enabled=false (hide bar) and an optional
template with {model}/{turn}/{tokens}/{cost}/{cwd}/{session_id}.
75ddf5c to
6f19eb5
Compare
Summary
StatusLineConfig/render_statusline_templateinto the modern TUI status bar.enabled = falsehides the bar;templatereplaces the default turn/tokens/cost strip.Part of #561 (D6-13).
Test plan
statusline_template_is_honoured