openpencil/tests/helpers
Danila Poyarkov 22d5dfe6b5
fix: refuse risky desktop writes and run every Storybook play function (#933)
* fix(desktop): refuse writes where a written file would run

The fs scope let the webview write, create folders, and delete anywhere. Documents may still be saved anywhere, but the global scope now denies login items and startup folders, PowerShell profiles, and the global package and executable folders where coding agents and OpenPencil's companions live, and writes to the MCP discovery files agents trust. requireLiteralLeadingDot keeps hidden files and folders, such as shell profiles and agent settings, out of ** on Windows as Tauri already does on macOS and Linux. A native test saves a document and is refused a LaunchAgents file, a home dotfile, and the discovery file.

* fix(ui): draw segmented controls at panel field height

Panel fields moved to 24px when sizing tokens became plain utilities, but segmented control items stayed 22px inside a 2px padding, so the Typography and resizing controls stood 2px taller than the fields beside them. The panel foundation story renders its inputs at the panel size and checks 24px.

* test(storybook): run every story and its play function

No test ran the play functions, and five had gone stale: the layer tree example labelled a wrapper with the same name as its row, the chat composer's label gained an ellipsis, the MCP failure story queried a test id attribute the app does not use, and the property primitives story still collapsed sections whose titles are static now. bun run test:storybook now renders every story and fails on a story or play function that throws.

* fix(desktop): deny protected folders themselves and writable opens of the discovery files

Each protected folder is denied alongside its contents, so a recursive remove cannot target the folder itself, and the MCP discovery files are denied to open as well as write, since opening with truncate would empty them. The native test opens the discovery file for writing without truncating, and removes only files it created. The story test waits for storyFinished, which follows afterEach, and judges exceptions and non-accessibility reports.

* test(desktop): run the file scope check only on macOS

Its protected paths are macOS ones, so other platforms skip it rather than pass for another reason.

* docs: note that documents opened from hidden folders can still be saved
2026-10-06 14:52:12 +00:00
..
canvas refactor(design-jsx): extract design JSX into its own package (#793) 2026-09-30 20:55:27 +04:00
chat feat(ai): revert, regenerate, and edit chat turns (#844) 2026-10-06 09:54:42 +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 refactor(fig): export the symbol readers and move the library tests home (#929) 2026-10-06 10:44:22 +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(text): finalize font readiness and label shaping (#593) 2026-08-30 14:33:32 +03: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 Add heuristic overlap detection tool and CLI 2026-06-19 09:54:27 +10: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