openpencil/tests/e2e/canvas
Danila Poyarkov b0e0b321e9
fix: share Figma's creation and grouping between editor and plugin API (#919)
* fix(core): start new layers with Figma's defaults in the editor and plugin API

The plugin API created bare nodes: frames, components, and shapes without fills, and lines and vectors without strokes, so scripts written for Figma drew nothing. Drawn lines also had a black fill instead of a stroke and were invisible. Both paths now share newLayerDefaults, recorded from Figma desktop 126: frames and components white with frames clipping their content, shapes #D9D9D9, lines and vectors a black 1 px stroke, text black. A stroke a script adds gets the 1 px default weight, and an empty vector has no render bounds.

* fix(core): combine variants as Figma does from the canvas and from scripts

The plugin API and the editor command each built component sets their own way, both with 40 px of padding and a grey fill. Figma's command pads the variants by 20 and outlines the set with a 1 px dashed #8A38F5 stroke; its plugin API wraps them exactly with no fill or stroke. One variantSetProps now places and styles the set for both, with a canvas or script style, and applyVariantProperties derives variant properties for both.

* fix(core): report group children in their container's space in the plugin API

Figma's plugin API places children of groups and booleans relative to the nearest real container and refits a group whenever a script changes one of its children. Ours reported group-relative positions and never refit, so scripts placing layers inside groups landed them in the wrong place. x, y, and relativeTransform now map through the groups around a node, and geometry changes, appendChild, insertChild, and remove refit the surrounding groups. The refit moves to Scene Graph as fitEnclosingGroups, shared by the canvas (with undo) and the plugin API.

* test(core): pass script-style strokes and typed components in parity tests

* test(e2e): expect Figma's default shape grey in the scene freshness spec

* fix(vue): draw lines by length and angle as Figma does

The Line tool sized a line as the box spanned by the drag. With the stroke a new line now gets, that box drew as a rectangle outline. A line now starts at the press point with the drag length as its width, no height, and the drag angle as its rotation, as Figma's Line tool makes it; Shift snaps the angle to 45° steps, as the docs already described, and a click makes a 100 px horizontal line.

* fix(core): give each new layer its own copy of the default paints

The defaults spread each paint shallowly, so every layer shared the colour object of the module-level default and editing one layer's colour in place changed the next new layer. Copy the paints with the Scene Graph copy helpers.

* fix(core): group, ungroup, and combine layers through shared code in the plugin API

The plugin API wrapped layers, ungrouped, made booleans, and made components from layers with its own code. Ungroup moved the children to the top of the stack, booleans were named "Boolean union", and a component made from a frame cloned its children under new ids. These now run through the editor's shared wrap, ungroup, and boolean functions, with the placement and defaults recorded in Figma desktop 126: a group or boolean without an index goes on top, ungrouped children take the group's place, booleans are named after the operation and filled with the default grey, a frame becomes a component in its place with its children, and any other layer is wrapped in a white component named after it. Undoing a wrap in the editor now returns each layer to its own place in the stack.

* fix(core): group, frame, combine, and make components from the canvas as Figma does

Recorded in Figma desktop 126: a container made from the canvas takes the topmost selected layer's place, Frame selection adds no fill and does not clip, a component wrapped around layers is white and takes a single layer's name, and a boolean is filled like its topmost operand, or its base for Subtract, without strokes. The canvas commands and the plugin API now share the wrap parent check, stack ordering, component rules, and boolean paints, and the plugin API's createComponentFromNode converts groups in place as Figma does. Undoing a boolean returns each operand to its own place in the stack.

* refactor(core): reuse translate when centering pasted layers
2026-10-06 12:28:52 +00:00
..
arrow-caps-visual.spec.ts-snapshots test(canvas): align visual oracles with ruler-free fixtures 2026-09-16 03:45:34 +03:00
boolean-visual.spec.ts-snapshots ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
color-space.webkit.spec.ts-snapshots fix: convert document colour profiles, keep text edits live, and fix .fig exports (#716) 2026-09-18 00:43:10 +03:00
corner-smoothing-visual.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
cursor-labels.spec.ts-snapshots fix: zoom in place, shape cursor names, and align context menu items (#818) 2026-10-01 21:34:36 +04:00
demo-workspace.spec.ts-snapshots fix(canvas): show every top-level frame's name and select frames by it (#930) 2026-10-06 11:37:46 +00:00
dense-text-preview.spec.ts-snapshots perf(text): preserve coverage across paragraph eviction 2026-09-15 16:32:07 +03:00
distance-measurement-edge-cases.spec.ts-snapshots fix(text): finalize font readiness and label shaping (#593) 2026-08-30 14:33:32 +03:00
distance-measurement.spec.ts-snapshots fix(text): finalize font readiness and label shaping (#593) 2026-08-30 14:33:32 +03:00
document-loading.spec.ts-snapshots feat: refresh branding with generated platform icons (#707) 2026-09-16 11:54:07 +03:00
drop-files.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
fill-modes-visual.spec.ts-snapshots ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
frame-overlays.spec.ts-snapshots fix(canvas): keep labels readable and refine section badges 2026-09-15 19:54:04 +03:00
instance-scale-visual.spec.ts-snapshots feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
instance-sizing.spec.ts-snapshots test: replace legacy demo snapshots with current coverage 2026-09-14 01:20:56 +03:00
label-anatomy.spec.ts-snapshots perf(canvas): reuse labels with shared font fallback 2026-09-15 23:08:53 +03:00
labels fix(canvas): show every top-level frame's name and select frames by it (#930) 2026-10-06 11:37:46 +00:00
live-editing.spec.ts-snapshots feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
nested-transform-interaction.spec.ts-snapshots fix(canvas): keep labels readable and refine section badges 2026-09-15 19:54:04 +03:00
occurrence-text-visual.spec.ts-snapshots feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
pattern-mask-visual.spec.ts-snapshots ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
pen-variables.spec.ts-snapshots fix(pen): resolve ordinary variable references (#622) 2026-09-06 23:50:03 +03:00
presence-cursors.spec.ts-snapshots feat: show AI agents on the canvas and to collaborators (#803) 2026-10-03 14:01:36 +04:00
retained-grid.spec.ts-snapshots feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
saved-glyph-visual.spec.ts-snapshots feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
saved-text-visual.spec.ts-snapshots fix(fig): write text glyphs from the layout the renderer draws (#928) 2026-10-06 11:37:02 +00:00
scene-picture-freshness.spec.ts-snapshots fix: share Figma's creation and grouping between editor and plugin API (#919) 2026-10-06 12:28:52 +00:00
slot-overlays.spec.ts-snapshots feat: create, fill, and edit slots (#862) 2026-10-04 17:02:28 +00:00
stroke-geometry-visual.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
stroke-paint-visual.spec.ts-snapshots fix(core): draw gradient and image strokes as the paint they are (#868) 2026-10-04 13:25:45 +00:00
text test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
tiled-large-blur-visual.spec.ts-snapshots test(canvas): align visual oracles with ruler-free fixtures 2026-09-16 03:45:34 +03:00
typography-depth-visual.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
vector feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
arrow-caps-visual.spec.ts fix(core): draw gradient and image strokes as the paint they are (#868) 2026-10-04 13:25:45 +00:00
boolean-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
color-space.spec.ts fix(canvas): preserve paint geometry and color fidelity 2026-09-16 02:57:56 +03:00
color-space.webkit.spec.ts feat(updater): show download progress while installing an update 2026-09-25 23:15:14 +04:00
corner-smoothing-visual.spec.ts fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
cursor-labels.spec.ts feat: show AI agents on the canvas and to collaborators (#803) 2026-10-03 14:01:36 +04:00
demo-workspace.spec.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
dense-text-preview.spec.ts perf(text): preserve coverage across paragraph eviction 2026-09-15 16:32:07 +03:00
distance-measurement-edge-cases.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
distance-measurement.spec.ts
document-loading.spec.ts feat: refresh branding with generated platform icons (#707) 2026-09-16 11:54:07 +03:00
drop-files.spec.ts fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
fill-modes-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
frame-creation-preview.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
frame-overlays.spec.ts fix(renderer): rasterize settled scenes at viewport origin 2026-09-15 13:25:43 +03:00
instance-scale-visual.spec.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
instance-sizing.spec.ts fix: preserve authored instance sizing through synchronization 2026-09-14 00:24:52 +03:00
label-anatomy.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
live-editing.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
manipulation.spec.ts feat(editor): add configurable snapping and guides 2026-08-18 19:11:48 +03:00
nested-transform-interaction.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
occurrence-text-visual.spec.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
painted-text.spec.ts fix(canvas): preserve paint geometry and color fidelity 2026-09-16 02:57:56 +03:00
pattern-mask-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
pen-layout.spec.ts fix(pen): honor layout and sizing defaults (#652) 2026-09-10 17:02:56 +03:00
pen-variables.spec.ts fix(pen): resolve ordinary variable references (#622) 2026-09-06 23:50:03 +03:00
presence-cursors.spec.ts feat: show AI agents on the canvas and to collaborators (#803) 2026-10-03 14:01:36 +04:00
retained-grid.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
retained-parity.spec.ts fix(renderer): rasterize settled scenes at viewport origin 2026-09-15 13:25:43 +03:00
ruler-visibility.spec.ts fix: honor ruler visibility on the overlay canvas 2026-09-14 01:12:26 +03:00
saved-glyph-visual.spec.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
saved-text-visual.spec.ts fix(fig): write text glyphs from the layout the renderer draws (#928) 2026-10-06 11:37:02 +00:00
scene-picture-freshness.spec.ts fix: share Figma's creation and grouping between editor and plugin API (#919) 2026-10-06 12:28:52 +00:00
slot-overlays.spec.ts feat: create, fill, and edit slots (#862) 2026-10-04 17:02:28 +00:00
split-views.spec.ts
stroke-geometry-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
stroke-paint-visual.spec.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
tiled-large-blur-visual.spec.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
tiled-property-preview.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
typography-depth-visual.spec.ts perf(text): preserve coverage across paragraph eviction 2026-09-15 16:32:07 +03:00