openpencil/tests/helpers
Danila Poyarkov 974905289a
fix(canvas): keep image-heavy documents within CanvasKit memory (#963)
* fix(canvas): bound image decoding for large Figma documents

* test(canvas): update lifecycle fixture for image caches

* test(canvas): align image regressions with contribution guides

Use native wheel zoom in the browser regression instead of inline store access. Keep export state restoration in the existing raster suite and explicitly format the new image tests omitted by the root format script.

* fix(harness): pin patched proxy address dependency

Override the transitive proxy-addr dependency with 2.0.8 to fix IPv4-mapped IPv6 trust subnet checks and pass the critical dependency audit (GHSA-jqcg-44mw-7w3h).

* build: drop the proxy-addr override master already resolves

Master's lockfile has proxy-addr 2.0.8 since the advisory was fixed
upstream, so the override this branch added is redundant.

* perf(canvas): encode image previews as WebP

PNG previews of photos ran to several megabytes each, so a page of them
filled the 64 MiB preview cache and evicted itself: page 2 of the #924
reproduction held 48 MB of PNG previews against 7.3 MB as WebP. Browsers
that cannot encode WebP hand back PNG.

Co-authored-by: sableangle <sableangle@gmail.com>

* perf(canvas): decode four image previews at once

The browser decodes previews off the main thread, so one at a time left
a page of photos filling in for seconds: page 2 of the #924 reproduction
took 4.6 s to finish and now takes 2.0 s.

Co-authored-by: sableangle <sableangle@gmail.com>

* refactor(canvas): decide on image previews once per document size

needsImagePreviews replaces useViewportImageRendering, which was not a
Vue composable, names its two thresholds, and keeps its answer per
document and image count instead of summing every image on each frame.
Choosing a preview by zoom carries a lint exception: preview mode draws
the scene uncached.

Co-authored-by: sableangle <sableangle@gmail.com>

* docs: describe the image memory fix in the changelog

Co-authored-by: sableangle <sableangle@gmail.com>

* fix(canvas): let go of a document's image previews when the document changes

Switching to a document that needs no previews left the preview cache
holding the previous graph and its encoded images, often hundreds of
megabytes, until previews were used again. The renderer now releases
them when its document changes, keeping the decoder for the next one.

---------

Co-authored-by: sableangle <sableangle@gmail.com>
2026-10-07 20:30:25 +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
canvas.ts fix: keep stored page backgrounds and number layers by their own page (#949) 2026-10-07 13:35:59 +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
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
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
vector-network.ts
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