Skip to content

feat(tui): wire [ui.statusline] template into the modern status bar - #571

Merged
emal-avala merged 1 commit into
mainfrom
feat/statusline-wire
Jul 29, 2026
Merged

feat(tui): wire [ui.statusline] template into the modern status bar#571
emal-avala merged 1 commit into
mainfrom
feat/statusline-wire

Conversation

@emal-avala

Copy link
Copy Markdown
Member

Summary

  • Wire built-but-unused StatusLineConfig / render_statusline_template into the modern TUI status bar.
  • enabled = false hides the bar; template replaces the default turn/tokens/cost strip.

Part of #561 (D6-13).

Test plan

  • statusline_template_is_honoured
  • CI green

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +1464 to +1465
frame.render_widget(Paragraph::new(line), area);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +414 to +415
app.statusline_enabled = statusline_cfg.enabled;
app.statusline_template = statusline_cfg.template;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@emal-avala

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +1464 to +1465
frame.render_widget(Paragraph::new(line), area);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +414 to +415
app.statusline_enabled = statusline_cfg.enabled;
app.statusline_template = statusline_cfg.template;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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}.
@emal-avala
emal-avala force-pushed the feat/statusline-wire branch from 75ddf5c to 6f19eb5 Compare July 29, 2026 07:54
@emal-avala
emal-avala merged commit e5c7dfe into main Jul 29, 2026
10 of 13 checks passed
@emal-avala
emal-avala deleted the feat/statusline-wire branch July 29, 2026 07:54
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.

1 participant