Extract main toolbar and thin startup/node helpers

This commit is contained in:
2026-06-16 12:33:36 +02:00
parent acd34540e0
commit 184f662493
7 changed files with 507 additions and 320 deletions

View File

@@ -80,10 +80,10 @@ What is still carrying too much live ownership:
Current hotspot files:
- `src/canvas.cpp`: 2645 lines
- `src/app_layout.cpp`: 785 lines
- `src/app_layout.cpp`: 743 lines
- `src/canvas_modes.cpp`: 1798 lines
- `src/node.cpp`: 1551 lines
- `src/main.cpp`: 882 lines
- `src/node.cpp`: 1594 lines
- `src/main.cpp`: 1098 lines
- `src/node_panel_brush.cpp`: 1197 lines
- `src/node_stroke_preview.cpp`: 933 lines
- `src/node_canvas.cpp`: 910 lines
@@ -140,10 +140,13 @@ Current architecture mismatches that must be treated as real blockers:
`src/app_layout_about_layer_menu.cpp` and `App::init_menu_about()` plus
`App::init_menu_layer()` are now thin call-throughs, while sidebar panel
binding and popup wiring now also live in `src/app_layout_sidebar.cpp` and
`App::init_sidebar()` is now a thin call-through, while the informational
overlay opener family now also lives in `src/app_dialogs_info_openers.cpp`
and the corresponding `App::dialog_*` entrypoints are thinner, while the
export/video/PPBR dialog family now also lives in
`App::init_sidebar()` is now a thin call-through, while main-toolbar binding
now also lives in `src/app_layout_main_toolbar.cpp` and
`App::init_toolbar_main()` is now a thin call-through, while the
informational overlay opener family now also lives in
`src/app_dialogs_info_openers.cpp` and the corresponding `App::dialog_*`
entrypoints are thinner, while the export/video/PPBR dialog family now also
lives in
`src/app_dialogs_export.cpp` and those `App::dialog_*` entrypoints are
thinner too, while new/open/save/browse/resize workflow entrypoints now also
live in `src/app_dialogs_workflow.cpp` and `src/app_dialogs.cpp` is now
@@ -183,6 +186,12 @@ Current architecture mismatches that must be treated as real blockers:
sequencing, FPS title update/wakeup posting, stylus frame update, window
preference save, and VR lifecycle wrappers now also live in
`src/platform_windows/windows_lifecycle_shell.cpp` instead of `src/main.cpp`,
while the Win32 startup/window/bootstrap path in `src/main.cpp` now also
routes through named local helper functions for runtime-data discovery,
startup-state initialization, window creation, pixel-format setup, GL loader
init, runtime-info logging, and core-context upgrade sequencing even though
that state still needs to move into platform-owned modules for the file to
shrink materially,
while `App::rec_loop()` now delegates worker-iteration orchestration into
the retained recording bridge, `App::update_rec_frames()` now delegates
recording label refresh through that same retained recording path, and the
@@ -198,7 +207,11 @@ Current architecture mismatches that must be treated as real blockers:
document-IO cluster now lives in `src/legacy_canvas_document_io_services.cpp`
and `NodeStrokePreview` render-target setup plus immediate-pass sequencing
now route through retained preview execution helpers, even though the bridge
still owns worker-side readback flow and encoder-state label reads.
still owns worker-side readback flow and encoder-state label reads, while
`Node` child attach/detach/reorder operations now route through named local
helpers in `src/node.cpp`, which makes the scene-graph mutation paths easier
to reason about without yet reducing the file or moving ownership into
`pp_ui_core`.
- Modern C++23 usage exists in extracted components, especially `std::span`,
explicit result/status objects, and a few concepts, but the live app still
does not consistently express ownership, thread affinity, or renderer

View File

@@ -293,7 +293,7 @@ targets look like helpers under one old monolith.
Status: In Progress
Why now:
`src/app_layout.cpp` is still a 1249-line mixed file that builds menus,
`src/app_layout.cpp` is still a 743-line mixed file that builds menus,
attaches callbacks, computes planner inputs, and mutates UI state directly.
Current slice:
@@ -313,6 +313,9 @@ Current slice:
`src/app_layout_sidebar.cpp`, and `App::init_sidebar()` is now a thin
call-through, but edit-menu wiring and broader layout composition are still
inline in `src/app_layout.cpp`.
- Main-toolbar binding now also lives in `src/app_layout_main_toolbar.cpp`,
and `App::init_toolbar_main()` is now a thin call-through, but edit-menu
wiring and broader layout composition are still inline in `src/app_layout.cpp`.
Write scope:
- `src/app_layout.cpp`
@@ -473,6 +476,12 @@ Current slice:
wakeup posting, stylus frame update, window preference save, and VR
lifecycle wrappers now also live in
`src/platform_windows/windows_lifecycle_shell.cpp` instead of `src/main.cpp`
- `main.cpp` startup/window/bootstrap flow now also routes through named local
helpers for runtime-data discovery, startup-state initialization, window
creation, pixel-format setup, GL loader init, runtime-info logging, and
core-context upgrade sequencing, but the retained Win32 shell still needs
those helpers moved into platform-owned modules before the file materially
shrinks
- prepared-file background work now runs through an `AppRuntime`-owned worker
queue instead of a retained static worker in `src/app_events.cpp`
- canvas async import/export/save/open background work now also runs through an
@@ -632,6 +641,12 @@ Why now:
mixes raw `Node*`, shared ownership, direct `add_child(...)`, and callback
captures across mutation points.
Current slice:
- `src/node.cpp` child attach/detach/reorder paths now route through named
local helpers instead of repeating raw mutation logic inline. That improves
scene-graph mutation clarity, but it does not yet change the ownership model
or move those paths behind checked handles.
Write scope:
- `src/node.*`
- `src/layout.*`