Thin canvas state, tools menu, and node canvas draw

This commit is contained in:
2026-06-16 10:13:59 +02:00
parent d68c97e609
commit 4a5bb68fe2
7 changed files with 729 additions and 521 deletions

View File

@@ -79,14 +79,14 @@ What is still carrying too much live ownership:
Current hotspot files:
- `src/canvas.cpp`: 4128 lines
- `src/app_layout.cpp`: 2026 lines
- `src/canvas.cpp`: 3622 lines
- `src/app_layout.cpp`: 1498 lines
- `src/canvas_modes.cpp`: 1798 lines
- `src/node.cpp`: 1551 lines
- `src/main.cpp`: 1374 lines
- `src/node_panel_brush.cpp`: 1197 lines
- `src/node_stroke_preview.cpp`: 1129 lines
- `src/node_canvas.cpp`: 962 lines
- `src/node_canvas.cpp`: 888 lines
- `src/app.cpp`: 950 lines
- `src/app_dialogs.cpp`: 908 lines
@@ -120,9 +120,14 @@ Current architecture mismatches that must be treated as real blockers:
merged-texture draw callback plus non-`draw_merged` per-frame layer draw
callback plus the smoothing-mask face shader/draw pass plus heightmap,
current-mode, and grid-mode callback setup now routed through the same
retained helper family.
retained helper family, while post-draw callback assembly and the remaining
per-layer render-path orchestration now also route through retained
draw-merge helpers even though the broader node draw loop is still inline.
- `app_layout.cpp` and `app_dialogs.cpp` are still mixed shell/controller files
rather than thin composition/binding surfaces.
rather than thin composition/binding surfaces, even though tools-menu binding
plus nested panels/options submenu wiring now live in
`src/app_layout_tools_menu.cpp` and `App::init_menu_tools()` is now a thin
call-through.
- `App`, `Canvas`, `Node`, retained workers, and platform entrypoints still use
global singleton reach, raw observer pointers, retained static worker
ownership in several app families, and ad hoc mutex/condition-variable
@@ -145,10 +150,13 @@ Current architecture mismatches that must be treated as real blockers:
prepared-file worker and the canvas async import/export/save/open worker now
live under `AppRuntime` instead of retained static app-events/canvas
workers, `App::rec_loop()` now delegates worker-iteration orchestration into
the retained recording bridge, and `App::update_rec_frames()` now delegates
recording label refresh through that same retained recording path even though
the bridge still owns worker-side readback flow and encoder-state label
reads.
the retained recording bridge, `App::update_rec_frames()` now delegates
recording label refresh through that same retained recording path, and the
canvas state-management cluster for picking, clear/clear-all, layer
add/remove/order/lookups, animation frame control, resize, and snapshot
save/restore now lives in `src/legacy_canvas_state_services.cpp` instead of
`src/canvas.cpp`, even though the bridge still owns worker-side readback flow
and encoder-state label reads.
- 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

@@ -87,11 +87,18 @@ looks like a wrapper around the old renderer shell.
#### ARC-RND-001 - Split `canvas.cpp` Into Document State And Render Execution Shells
Status: Ready
Status: In Progress
Why now:
`src/canvas.cpp` is still the biggest single architectural blocker at about
4128 lines.
3622 lines.
Current slice:
- Canvas state-management helpers for picking, clear/clear-all, layer
add/remove/order/lookups, animation frame control, resize, and snapshot
save/restore now live in `src/legacy_canvas_state_services.cpp` instead of
staying inline in `src/canvas.cpp`, but the file still owns the larger
document-plus-render shell.
Write scope:
- `src/canvas.cpp`
@@ -171,6 +178,11 @@ Current slice:
now also routes through `execute_legacy_canvas_draw_merge_layer_plane(...)`,
but the node still owns substantial live layer traversal and renderer state
orchestration.
- `NodeCanvas` post-draw callback assembly now also routes through
`execute_legacy_canvas_draw_merge_post_draw_callbacks(...)`, and the
remaining per-layer render-path orchestration now also routes through
`execute_legacy_canvas_draw_merge_layer_path(...)`, but the node still owns
broader draw-loop and renderer-state shell sequencing.
Write scope:
- `src/node_stroke_preview.cpp`
@@ -246,12 +258,18 @@ targets look like helpers under one old monolith.
#### ARC-APP-001 - Split `app_layout.cpp` Into UI Binding Modules
Status: Ready
Status: In Progress
Why now:
`src/app_layout.cpp` is still a 2026-line mixed file that builds menus,
`src/app_layout.cpp` is still a 1498-line mixed file that builds menus,
attaches callbacks, computes planner inputs, and mutates UI state directly.
Current slice:
- Tools-menu UI binding, including the nested panels/options submenu wiring,
now lives in `src/app_layout_tools_menu.cpp`, and `App::init_menu_tools()`
is now a thin call-through, but file/about/layer/sidebar and broader layout
composition are still inline in `src/app_layout.cpp`.
Write scope:
- `src/app_layout.cpp`
- `src/legacy_app_shell_services.*`