fix(tui): refresh footer on collaboration mode changes#16026
Merged
etraut-openai merged 8 commits intoopenai:mainfrom Mar 28, 2026
Merged
fix(tui): refresh footer on collaboration mode changes#16026etraut-openai merged 8 commits intoopenai:mainfrom
etraut-openai merged 8 commits intoopenai:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 fromChatWidgetsetters/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.
756e070 to
8213d19
Compare
etraut-openai
approved these changes
Mar 27, 2026
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.
c61d105 to
2a517d7
Compare
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
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
refresh_status_surfaces/refresh_status_line) fromAppevent handlers intoChatWidgetsetters via a newrefresh_model_dependent_surfaces()methodtuiandtui_app_servertuiandtui_app_serverwidgets#15961
Test plan
status_line_model_with_reasoning_plan_mode_footerverifying footer renders correctly in plan modeterminal_title_model_updates_on_model_change_without_manual_refreshintui_app_server