Add canvasHistory helpers that diff two node snapshots into a labeled
operation (boolean, add, delete, path edit, move, resize, style,
rename, reorder), keep the five most recent states, and truncate newer
entries when an older state is restored. Workspace wiring lands in a
follow-up commit.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a booleanShapePath engine that runs union/subtract/intersect/
exclude/flatten through paper.js and returns normalized result path
data plus per-operand stroke segments, so boolean results are real
vector paths instead of SVG mask approximations.
- Store the computed pathData on boolean groups and recompute it when
the operation changes; flatten legacy groups into ordinary path nodes
- Render previews and SVG/PSD exports from the computed result path,
keeping each operand's stroke style on the boundary it contributes
- Open boolean results in the path editor and flatten them on commit
- Add paper 0.12.18 with a paper-core type shim and mark it as a
server-external package for the standalone Next build
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Implemented CanvasPathEditor component for editing paths on the canvas.
- Created editablePath module to handle path data manipulation and conversion to SVG.
- Introduced pathPen module for managing path drawing with a pen tool, including anchor management and path data generation.
- Added tests for editablePath and pathPen functionalities to ensure correctness of path editing and drawing behavior.
Show a localized "Generating" label on the artboard generation skeleton
while keeping the planned title as the aria-label, so in-progress nodes read
as a status instead of prematurely displaying their eventual name.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve the most recent canvas-node reference from the prompt's reference
images (by node id or matching asset URL) and append it as a hidden
"reference anchor node:" settings directive on agent submissions, so the
server can place generated images beside the source. Keep the persisted
user-visible copy unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Introduce a leafer-ui canvas layer that mirrors rendered nodes and drives
viewport, node-drag, and alignment-guide updates imperatively, committing
React state on idle via startTransition to keep pan/zoom/drag at 60fps. Wire
the imperative viewport through wheel zoom, zoom-to, fit-view, and panning.
Add a dedicated crop tool: click a node to auto-detect a color-boundary crop
region or drag to preselect one, previewed with an on-canvas draft overlay
before entering the crop editor. Route uploads through renderContent so the
transparent WebP texture feeds the fast display path. Add node --test
coverage for the leafer renderer and color-boundary detection.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rasterize imported SVG/CAD sources to a transparent WebP render texture and
carry it as an optional renderContent alongside the original content through
the domain node, snapshot normalization, and reference images. Add
canvasNodeRenderContent and prefer it for artboard, layer, generated-file,
and project thumbnail previews while keeping content as the crop/download/
model-reference source. Generalize the SVG rasterizer with a render purpose
and add upload/reference coverage.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extend CAD conversion to emit bounded semantic metadata (units, layers,
blocks, entity types, labels, crop-indexed bounds) alongside the derived
SVG, tag imported drawings as cad-vector nodes, and carry semanticContext
through canvas nodes, snapshot normalization, and reference images. Agent
Chat forwards this metadata as hidden cad-context reference parts.
Add non-destructive vector cropping: cropping a vector/CAD node keeps the
source SVG and spawns a transparent WebP sibling with crop-scoped semantic
context, wired through the vectorized image toolbar and the workspace crop
tool. Include node --test coverage for CAD semantics and vector crop.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move canvas wheel zoom off the React onWheel prop into a manually attached
non-passive listener so preventDefault reliably suppresses page scroll, and
read the viewport from the ref to keep the handler referentially stable.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Accept DWG and DXF files (up to 24 MB) through the canvas asset picker and
drag-and-drop. Conversion runs locally in a browser worker via acad-ts,
uploads a sanitized derived SVG, and leaves the source file untouched. DXF
covers ASCII and binary drawings; DWG covers AutoCAD R14 through 2018.
Rename the image-only upload input/handler to a generic canvas asset flow,
add vector-image node detection, tag imported SVGs as vector-image nodes,
localize CAD import status/error messages, and switch the Next build to the
webpack compiler so the worker bundles correctly. Add a node --test suite
covering CAD conversion and vector image helpers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add modelImageReferences to preprocess agent contents, uploading local
image references and surfacing their names in the prompt so the model can
cite them. Wire the preparer into the canvas agent submission path, pass
imageName through the floating composer references, and relax the prompt
directive parser to accept names containing arbitrary characters.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>