Skip to content

v0.8.63: Extract App god object state into owned submodules #3314

@Hmbown

Description

@Hmbown

Problem

crates/tui/src/tui/app.rs has a large App struct and broad impl App block. The analysis characterized this as a god object:

  • roughly 150 fields on App
  • thousands of lines of methods
  • many concerns mixed in one impl
  • a ComposerState sub-struct exists, but ownership/method boundaries are still blurry

Proposed shape

Move methods and state toward owning sub-struct/modules:

  • app/mod.rs
  • app/types.rs
  • app/builder.rs
  • app/composer.rs
  • app/history.rs
  • app/status.rs
  • additional modules only when they remove real ownership confusion

Use an AppBuilder or equivalent for the current App::new initialization path.

Acceptance criteria

  • App::new is moved into a builder/init module without behavior change.
  • Composer-specific behavior moves onto ComposerState or an app/composer module.
  • Status/message helpers move out of the central impl App.
  • Public field/method visibility does not expand unnecessarily.
  • Existing TUI app tests pass.

Risk

High. Do not start until lower-risk test extraction and renderer/API/module splits have landed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupCode cleanup, refactor, or maintenance workenhancementNew feature or requestrustPull requests that update rust codetuiTerminal UI behavior, rendering, or interactionv0.8.63Targeting v0.8.63

    Projects

    Status
    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions