openpencil/tests/e2e/components
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
..
behaviours.spec.ts-snapshots feat: behaviours and preview mode (#893) 2026-10-06 13:23:05 +00:00
library-manager.spec.ts-snapshots feat: add Figma-style variants and component libraries (#512) 2026-08-14 19:31:41 +03:00
assets-panel.spec.ts fix: refresh Undo and Redo command availability 2026-09-14 00:25:36 +03:00
behaviours.spec.ts fix(preview): toggle controls both ways and keep islands in step with the canvas (#982) 2026-10-08 17:51:00 +00:00
library-lifecycle.spec.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
library-manager.spec.ts refactor(ui): compose shared editor controls (#670) 2026-09-10 12:09:06 +03:00
variant-authoring.spec.ts feat: create, fill, and edit slots (#862) 2026-10-04 17:02:28 +00:00