Commit graph

29 commits

Author SHA1 Message Date
Danila Poyarkov 3289649da8
fix: repair the app e2e suite and the bugs it was hiding (#968)
* fix(code): evaluate behaviour parts such as Switch.Root in the Code tab

Behaviour parts are named through a namespace, and the sandbox passed every element name to new Function as a parameter. A dotted name is not one, so every Design JSX evaluation in the Code tab failed with "Arg string terminates parameters early". Dotted elements are now members of their namespace object, as JSX reads the tag.

* fix(properties): show a fill's whole hex value

The hex input used 12 px text in a field sized for 11 px, so six digits needed 45 px of the 38 px left beside the opacity and variable controls, and the last digit was cut off. The value now uses the field's 11 px text, and the opacity field gives up the space its suffix did not use.

* test: answer the desktop app's startup commands in the Tauri mock

The app now reads credential status and sets native menu checkmarks on startup, and the mock threw on both, failing every spec that simulates the desktop app.

* test: wait for the clipboard write and the previous menu in rich copy

Copy writes once the document is encoded, so reading right after the click found an empty clipboard or one that changed mid-read. Reopening Edit while the menu used for Copy still animated lost the click. openAppMenu waits for every menu to go before clicking a trigger.

* test: follow current settings, page, and picker behaviour in e2e specs

Specs had fallen behind the app: Media settings open a provider editor with its own Save, adding a page opens it, the variable picker's search is a textbox, a reverted reply is no longer dimmed by opacity, and the zoom spec addressed a fixed port instead of the configured server.

* fix(properties): show the whole opacity beside the variable button

A number field with a unit kept the unit's right padding and then the variable button added its own, so Appearance opacity showed "1… %" in the 83 px column. The unit now leaves the spacing to the trailing control.

* test: refresh panel and canvas baselines verified against their changes

Every baseline was compared with its previous image and each difference traced to a merged change: stored colors drawn exactly after color management (#716), stored page backgrounds kept (#949), themed section fills and node-owned section corners (#931, #940), frame names on every top-level frame (#930), Design Check markers (#804), .pen frames laid out horizontally by default (#652), no-rulers honored, stacked W and H fields, Clip content on new frames, and the whole hex and opacity values from this branch.

* docs: note the clipped paint and opacity values in the changelog

* test: open menus through the shared menu driver in menu specs
2026-10-08 17:15:18 +00:00
Danila Poyarkov aa86873dd7
test: typecheck the test suites and fix what that found (#896)
* build: typecheck the test suites

Tests were in no TypeScript program: no tsconfig included tests/** or
packages/*/tests/**, and bun strips types without checking them, so a
fixture could drop a required field and keep passing until something
read it.

@types/bun moves to the root because it was installed per package only,
and #cli-tests/* joins the paths the root config already carries.

* test: fix the type errors the test suites were hiding

Typechecking the tests turned up 1123 errors. Most were ordinary
strictness, but some were real: `NodeChange` bound to Figma's plugin
typings rather than the Kiwi codec in thirteen .fig tests,
materializeInstance was called with six arguments against five so the
blobs and source children were dropped, CanvasKit pixels were written
to a plain object that never reached WASM, and assertions were made
through accessors that do not exist, so they asserted nothing.

Fixtures that had quietly lost a required field now carry it, nullable
results are narrowed through the existing expectDefined helper rather
than assumed, and stand-ins for CanvasKit and the editor go through one
named helper instead of an unexplained cast at each site.

No test was deleted, skipped, or weakened, and no `any`, non-null
assertion, or ts-expect-error was introduced.

* docs: record what typechecking the tests established

Pins the app program's global types with an assertion rather than a
note, since an unpinned types list lets any root @types package decide
which platform src/** is judged against.

The two environment faults that look like code regressions — Vite's
dependency pre-bundle outliving a package rebuild, and heavy .fig
suites failing under load — go to the development docs, where an
explanation belongs.

* fix: align @types/bun and keep node types resolvable when extended

The root manifest declared a newer @types/bun than every package, which
check:monorepo rejects, and pinning the app program's types left them
unresolvable from a config that extends this one out of tree.

* fix: fail the test typecheck when the compiler itself fails

The gate matched diagnostics by substring, so a compiler or config
failure that named no test file printed a pass while having checked
nothing. Diagnostics are now split by whether they name a file: an
unscoped one is the run failing and stops the gate, a test file's is a
finding, and a source file's stays out by design.

Also drops the parameter planComponentConstruction never read, and
makes the inner-shadow verification script exit non-zero when it
renders no image instead of logging and succeeding.

* chore: merge master into tests-typecheck
2026-10-05 12:42:38 +00:00
Danila Poyarkov 73fc732d20 test: honor the configured browser test origin
Use the configured baseURL for manually created pages and same-origin DOM/CSS imports. Repair the hover helper serialized argument uncovered once its startup reached the intended server. Preserve all existing pixel and behavior assertions.
2026-09-16 12:46:13 +03:00
Danila Poyarkov 0f64cecc49
fix(text): finalize font readiness and label shaping (#593)
* fix(text): prepare browser fonts atomically

- Fetch approved Fontsource resources directly in browsers with bounded responses and retryable provider failures
- Limit page font resolution concurrency and retain live Inter substitution paragraphs after baked glyph invalidation
- Shape frame, section, and component labels through a bounded native Paragraph cache
- Cover real Geist, Geist Mono, and Roboto Mono browser loading plus substitution and cache lifecycle behavior

* test(canvas): cover substitution and label shaping

- Capture baked missing-font text before editing, live Inter substitution on first input, and visible undo output
- Assert text-picture and derived-glyph invalidation with finalized substituted readiness
- Cover shaped frame, rotated frame, section, component, component-set, ellipsis, kerning, and zoom label presentation

* fix(text): preserve same-origin fetches during font resolution

- Route same-origin application and fixture requests through native fetch while Unifont temporarily proxies global HTTP requests
- Keep the external provider HTTPS allowlist enforced for cross-origin font resources
- Cover the production race discovered while loading gold-preview.fig during provider initialization

* fix(text): preserve substituted path glyphs

- Keep imported derived curved glyphs for text-on-path layers when exact fonts finalize as substituted
- Cover substituted path rendering through the runtime renderer and refresh the corrected visual oracle
- Update shaped Inter measurement badges and merged typography panel snapshots after visual inspection
- Search virtualized font catalogs explicitly and restore the canvas screenshot helper used by broad E2E coverage

* fix(text): use browser font transport without desktop warning

- Keep the browser provider implementation aligned with current settings behavior after splitting from preparation

* test(text): inject same-origin browser font context

- Keep the transport test deterministic outside a Window global

* fix(text): preserve final browser font transport hardening

- Carry the same-origin large-document bypass and bounded cross-origin provider checks from the preserved integration snapshot

* fix(text): initialize font transport outside Window contexts

- Keep unit and headless module imports safe while browsers use their current origin

* test(text): satisfy async visual fixture contract

- Return from the resolver setup continuation after requesting render

* test(canvas): include paragraph cache lifecycle

* fix(text): cancel queued browser font loads

- Race serialized provider work against preparation cancellation\n- Release queue slots after cancelled waiters without disturbing active requests\n- Reuse one section-title paragraph cache entry for measurement and drawing

* fix(text): close font queue cancellation races

- Release reserved proxy queue slots when cancellation lands after queue acquisition\n- Skip paragraph work for zero-width section labels

* fix(text): abort active provider resolution

- Race active provider resolution against its preparation signal and restore the temporary fetch proxy promptly\n- Forward cancellation through proxied provider requests\n- Align the renderer font-readiness facade with substituted text
2026-08-30 14:33:32 +03:00
Danila Poyarkov 15bd0ba19f
fix(text): align editing overlays with vertical text (#543)
- Offset selection and caret geometry with the rendered paragraph.\n- Translate text-editing hit testing into paragraph coordinates.\n- Cover every aligned coordinate-mapping path.
2026-08-17 19:32:40 +03:00
Danila Poyarkov 780221b006
test(tauri): add native WebView interaction harness (#532) 2026-08-15 14:17:05 +03:00
Danila Poyarkov 9db46f919b test(typography): refresh formatting snapshots 2026-07-20 22:40:43 +03:00
Danila Poyarkov f3fbc94abf feat(text): create text boxes by dragging 2026-07-20 21:22:30 +03:00
Danila Poyarkov e6b28f1806 test(typography): refresh grouped controls snapshot 2026-07-20 20:50:04 +03:00
Danila Poyarkov 2348b1c972 test(app): stabilize final interaction coverage
- Isolate the Copy/Paste submenu scenario from prior context-menu state
- Close shared fixture pages safely when a project-level skip bypasses setup
- Refresh the reviewed typography panel snapshot
2026-07-20 16:34:16 +03:00
Danila Poyarkov 0bf74a418f feat(text): deepen typography controls
- Add case, justification, vertical alignment, truncation, max-lines, and OpenType controls

- Apply visual text case and measured vertical offsets in CanvasKit rendering

- Preserve nullable preview values, shared text styles, font demand, and .fig metadata

- Add panel, engine, and canvas visual coverage
2026-07-17 22:40:52 +03:00
Danila Poyarkov 27fdef2ea4 feat(app): finish Design panel migration
- Rebuild Typography, Variant, Mask, and Page sections with shared labeled fields
- Expose semantic empty states across list sections
- Replace section test hooks with accessible roles and add focused visual coverage
2026-07-14 17:40:56 +03:00
박영호 ee2a7472ee
fix(text): handle Hangul IME composition (#319)
Co-authored-by: 05Park <im0505@kakao.com>
2026-06-06 07:21:56 +03:00
Danila Poyarkov abd795bd9a chore: format codebase 2026-05-24 12:15:29 +03:00
Danila Poyarkov a4d4cf1bee fix(canvas): switch edited text on click 2026-05-17 20:49:25 +03:00
Danila Poyarkov a535c6be8a fix(canvas): edit nested text on drill double-click 2026-05-17 20:46:13 +03:00
Danila Poyarkov 680350cdcb test(e2e): extract shared editor setup and store helpers
- useEditorSetup() / useEditorSetupWithClear() in tests/e2e/fixtures.ts
- Migrated 15 simple specs to shared fixture
- Moved getSelectedNode/getSelectedNodes to tests/helpers/store.ts
- Replaced inline getSelectedNode in 4 specs
- Reverted 8 specs with custom beforeAll setup (not fixture-compatible)
- Test duplication in tests/: 329 → 307 clones (10.12% → 8.95%)
2026-05-16 16:55:34 +03:00
Danila Poyarkov 11e38b626a test(e2e): extract shared editor setup fixture
- useEditorSetup() / useEditorSetupWithClear() in tests/e2e/fixtures.ts
- Migrated 17 specs to shared fixture, removing ~300 lines of boilerplate
- Moved getSelectedNode/getSelectedNodes to shared store helpers
- Replaced inline getSelectedNode in 4 specs with shared import
- Test duplication: 329 → 308 clones (10.12% → 9.08%)
2026-05-16 16:19:03 +03:00
Danila Poyarkov 2f94ce6510 test(e2e): use Playwright test id locators 2026-05-15 12:49:49 +03:00
Danila Poyarkov 1f273f880e fix(editor): guard drill selection text editing 2026-05-13 05:07:27 +03:00
Danila Poyarkov aa9f03407a Revert "fix(editor): delay text editing after drill selection"
This reverts commit b23bb9d3e7.
2026-05-13 04:59:24 +03:00
Danila Poyarkov b23bb9d3e7 fix(editor): delay text editing after drill selection 2026-05-13 04:58:42 +03:00
Danila Poyarkov bbf122a5c5 chore(tests): route store access through browser bridge
- Expose window.openPencil.getStore() instead of a direct store property
- Update E2E helpers and specs to use the bridge getter
- Add lint coverage preventing direct window.openPencil.store access
2026-05-06 12:19:39 +03:00
Danila Poyarkov 8ec70330b4 chore(lint): centralize OpenPencil window API
- Route browser globals through src/app/window-api.ts instead of private __OPEN_PENCIL fields
- Move E2E tests to the public window.openPencil test API
- Add an oxlint rule banning direct window.__OPEN_PENCIL* access
2026-05-06 10:38:03 +03:00
Danila Poyarkov eba56fbe38 chore(tests): guard text and keyboard lookups
- Replace non-null assertions in keyboard, text editing, and legacy fig import coverage
- Add explicit store guards and expectDefined for optional test data
- Validate check, legacy fig import, and keyboard E2E coverage
2026-05-06 10:10:54 +03:00
Danila Poyarkov 017c55cbf5 chore(tests): clean more non-null assertions
- Replace clipboard, variable, centerline, layout, menu, and text formatting assertions with explicit guards
- Use expectDefined and getNodeOrThrow instead of postfix non-null assertions
- Validate affected engine and E2E tests
2026-05-06 03:28:25 +03:00
Danila Poyarkov 39675b2969 chore(tests): remove easy non-null assertions
- Replace browser store non-null assertions with explicit initialization guards
- Use expectDefined for optional test resources and tool results
- Clean low-count non-null assertions in font, icon, snap, OKHCL, and visual tests
2026-05-06 02:59:56 +03:00
Danila Poyarkov c3f5189f8f style: tighten import grouping
- Configure oxfmt custom import groups for workspace, app, package, and test aliases
- Keep type imports grouped with their matching source category instead of one global tail group
- Expand the format script to cover formatter config, Vite files, and scripts
2026-05-06 02:22:08 +03:00
Danila Poyarkov 930cf39216 test: organize prefixed test files into folders
- Move top-level engine and e2e prefixed test files under domain folders
- Update fixture path helpers after moving render and pen tests
- Add lint coverage to prevent new top-level prefixed test files
- Refresh testing docs for the new fig and layout paths
2026-05-06 02:13:18 +03:00