docs: record renderContent, leafer renderer, and crop tool planning notes

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 20:46:37 +08:00
parent b363dcf888
commit 7a6f4a2727
3 changed files with 47 additions and 0 deletions
+16
View File
@@ -181,6 +181,22 @@
- Started the production implementation after user approval, using the existing `CanvasNode[]` and SVG/CAD semantic contracts as the source of truth.
- Chosen boundary: persist a separate render-preview URL, render supported visual nodes through LeaferJS, and keep React UI/overlays plus source-based crop/export/model behavior.
- Traced the explicit canvas-node field through the API/domain/PostgreSQL/snapshot layers and the paired source/preview upload changes needed for atomic vector imports.
- Resumed Phase 32 with a clean two-file partial diff: the API spec and generated Go type already expose optional `renderContent`; persistence, preview generation, and renderer work remain outstanding.
- Completed `renderContent` plumbing through the frontend domain/snapshot normalizer, Go domain/API mappers, PostgreSQL schema/queries/repository, SQLC generation, mapper regression coverage, and API documentation.
- Added one-time transparent WebP generation for imported SVG/CAD sources, paired source/texture uploads with partial-upload cleanup, optimistic local texture display, and preview-preference helpers for the canvas and thumbnail surfaces.
- Installed `leafer-ui@2.2.2` and added a retained Leafer renderer for successful image nodes and manual frames. Vector nodes enter Leafer only when their transparent WebP texture is present; React remains the hit-target, selection, toolbar, crop, and text-edit overlay.
- Moved wheel zoom, canvas pan, and ordinary node drag frames onto imperative Leafer/DOM transforms. React viewport/node state now commits after interaction settles or ends, and drag alignment guides render imperatively.
- Focused/full verification passes after the renderer migration: 29 frontend tests, strict TypeScript compilation, and the complete Go test suite.
### Phase 33: Workspace Crop Drag Selection
- **Status:** complete
- Implemented the clarified two-stage workspace Crop tool: activation now enters a crosshair preselection state instead of immediately opening a full crop selection.
- A click selects the connected color-bounded area under the pointer from the displayed raster/WebP texture; the selection can never exceed the currently visible part of the image.
- Holding the left button and dragging draws a live rule-of-thirds selection, clamps it to the visible target bounds, and opens the existing crop editor on release.
- The existing source-preserving CAD/SVG crop, crop-specific semantic context, raster replacement behavior, presets, resizing, and confirm/cancel flow remain unchanged.
- Added synthetic color-boundary and visible-range drag regressions. All 35 frontend tests, strict TypeScript compilation, `git diff --check`, and the Next/Vite production build pass.
- Benchmarked the maximum fully connected 640 x 480 color analysis at about 22ms and confirmed the updated single preview server responds at `http://127.0.0.1:5175`.
- The configured in-app browser backend remained unavailable, so final interactive visual inspection is left to the running local preview; source-level interaction coverage and HTTP verification pass.
### Phase 30: Native-Resolution Vector Crop Fidelity
- **Status:** in_progress