Repository navigation
refactor(editor): split app.rs into dedicated submodules - #17
Merged
Merged
Conversation
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.
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.
Description
Restructures the monolithic
pite-editor/src/app.rs(~2,390 lines) into dedicated, cohesive submodules underpite-editor/src/app/to improve maintainability and navigation:mod.rs: CoreEditorAppdefinition,Tabenum,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, andres://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 -- --checkpassed.cargo build --workspace --lockedpassed.cargo test --workspace --lockedpassed (all 47pite-editortests and crate tests passed).cargo run --locked -p pite-cli -- checkpassed.