Skip to content

Refactor TUI app module into submodules#18753

Merged
etraut-openai merged 4 commits intomainfrom
etraut/split-tui-app-module
Apr 20, 2026
Merged

Refactor TUI app module into submodules#18753
etraut-openai merged 4 commits intomainfrom
etraut/split-tui-app-module

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented Apr 20, 2026

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

  • Kept the top-level App state and run-loop wiring in tui/src/app.rs.
  • Split app responsibilities into focused private submodules under 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.
  • Moved the existing app-level tests into tui/src/app/tests.rs and reused the existing snapshot location rather than adding new tests or snapshots.
  • Added module header comments for app.rs and the new submodules.

Follow-up

A future cleanup can move narrow unit tests from tui/src/app/tests.rs into 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_snapshot
  • cargo test -p codex-tui --lib app::tests::clear_ui
  • cargo test -p codex-tui --lib app::tests::ctrl_l_clear_ui_after_long_transcript_reuses_clear_header_snapshot
  • just fix -p codex-tui

Full cargo test -p codex-tui still fails on model-catalog drift unrelated to this refactor, including stale gpt-5.3-codex/gpt-5.1-codex snapshot and migration expectations now resolving to gpt-5.4.

@etraut-openai etraut-openai force-pushed the etraut/split-tui-app-module branch from 0541be6 to 8c51c92 Compare April 20, 2026 22:17
@etraut-openai etraut-openai force-pushed the etraut/split-tui-app-module branch from 5139af3 to efe8369 Compare April 20, 2026 22:47
@etraut-openai etraut-openai merged commit 2af4f15 into main Apr 20, 2026
25 checks passed
@etraut-openai etraut-openai deleted the etraut/split-tui-app-module branch April 20, 2026 23:10
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants