Skip to content

fix(tui): refresh footer on collaboration mode changes#16026

Merged
etraut-openai merged 8 commits intoopenai:mainfrom
fcoury:fix/plan-mode-footer-refresh
Mar 28, 2026
Merged

fix(tui): refresh footer on collaboration mode changes#16026
etraut-openai merged 8 commits intoopenai:mainfrom
fcoury:fix/plan-mode-footer-refresh

Conversation

@fcoury
Copy link
Copy Markdown
Contributor

@fcoury fcoury commented Mar 27, 2026

Summary

  • Moves status surface refresh (refresh_status_surfaces / refresh_status_line) from App event handlers into ChatWidget setters via a new refresh_model_dependent_surfaces() method
  • Ensures model-dependent UI stays in sync whenever collaboration mode, model, or reasoning effort changes, including the footer and terminal title in both tui and tui_app_server
  • Applies the fix to both tui and tui_app_server widgets

#15961

Test plan

  • Added snapshot test status_line_model_with_reasoning_plan_mode_footer verifying footer renders correctly in plan mode
  • Added terminal_title_model_updates_on_model_change_without_manual_refresh in tui_app_server
  • Verify switching collaboration modes updates the footer in real TUI
  • Verify model/reasoning effort changes reflect in the status bar and terminal title
Copilot AI review requested due to automatic review settings March 27, 2026 18:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes stale footer/status rendering in the TUI by moving status-surface refresh logic into ChatWidget setters so the footer updates automatically when collaboration mode, model, or reasoning effort changes (applied to both tui and tui_app_server).

Changes:

  • Introduce refresh_model_dependent_surfaces() and call it from ChatWidget setters/mode updates to refresh model display + status surfaces together.
  • Remove now-redundant App-level status refresh calls for model/effort/mode updates.
  • Update/add snapshot tests to validate footer updates on collaboration mode switches and add a plan-mode footer snapshot.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
codex-rs/tui_app_server/src/chatwidget.rs Centralizes model+status refresh via refresh_model_dependent_surfaces() and wires it into setters/mode updates.
codex-rs/tui_app_server/src/app.rs Removes App-level status refresh calls now handled inside ChatWidget.
codex-rs/tui_app_server/src/chatwidget/tests.rs Adds snapshot test CWD helper, mode-switch test, and plan-mode footer snapshot.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__unified_exec_wait_status_renders_command_in_single_details_row.snap Snapshot updated to reflect refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__unified_exec_begin_restores_working_status.snap Snapshot updated for new footer content.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__status_widget_active.snap Snapshot updated for new footer content.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__status_line_model_with_reasoning_plan_mode_footer.snap New snapshot covering plan-mode footer rendering.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__review_queues_user_messages_snapshot.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__preamble_keeps_working_status.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__mcp_startup_header_booting.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__guardian_parallel_reviews_render_aggregate_status.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__guardian_denied_exec_renders_warning_and_denied_request.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__guardian_approved_exec_renders_approved_request.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__compact_queues_user_messages_snapshot.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__chatwidget_tall.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui_app_server/src/chatwidget/snapshots/codex_tui_app_server__chatwidget__tests__app_server_guardian_review_denied_renders_denied_request.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget.rs Centralizes model+status refresh via refresh_model_dependent_surfaces() and wires it into setters/mode updates.
codex-rs/tui/src/app.rs Removes App-level status refresh calls now handled inside ChatWidget.
codex-rs/tui/src/chatwidget/tests.rs Adds snapshot test CWD helper, mode-switch test, plan-mode footer snapshot, and updates terminal title assertion.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_wait_status_renders_command_in_single_details_row.snap Snapshot updated to reflect refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__unified_exec_begin_restores_working_status.snap Snapshot updated for new footer content.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_widget_active.snap Snapshot updated for new footer content.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_line_model_with_reasoning_plan_mode_footer.snap New snapshot covering plan-mode footer rendering.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__review_queues_user_messages_snapshot.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__preamble_keeps_working_status.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__mcp_startup_header_booting.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__guardian_parallel_reviews_render_aggregate_status.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__guardian_denied_exec_renders_warning_and_denied_request.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__guardian_approved_exec_renders_approved_request.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__compact_queues_user_messages_snapshot.snap Snapshot updated for refreshed footer/status line.
codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__chatwidget_tall.snap Snapshot updated for refreshed footer/status line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fcoury fcoury force-pushed the fix/plan-mode-footer-refresh branch 3 times, most recently from 756e070 to 8213d19 Compare March 27, 2026 19:23
fcoury added 3 commits March 27, 2026 20:19
Refresh model-dependent status surfaces inside `ChatWidget` whenever
model, reasoning, or collaboration mode changes. This keeps the
footer in sync when Plan mode changes the effective reasoning effort.

Mirror the same ownership in `tui_app_server` and add regression tests
plus snapshots for the immediate footer update path.
Normalize the chatwidget snapshot assertions so platform-specific
current working directory strings are coerced to a single canonical
value before `assert_snapshot!` runs.

This keeps one shared snapshot for the footer and status rendering
tests instead of carrying separate Windows and Unix expectations for
path text that is incidental to the behavior under test.
@fcoury fcoury force-pushed the fix/plan-mode-footer-refresh branch from c61d105 to 2a517d7 Compare March 27, 2026 23:37
fcoury added 2 commits March 27, 2026 21:03
Keep backend snapshot lines at their original rendered width when
normalizing the platform-specific cwd to `/tmp/project`.

This avoids Windows-only snapshot diffs caused by shorter normalized
path text changing the right padding in `TestBackend` output.
EOF && git push
Extend chatwidget snapshot normalization to cover truncated cwd
renderings as well as full path strings, and route the remaining
`/tmp/project` test fixtures through the shared helper.

This keeps footer and popup snapshots stable across Windows and Unix
even when the cwd is ellipsized before assertion.
EOF && git push origin fix/plan-mode-footer-refresh
@etraut-openai etraut-openai merged commit bede1d9 into openai:main Mar 28, 2026
16 of 40 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants