openpencil/tests/e2e
Danila Poyarkov 6a3960a5d4
feat(code): link the Code tab to canvas layers and sync both ways (#805)
* feat(code): link code to canvas layers and underline design issues

Code in the Code tab and layers on the canvas were unrelated: finding the
element behind a layer, or the layer behind an element, meant reading names.

Generated Design JSX and Tailwind JSX report the layer behind each element
in the order elements open, and edited Design JSX keeps the source line of
every element through the sandbox and renderer, so hovering an element
highlights its layer, Cmd/Ctrl-click brings it into view without changing
the selection the code shows, and errors and warnings from the design check
are underlined on the property that causes them.

* feat(code): explain the Code tab when nothing is selected

With no selection the editor showed a starter frame that read like a real
layer. The tab now says it shows the selected layers' code and offers Write
JSX, which opens the editor focused on the starter template.

* refactor(code): group code-to-layer linking into its own domain

Layer link types, issue mapping, and the hover and reveal behavior move
from the Code panel and a component file into src/app/code/layers, with
useCodeLayers as the panel's entry point, so app code no longer imports
types from components.

* fix(code): underline off-scale gaps after the spacing rule renamed its property

* feat(code): mark the layer of the element around the cursor

Hover highlighting and ⌘-click reveal replaced by one model: the element
around the cursor marks its opening and closing tag names and outlines its
layer on the canvas while the editor has focus. ⌘-click also collided
with CodeMirror's add-a-cursor gesture. Read-only Tailwind JSX now takes a
cursor so it links the same way.

Leaving the editor now ends a live Design JSX edit as one undo step.
Before, canvas edits made after typing never reached the code until the
tab was reopened, and their undo entries landed before the edit's.

* feat(code): sync the Code tab and the canvas both ways by patching

Canvas edits now patch the Design JSX a person wrote instead of waiting
for them to leave the editor: each linked element remembers the layer as
Design JSX last wrote it, and a canvas change rewrites only the attributes,
text and child elements that differ from that base, as CodeMirror changes
that keep the cursor, comments, formatting and history. Attributes written
as expressions are never overwritten; the code marks them when the canvas
now differs. Untouched code is regenerated with a minimal text change.

Code edits update layers in place: the new render is reconciled into the
existing layers (reconcileRenderedLayers), which keep their ids, so links,
selection and canvas edits survive typing. Each edit is one coalesced undo
step, replacing the restore-and-rerender preview and the commit on blur.

* feat(code): patch reordered layers and aliased properties in edited code

Reordering layers on the canvas now moves their elements in code a person
wrote: each child element and the blank lines and comments above it form a
block kept as written, and the children are written again in the new
order, staying linked. Children that cannot move safely, such as a loop
between them, keep their order and are marked.

Properties accepted under several names now come from one alias table in
the Design JSX schema, which the renderer resolves through and the patcher
and issue underlines use, so a canvas change to `w` patches `width` where
the person wrote that, instead of adding a second attribute.

* feat(code): keep the cursor in moved code and patch values written in style

A reorder rewrites the children span in one change, which collapsed a
cursor or out-of-sync marker inside a moved element to the span's edge.
The patch now carries where each block moved and places selections and
markers inside it at their new position.

Properties the renderer also reads from style={{ … }} come from a table in
the Design JSX schema instead of a hand-written list, keeping the rule
that an attribute under any of its names wins. The patcher uses it to
update a value written in style where it is, as a number or a px string
as written; values the renderer cannot read, such as '50%', are marked.

The layer patcher is split by concern: syntax helpers, attribute and
style patches, child patches, out-of-sync state and transaction assembly.

* feat(code): show the code's layer on the canvas as a tinted box

The layer of the element around the cursor used the canvas hover slot, so
moving the pointer over the canvas replaced it and the two read the same.
It now has its own shared editor state, codeFocusNodeId, drawn as the hover
outline over a light tint in every pane: hover stays an outline and the
selection keeps its handles, without borrowing the dashed outlines that
already mean component sets, drag parents and ghosts.

* fix(code): write added and removed layers when a reorder cannot move the code

When children could not be moved, such as two written on one line, the
patch marked the order and returned before adding or removing elements,
so a layer created in the same change never reached the code. It now
marks the order and still writes additions and removals.

* refactor(design-jsx): format the rebased layer description and stroke aliases

* feat(code): mount the layer-linked code editor through useCodeMirror

Master moved the code editor onto the shared useCodeMirror composable.
Its layer links, issue underlines, canvas patches, minimal text updates,
autofocus and read-only cursor now sit on that composable instead of a
hand-mounted view.
2026-10-04 10:08:40 +00:00
..
app feat(app): jump between pages from the command palette (#801) 2026-10-01 20:26:35 +04:00
brand feat: refresh branding with generated platform icons (#707) 2026-09-16 11:54:07 +03:00
canvas feat: check designs live with a Lint panel, canvas markers, and fixes (#804) 2026-10-04 10:08:39 +00:00
chat feat(app): show who works on each page (#815) 2026-10-04 01:18:16 +04:00
clipboard test(clipboard): open a document in the Tauri fixture 2026-09-16 14:00:30 +03:00
code feat(code): link the Code tab to canvas layers and sync both ways (#805) 2026-10-04 10:08:40 +00:00
collab feat(app): follow people and agents from the toolbar avatars (#807) 2026-10-04 00:09:40 +04:00
color-picker refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
components fix: refresh Undo and Redo command availability 2026-09-14 00:25:36 +03:00
context-menu test(app): stabilize final interaction coverage 2026-07-20 16:34:16 +03:00
design perf(properties): retain inactive panels safely 2026-09-15 17:01:44 +03:00
design-check feat: check designs live with a Lint panel, canvas markers, and fixes (#804) 2026-10-04 10:08:39 +00:00
dom-css feat(dom-css): map image aspect styles 2026-06-30 10:51:37 +03:00
editor refactor: scope browser test instrumentation and global types (#667) 2026-09-10 14:26:36 +03:00
export refactor(export): derive export format lists from the IO registry (#755) 2026-09-25 15:42:42 +04:00
fonts fix(text): render variable font styles at their named instances (#773) 2026-09-26 11:25:01 +04:00
keyboard fix(keyboard): match Figma zoom behavior 2026-09-08 12:29:55 +03:00
layers feat(demo): rebuild the first page as a component library with staged loading (#717) 2026-09-18 08:18:21 +03:00
native fix: explain unsupported browsers instead of a blank window (#745) 2026-09-22 14:40:59 +04:00
pages Release v0.14.0 2026-08-10 11:40:44 +03:00
panels feat(vue): add responsive property grids 2026-07-26 12:42:50 +03:00
perf test: honor the configured browser test origin 2026-09-16 12:46:13 +03:00
properties feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
scene test: honor the configured browser test origin 2026-09-16 12:46:13 +03:00
settings feat(settings): configure tool access, MCP failures, and step limits 2026-09-17 23:55:58 +03:00
snap test(snapping): verify pixel rounding without guides 2026-09-13 14:02:16 +03:00
storage refactor(ui): compose shared editor controls (#670) 2026-09-10 12:09:06 +03:00
storybook feat(app): show who works on each page (#815) 2026-10-04 01:18:16 +04:00
stroke-picker feat(scene-graph)!: make a stroke a paint (#864) 2026-10-04 13:38:05 +04:00
text test: honor the configured browser test origin 2026-09-16 12:46:13 +03:00
toolbar test: seed motion preferences through Playwright storage state 2026-09-10 23:24:06 +03:00
tools feat(app): migrate position and appearance panels 2026-07-13 14:47:48 +03:00
ui test(ui): keep runtime theme import dependency-safe 2026-07-20 14:07:32 +03:00
variables fix(app): polish variable dialog states 2026-07-18 05:25:40 +03:00
vectorize feat(app): convert image layers to vectors 2026-07-27 16:22:05 +03:00
viewport
autosave.spec.ts fix(app): retain recovery after closing unsaved tabs (#505) 2026-08-13 21:39:35 +03:00
components.spec.ts feat(app): finish Design panel migration 2026-07-14 17:40:56 +03:00
fixtures.ts test(app): stabilize final interaction coverage 2026-07-20 16:34:16 +03:00
recovery.spec.ts fix: protect unsaved documents and defer credential access (#713) 2026-09-17 15:25:15 +03:00