Extract canvas live stroke, node canvas state, and preset panel UI

This commit is contained in:
2026-06-16 19:53:50 +02:00
parent f78f72b607
commit 9b2a0d9c30
13 changed files with 1107 additions and 807 deletions

View File

@@ -79,14 +79,14 @@ What is still carrying too much live ownership:
Current hotspot files:
- `src/canvas.cpp`: 2122 lines
- `src/canvas.cpp`: 1490 lines
- `src/app_layout.cpp`: 125 lines
- `src/canvas_modes.cpp`: 1014 lines
- `src/node.cpp`: 995 lines
- `src/main.cpp`: 271 lines
- `src/node_panel_brush.cpp`: 652 lines
- `src/node_panel_brush.cpp`: 435 lines
- `src/node_stroke_preview.cpp`: 751 lines
- `src/node_canvas.cpp`: 877 lines
- `src/node_canvas.cpp`: 702 lines
- `src/app.cpp`: 575 lines
- `src/app_dialogs.cpp`: 168 lines
@@ -260,7 +260,11 @@ Current architecture mismatches that must be treated as real blockers:
larger stroke commit/sample execution family now also route through
`src/legacy_canvas_stroke_commit_services.*` instead of staying inline in
`src/canvas.cpp`, which trims another large retained stroke-render and
viewport-state execution family from the live canvas shell, while the
viewport-state execution family from the live canvas shell, while the live
`Canvas::stroke_draw()` orchestration now also routes through
`src/legacy_canvas_stroke_live_services.cpp` instead of staying inline in
`src/canvas.cpp`, which materially thins another large retained live
stroke-render pocket, while the
`CanvasModeTransform` interaction family now also routes through
`src/legacy_canvas_mode_transform.cpp` instead of staying inline in
`src/canvas_modes.cpp`, which materially thins another retained canvas-view
@@ -273,10 +277,19 @@ Current architecture mismatches that must be treated as real blockers:
import/export/import-ABR routing now also lives in
`src/legacy_brush_preset_services.*` instead of staying inline in
`src/node_panel_brush.cpp`, which trims another large preset-workflow pocket
from the live UI node, while `NodeCanvas::handle_event()` now also routes
from the live UI node, while `NodePanelBrushPreset` init/menu wiring, click
handling, item construction, and added-state update now also route through
`src/legacy_brush_preset_panel_ui.*` instead of staying inline in
`src/node_panel_brush.cpp`, which materially thins another retained preset
panel UI pocket, while `NodeCanvas::handle_event()` now also routes
through `execute_node_canvas_handle_event(...)`, which trims another coherent
input-routing block from `src/node_canvas.cpp` even though the file is still
a live canvas/controller shell, while shared canvas-mode GL wrappers plus the
a live canvas/controller shell, while `NodeCanvas` restore/clear context,
resize handling, camera reset, buffer creation, cursor visibility/update,
tick, and destroy ownership now also route through
`src/legacy_node_canvas_state_services.*` instead of staying inline in
`src/node_canvas.cpp`, which materially thins another retained state/control
pocket, while shared canvas-mode GL wrappers plus the
`CanvasModeBasicCamera` and `CanvasModeCamera` input handlers now also route
through `src/legacy_canvas_mode_helpers.*` instead of staying inline in
`src/canvas_modes.cpp`, while

View File

@@ -91,7 +91,7 @@ Status: In Progress
Why now:
`src/canvas.cpp` is still the biggest single architectural blocker at about
2122 lines, with `src/canvas_modes.cpp` still large at about 1014 lines.
1490 lines, with `src/canvas_modes.cpp` still large at about 1014 lines.
Current slice:
- Canvas state-management helpers for picking, clear/clear-all, layer
@@ -126,6 +126,10 @@ Current slice:
`src/legacy_canvas_mode_transform.cpp` instead of staying inline in
`src/canvas_modes.cpp`, which materially thins another retained
transform-mode pocket from the broader canvas/render hotspot family.
- The live `Canvas::stroke_draw()` orchestration now also lives in
`src/legacy_canvas_stroke_live_services.cpp` instead of staying inline in
`src/canvas.cpp`, which materially thins another large retained live
stroke-render pocket from the canvas shell.
Write scope:
- `src/canvas.cpp`
@@ -289,6 +293,11 @@ Current slice:
`execute_node_canvas_handle_event(...)` helper, which trims another coherent
input-routing block from `src/node_canvas.cpp` even though the node still
owns broader canvas/controller behavior.
- `NodeCanvas` restore/clear context, resize handling, camera reset, buffer
creation, cursor visibility/update, tick, and destroy ownership now also
live in `src/legacy_node_canvas_state_services.*` instead of staying inline
in `src/node_canvas.cpp`, which materially thins another retained
state/control pocket without reopening the draw path.
Write scope:
- `src/node_stroke_preview.cpp`
@@ -1011,6 +1020,12 @@ Current slice:
in `src/node_panel_brush.cpp`, which trims another large preset-workflow
pocket from the live UI node even though the broader cloud/package worker
split still remains follow-up work.
- `NodePanelBrushPreset` init/menu wiring, click handling, item construction,
and added-state update now also live in
`src/legacy_brush_preset_panel_ui.*` instead of staying inline in
`src/node_panel_brush.cpp`, which materially thins another retained preset
panel UI pocket even though cloud/package worker ownership remains the
follow-up.
Write scope:
- `src/legacy_cloud_services.*`