openpencil/packages/core/tests/editor
Danila Poyarkov 9081c4b1d6
fix(preview): toggle controls both ways and keep islands in step with the canvas (#982)
* fix(preview): keep a control's layer path when its variant switches

Preview finds a control by its layer path, built from layer names. Swapping an instance named after its variant renamed it to the new variant, as Figma does for a real swap, so a switch or checkbox inside a frame lost its path after one click and could not be toggled back. swapInstanceComponent takes keepName, and preview's private graph keeps every instance's name.

* refactor(preview): build preview's private graph with the shared page extractor

Preview copied its island and the components its instances show with its own closure and copier, a second version of the extractor the AI preview, history, and export use. extractPageContext takes componentSets, which brings every variant of an instance's set so it can switch, and shareTables, which reads the document's variables and images instead of copying them for a view rebuilt on each state. The extractor now also indexes instances by component, which syncing and swapping an extracted graph need.

* test: group scene-graph's instance swap test under instances

* fix(preview): move islands with the frames the canvas draws

Islands followed the pane's live pan and zoom, which change on every wheel event, while the canvas draws once per animation frame or later on a slow frame. Panning and zooming fast, the islands ran ahead of the drawing and settled back when it caught up. useCanvas reports each drawn frame's view through onFrame, and the islands follow the scene's last drawn frame, so both move in the same frame.

* test: release the held canvas even when the island sync test fails

* docs: point private document copies at the shared page extractor

The Core guide says previews, history snapshots, and exports copy part of a document with the extractor in io/subgraph.ts and its componentSets and shareTables options, and the preview guide says where an island's private graph comes from.
2026-10-08 17:51:00 +00:00
..
clipboard feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
components feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
graph feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
history feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
layout perf: speed up opening large pages (#953) 2026-10-07 20:57:57 +00:00
pages perf: speed up opening large pages (#953) 2026-10-07 20:57:57 +00:00
play fix(preview): toggle controls both ways and keep islands in step with the canvas (#982) 2026-10-08 17:51:00 +00:00
selection feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
structure feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
undo feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
variables feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
design-tokens.test.ts feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
effects-and-resize.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
frame-presets.test.ts fix(layout): size each axis on its own and lay out before geometry reads (#942) 2026-10-07 11:52:08 +00:00
guides.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
navigation-lifecycle.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
node-preview.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
nudge.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
opacity.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
page-backgrounds.test.ts fix: keep stored page backgrounds and number layers by their own page (#949) 2026-10-07 13:35:59 +00:00
preview-events.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
reveal.test.ts feat: import and export W3C design tokens (#964) 2026-10-08 16:53:46 +00:00
text-auto-resize.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
vectorize.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
view-state.test.ts test(core): move the editor suite into the package (#792) 2026-09-30 10:22:42 +04:00
viewport.test.ts feat(app): follow people and agents from the toolbar avatars (#807) 2026-10-04 00:09:40 +04:00