Skip to content

refactor(editor): split app.rs into dedicated submodules - #17

Merged
mkh-user merged 1 commit into
mainfrom
refactor/split-editor-app
Nov 1, 2026
Merged

mkh-user merged 1 commit into
mainfrom
refactor/split-editor-app

Conversation

@mkh-user

@mkh-user mkh-user commented Nov 1, 2026

Copy link
Copy Markdown
Member

Description

Restructures the monolithic pite-editor/src/app.rs (~2,390 lines) into dedicated, cohesive submodules under pite-editor/src/app/ to improve maintainability and navigation:

  • mod.rs: Core EditorApp definition, Tab enum, launch() entry point, lifecycle loop (eframe::App), and top-level UI frame (menus, tab bar, status line).
  • viewport.rs: Preview viewport rendering, aspect-ratio letterboxing (fit_view), cursor coordinate translation (viewport_cursor), and playback transport controls.
  • scene.rs: Scene persistence (save_scene, open_scene_file), native file dialog integration, and recent files MRU management.
  • tree.rs: Hierarchy panel UI, drag-and-drop reordering, reparenting, and node deletion/insertion.
  • inspector.rs: Property inspector panel and node property mutations.
  • assets.rs: Project asset tree viewer, recursive directory scanning, and res:// URI resolution.
  • code.rs: Code editor view, pyright LSP integration (completion popup, hover tooltips, diagnostic marks), and cursor manipulation.
  • settings.rs: Project settings modal draft and serialization logic.
  • tests.rs: Unit test suite covering viewport geometry, recent file lists, scene format versions, and editor file opener rules.

Maintains complete backwards compatibility for pite_editor's public interface (pub use app::{launch, EditorApp}) with no behavioral changes.

Verification

  • cargo fmt --all -- --check passed.
  • cargo build --workspace --locked passed.
  • cargo test --workspace --locked passed (all 47 pite-editor tests and crate tests passed).
  • cargo run --locked -p pite-cli -- check passed.

Decompose the monolithic 2,390-line app.rs into focused submodules
under pite-editor/src/app/:
- assets: project directory traversal, resource path resolution
- code: code editor view, pyright LSP integration, autocomplete/hover
- inspector: inspector panel and node property mutations
- mod: EditorApp struct, Tab enum, lifecycle/top-level UI, launch()
- scene: scene save/load persistence, file dialogs, and recents
- settings: project settings draft modal and save logic
- tree: hierarchy tree panel, DND reordering, reparenting
- viewport: viewport letterbox scaling, input dispatch, playback controls
- tests: unit test suite for math, recents, scenes, and file opening

Maintains full backwards compatibility and passes all existing tests.
@mkh-user
mkh-user merged commit 98a6f46 into main Nov 1, 2026
6 checks passed
@mkh-user
mkh-user deleted the refactor/split-editor-app branch November 1, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant