openpencil/tests/helpers
Danila Poyarkov 4eb3449b0c
fix(app): keep a closing tab's canvas off the next document (#958)
* fix(app): keep a closing tab's canvas off the next document

Tab components read the editor through useEditorStore, which resolves
to whichever tab is active at each call. When a tab closed, the next
tab became active before the closing canvas finished, so the canvas
registered its renderers with that document and its cleanup removed
them from the wrong one. Every closed document's renderers, WebGL
canvases, and detached editor DOM stayed in the remaining tab: about
1,200 DOM nodes, 320 listeners, and 2.5 MB of heap per open and close
in a production build.

EditorWorkspace now provides its tab's store to app components as it
already did for the SDK's useEditor, and useEditorStore returns it
inside the tab. App-level menus, shortcuts, and services outside any
tab keep following the active tab. Over eight open and close cycles,
DOM nodes, listeners, and the remaining tab's renderers stay flat.

* fix(app): bind the workspace itself to its tab's store

Vue resolves an injection from the parent, so EditorWorkspace could not
inject the store it provides and its own template kept following the
active tab, reading the next document while its tab closed. It now
takes its tab's store directly.

* refactor(app): pass the workspace its tab as a prop

EditorWorkspace read the active tab once during setup and relied on
WorkspaceView keying it by tab to keep that choice. WorkspaceView now
passes the tab, the workspace uses its store directly, and provides it
to the components below, so the binding is explicit in the template.

* test: keep the light-page setup from leaving documents unsaved

CanvasHelper switches a fresh document to Figma's light page so canvas
specs draw on it in the dark theme. Setting the page color counts as an
edit, so every spec's document started unsaved, and closing a tab asked
to save changes nobody made: both tab-close specs hit that dialog. The
store now exposes markDocumentSaved, which reload and save already use,
and the helper takes the light page as the saved state.

* test: wait for a closing menu before opening the next one

A menu stays in the page while it animates out, and a click on a menubar
trigger then is lost, so menu specs failed depending on which tests ran
before them. They now open menus through one helper that waits for the
previous menu to go and for the named menu to appear.

* test: configure storage through the current settings form

Storage settings moved the connection fields behind the provider row
and save them with one Save button, so the workspace spec timed out
looking for an Endpoint field that was not shown.
2026-10-07 21:09:58 +00:00
..
ai feat(ai): add guided AI setup for providers, coding agents, and Pi (#916) 2026-10-07 08:46:57 +00:00
canvas fix(canvas): keep image-heavy documents within CanvasKit memory (#963) 2026-10-07 20:30:25 +00:00
chat feat(chat): attach dropped images and style tables, menus, and link prompts in replies (#955) 2026-10-07 18:18:15 +00:00
collab feat(collab)!: sync layer trees as a CRDT and open each room in its own tab (#902) 2026-10-06 10:40:25 +00:00
fig test: resolve repository files without climbing directories (#946) 2026-10-07 12:35:39 +00:00
fonts perf(canvas): reuse labels with shared font fallback 2026-09-15 23:08:53 +03:00
mcp test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
pages feat(app): jump between pages from the command palette (#801) 2026-10-01 20:26:35 +04:00
performance feat: select layers at Figma's click depth (#900) 2026-10-05 12:39:04 +00:00
tauri fix: refuse risky desktop writes and run every Storybook play function (#933) 2026-10-06 14:52:12 +00:00
vue fix(editor): close preview and history lifecycle gaps 2026-09-16 03:36:44 +03:00
assert.ts chore(tests): remove targeted non-null assertions 2026-05-06 01:14:50 +03:00
canvas.ts fix(app): keep a closing tab's canvas off the next document (#958) 2026-10-07 21:09:58 +00:00
cli.ts 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
code-panel.ts feat(code): add live JSX and HTML/CSS editing (#525) 2026-08-15 09:48:42 +03:00
demo.ts fix: convert document colour profiles, keep text edits live, and fix .fig exports (#716) 2026-09-18 00:43:10 +03:00
dom-css-browser.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
dom-css.ts refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
doubles.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
fetch.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
figma.ts chore(tests): remove easy non-null assertions 2026-05-06 02:59:56 +03:00
geometry.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
large-document.ts perf(scene-graph): accelerate axis-aligned hit tests (#534) 2026-08-16 15:43:25 +03:00
layout.ts chore(lint): enforce type imports in tests 2026-05-06 02:35:57 +03:00
paths.ts test: resolve repository files without climbing directories (#946) 2026-10-07 12:35:39 +00:00
properties.ts feat(app): migrate paint effect and export panels 2026-07-14 17:06:28 +03:00
scene.ts test: typecheck the test suites and fix what that found (#896) 2026-10-05 12:42:38 +00:00
store.ts feat(text): create text boxes by dragging 2026-07-20 21:22:30 +03:00
test-ids.ts refactor(toolbar): reuse test id helpers 2026-05-15 13:13:24 +03:00
test-utils.ts test: extend timeout for slow gold-preview fixture tests 2026-06-19 11:05:25 +10:00
tools.ts chore(tests): remove easy non-null assertions 2026-05-06 02:59:56 +03:00
vector-network.ts Refactor architecture boundaries across core, app, and packages (#234) 2026-04-30 15:14:19 +03:00
yjs-test-helper.d.ts perf(collab): skip unchanged Yjs node fields (#529) 2026-08-15 11:40:27 +03:00
yjs.ts fix(collab): replicate document content to joiners 2026-06-30 11:56:58 +03:00