Refactor TUI app module into submodules#18753
Merged
etraut-openai merged 4 commits intomainfrom Apr 20, 2026
Merged
Conversation
0541be6 to
8c51c92
Compare
canvrno-oai
approved these changes
Apr 20, 2026
5139af3 to
efe8369
Compare
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.
Why
The TUI app module had grown past the 512K source-file cap enforced by CI/CD. This keeps the app entry point below that limit while preserving the existing runtime behavior and test surface.
What changed
Appstate and run-loop wiring intui/src/app.rs.tui/src/app/, covering event dispatch, thread routing, session lifecycle, config persistence, background requests, startup prompts, input, history UI, platform actions, and thread event buffering.tui/src/app/tests.rsand reused the existing snapshot location rather than adding new tests or snapshots.app.rsand the new submodules.Follow-up
A future cleanup can move narrow unit tests from
tui/src/app/tests.rsinto the specific app submodules they exercise. This PR keeps the existing app-level tests together so the refactor stays focused on the source-file split.Verification
cargo test -p codex-tui --lib app::tests::agent_picker_item_name_snapshotcargo test -p codex-tui --lib app::tests::clear_uicargo test -p codex-tui --lib app::tests::ctrl_l_clear_ui_after_long_transcript_reuses_clear_header_snapshotjust fix -p codex-tuiFull
cargo test -p codex-tuistill fails on model-catalog drift unrelated to this refactor, including stalegpt-5.3-codex/gpt-5.1-codexsnapshot and migration expectations now resolving togpt-5.4.