refactor(tui): split app/mod.rs monolith into focused submodules#4938
Merged
Conversation
Split crates/zeph-tui/src/app/mod.rs (4235 lines) into focused submodules, joining the existing draw/events/keys split: - state.rs: App construction, builder configuration, and accessors - transcript.rs: sub-agent transcript loading, polling, and projection - tests.rs: the 188-test #[cfg(test)] module (~67% of the file) mod.rs (660 lines) retains the type definitions (App, Panel, AgentViewTarget, TuiTranscriptEntry, TranscriptCache, SubAgentSidebarState, ConfirmState, ElicitationState) and the shared free functions. The shared impl App block is now split across files, so three cross-module methods (trim_messages, auto_scroll, maybe_reload_transcript) are pub(super). Production code is byte-identical; no public API change. Closes #4918
bug-ops
force-pushed
the
refactor/4918-tui-app-mod-split
branch
from
June 6, 2026 15:53
e1c82c1 to
6560be3
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Splits
crates/zeph-tui/src/app/mod.rs(4235 lines) into focused submodules, continuing the monolith-refactor convention and joining the existingdraw/events/keyssplit.mod.rsApp,Panel,AgentViewTarget,TuiTranscriptEntry,TranscriptCache,SubAgentSidebarState,ConfirmState,ElicitationState) + shared free functions + module wiringstate.rsAppconstruction, builder configuration, accessors/setters, metrics pollingtranscript.rstests.rs#[cfg(test)]module (~67% of the original file)The single 4235-line file was dominated (~67%) by its test module; extracting it plus the
impl Appaccessor/transcript groups bringsmod.rsdown to 660 lines and shortens incremental compile times.Notes
impl Appblock is now split across files, so three previously-private cross-module methods (trim_messages,auto_scroll,maybe_reload_transcript) are bumped topub(super).use super::*in non-test modules per the workspaceclippy::pedanticgate).Verification
cargo +nightly fmt --checkRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --lockedcargo clippy --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler -- -D warningscargo nextest run --workspace --features full --lib --bins→ 11021 passedcargo doc --no-deps --all-features -p zeph-tui(broken intra-doc links denied) +cargo test --doc -p zeph-tui→ 71 passedCloses #4918