openpencil/tests/e2e/canvas
Danila Poyarkov f6848434ec
feat: check designs live with a Lint panel, canvas markers, and fixes (#804)
* feat: check designs live with a Check panel and canvas issue markers

Design lint only ran from the CLI and AI tools, and its rules were too noisy
to show continuously: on a real imported page 786 of 888 layers had a
warning. The rules now report where a finding is actionable (a hardcoded
color only when a variable matches it, nesting only where the limit is
crossed, instance sublayers through their main component) and carry
structured data, and Recommended keeps warnings for likely problems.

The app checks the current page after edits settle. The Check tab groups
issues by rule with hover highlighting, reveal on click, and one-step
variable binding. Errors and warnings are marked on the canvas with
clustered markers that roll up to visible ancestors when zoomed out; markers
explain themselves on hover, open Check on click, and toggle with
View > Design issues.

* fix: keep the right panel and markers stable

The Check tab made the right-panel tab row overflow at common window widths,
so focusing the zoom menu scrolled the row and shifted the panel. Code and
AI tabs now drop their labels to screen readers when the row is narrow.

Touch target names are matched as whole words: "Rectangle" contained "cta"
and marked every rectangle. Markers also stay drawn during interactive edits
instead of blinking while a value is scrubbed.

* fix(ui): show right panel tab labels whenever they fit

* fix(ui): name the design check tab Lint and keep panel tabs consistent

The tab was an unlabelled icon between labelled Code and AI tabs. It is now
Lint, with the same icon and label anatomy as its neighbours, and its icon
takes the severity color instead of a count badge. All labelled tabs show
their labels when the row fits and drop them together when it does not.

* refactor(ui): build the Lint panel from shared components

Issue groups use AppCollapsible, actions use AppButton, and the severity
filters are a Reka toggle group with keyboard navigation. Issue rows no
longer nest a button inside a button. Panel state, visibility and the
focused-issue scroll live in useDesignCheckPanel, the rules menu is its own
component, and rule preferences change through preference actions.
Severity ordering reuses Core's ranking, detail numbers follow the app
language, and the check debounce uses useTimeoutFn.

* fix(lint): check the WCAG AA touch target size in the Recommended preset

Recommended flagged a 394 × 39 input because it required the 44 × 44 AAA size. It now checks the 24 × 24 AA minimum through a minSize option; Strict and Accessibility keep 44 × 44.

* feat(lint): fix design issues from rules, the Lint panel, the CLI, and agents

Rules attach fixes as data: a safe fix keeps the design as it looks (bind a
color to the variable it matches, round subpixel geometry that layout does
not own), a suggestion changes values (snap radius and spacing to the
scale, raise small text to the minimum). One Core applier re-validates
each fix against the current graph and merges changes per layer.

The Lint panel offers a fix per row and Fix all for safe fixes as one undo
step; openpencil lint --fix writes the fixed document; the lint and
lint_fix tools expose the same to MCP and AI chat.

The design-check spec's Close button is now 24 x 20: at 24 x 24 it passes
the WCAG AA touch target size that Recommended checks.

* feat(lint): pin issues outside the view to the canvas edge

Errors and warnings on layers outside the viewport had no marker, so a
check could report issues nobody could see. They are now pinned to the
canvas edge where a ray from the viewport center toward them leaves it,
with a chevron pointing their way; pins in one direction merge like
markers. Hovering lists them under the direction they lie in, and
clicking reveals and opens the most severe, nearest one.

Pins keep clear of UI floating over the canvas: the toolbar marks itself
with data-canvas-obstacle, and canvases report such rectangles to the
renderer through getOverlayObstacles each frame.

* feat(lint): mark layers with design issues in the Layers panel

Like an IDE marks files with problems and the folders holding them, a
layer with errors or warnings shows the most severe as an icon, and a
collapsed layer with issues inside it shows a dot in that color.
Suggestions stay in the Lint panel, as on the canvas, and the marks
follow the View → Design issues toggle.

* feat(lint): show issues per page and across the document

Loaded pages beyond the current one are now checked in the background,
one page at a time while the editor is idle, and checked again only when
an edit touches them; pages a large .fig file has not loaded are left
alone until opened rather than forced in. The page list shows each page's
errors and warnings like an IDE's problem count, and the Lint panel gains
a Document scope that lists every page's issues, tags the ones on other
pages, and switches to a row's page when it is opened.

* test(lint): use the core-tests alias and no comma operator in lint tests

Master now rejects ../../ imports and the comma operator in tests.

* refactor(app): create the Lint session with the editor store modules

The composition root passed its line budget once master added recent
pages; the Lint session belongs with the other per-editor services that
the modules factory creates and disposes.

* docs(changelog): keep master's latest Unreleased entries
2026-10-04 10:08:39 +00:00
..
arrow-caps-visual.spec.ts-snapshots test(canvas): align visual oracles with ruler-free fixtures 2026-09-16 03:45:34 +03:00
boolean-visual.spec.ts-snapshots 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
color-space.webkit.spec.ts-snapshots fix: convert document colour profiles, keep text edits live, and fix .fig exports (#716) 2026-09-18 00:43:10 +03:00
corner-smoothing-visual.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
cursor-labels.spec.ts-snapshots fix: zoom in place, shape cursor names, and align context menu items (#818) 2026-10-01 21:34:36 +04:00
demo-workspace.spec.ts-snapshots feat: check designs live with a Lint panel, canvas markers, and fixes (#804) 2026-10-04 10:08:39 +00:00
dense-text-preview.spec.ts-snapshots perf(text): preserve coverage across paragraph eviction 2026-09-15 16:32:07 +03:00
distance-measurement-edge-cases.spec.ts-snapshots fix(text): finalize font readiness and label shaping (#593) 2026-08-30 14:33:32 +03:00
distance-measurement.spec.ts-snapshots fix(text): finalize font readiness and label shaping (#593) 2026-08-30 14:33:32 +03:00
document-loading.spec.ts-snapshots feat: refresh branding with generated platform icons (#707) 2026-09-16 11:54:07 +03:00
drop-files.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
fill-modes-visual.spec.ts-snapshots 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
frame-overlays.spec.ts-snapshots fix(canvas): keep labels readable and refine section badges 2026-09-15 19:54:04 +03:00
instance-scale-visual.spec.ts-snapshots feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
instance-sizing.spec.ts-snapshots test: replace legacy demo snapshots with current coverage 2026-09-14 01:20:56 +03:00
label-anatomy.spec.ts-snapshots perf(canvas): reuse labels with shared font fallback 2026-09-15 23:08:53 +03:00
labels fix(canvas): include component-set members in label catalog 2026-09-16 14:13:34 +03:00
live-editing.spec.ts-snapshots feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
nested-transform-interaction.spec.ts-snapshots fix(canvas): keep labels readable and refine section badges 2026-09-15 19:54:04 +03:00
occurrence-text-visual.spec.ts-snapshots feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
pattern-mask-visual.spec.ts-snapshots 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
pen-variables.spec.ts-snapshots fix(pen): resolve ordinary variable references (#622) 2026-09-06 23:50:03 +03:00
presence-cursors.spec.ts-snapshots feat: show AI agents on the canvas and to collaborators (#803) 2026-10-03 14:01:36 +04:00
retained-grid.spec.ts-snapshots feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
saved-glyph-visual.spec.ts-snapshots feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
scene-picture-freshness.spec.ts-snapshots fix(editor): close preview and history lifecycle gaps 2026-09-16 03:36:44 +03:00
stroke-geometry-visual.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
text refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
tiled-large-blur-visual.spec.ts-snapshots test(canvas): align visual oracles with ruler-free fixtures 2026-09-16 03:45:34 +03:00
typography-depth-visual.spec.ts-snapshots fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
vector feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
arrow-caps-visual.spec.ts feat(canvas): render arrow stroke caps on lines and open vectors 2026-08-31 21:25:38 +03:00
boolean-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
color-space.spec.ts fix(canvas): preserve paint geometry and color fidelity 2026-09-16 02:57:56 +03:00
color-space.webkit.spec.ts feat(updater): show download progress while installing an update 2026-09-25 23:15:14 +04:00
corner-smoothing-visual.spec.ts fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
cursor-labels.spec.ts feat: show AI agents on the canvas and to collaborators (#803) 2026-10-03 14:01:36 +04:00
demo-workspace.spec.ts feat(demo): rebuild the first page as a component library with staged loading (#717) 2026-09-18 08:18:21 +03:00
dense-text-preview.spec.ts perf(text): preserve coverage across paragraph eviction 2026-09-15 16:32:07 +03:00
distance-measurement-edge-cases.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
distance-measurement.spec.ts feat(canvas): measure distances between layers (#515) 2026-08-14 18:18:55 +03:00
document-loading.spec.ts feat: refresh branding with generated platform icons (#707) 2026-09-16 11:54:07 +03:00
drop-files.spec.ts fix(editor): commit vector drags on pointer release (#586) 2026-08-24 16:02:27 +03:00
fill-modes-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
frame-creation-preview.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
frame-overlays.spec.ts fix(renderer): rasterize settled scenes at viewport origin 2026-09-15 13:25:43 +03:00
instance-scale-visual.spec.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
instance-sizing.spec.ts fix: preserve authored instance sizing through synchronization 2026-09-14 00:24:52 +03:00
label-anatomy.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
live-editing.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
manipulation.spec.ts feat(editor): add configurable snapping and guides 2026-08-18 19:11:48 +03:00
nested-transform-interaction.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
occurrence-text-visual.spec.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
painted-text.spec.ts fix(canvas): preserve paint geometry and color fidelity 2026-09-16 02:57:56 +03:00
pattern-mask-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
pen-layout.spec.ts fix(pen): honor layout and sizing defaults (#652) 2026-09-10 17:02:56 +03:00
pen-variables.spec.ts fix(pen): resolve ordinary variable references (#622) 2026-09-06 23:50:03 +03:00
presence-cursors.spec.ts feat: show AI agents on the canvas and to collaborators (#803) 2026-10-03 14:01:36 +04:00
retained-grid.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
retained-parity.spec.ts fix(renderer): rasterize settled scenes at viewport origin 2026-09-15 13:25:43 +03:00
ruler-visibility.spec.ts fix: honor ruler visibility on the overlay canvas 2026-09-14 01:12:26 +03:00
saved-glyph-visual.spec.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
scene-picture-freshness.spec.ts fix(canvas): discard stale zoom fallback pictures 2026-09-15 17:40:34 +03:00
split-views.spec.ts feat(editor): model split canvas panes (#519) 2026-08-15 10:31:52 +03:00
stroke-geometry-visual.spec.ts feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
tiled-large-blur-visual.spec.ts test(canvas): align visual oracles with ruler-free fixtures 2026-09-16 03:45:34 +03:00
tiled-property-preview.spec.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
typography-depth-visual.spec.ts perf(text): preserve coverage across paragraph eviction 2026-09-15 16:32:07 +03:00