Skip to content

feat(templates): add the Canvas Editor page template - #6237

Merged
ernestt merged 34 commits into
mainfrom
template-canvas-editor
Sep 22, 2026
Merged

ernestt merged 34 commits into
mainfrom
template-canvas-editor

Conversation

@ernestt

@ernestt ernestt commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

What

A layered-artboard workspace — the design-tool pattern the gallery did not have. Tools - Canvas Editor is a new category beside Tools - Page Editor.

The distinction from Page Editor is the line the description ends on. That one composes a document: a palette of blocks dropped into a flow that reflows around them. This one moves objects on a fixed 1080×1920 frame, where position and size are coordinates rather than an order — so the inspector reads X/Y/W/H, moving one layer never moves another, and the canvas needs a zoom control at all.

A File/Edit/View/Object/Help menubar and document tabs head it; a layer rail and asset library sit on the left, the artboard is centered on a muted backdrop under a floating tool bar that sets zoom, and the property inspector is on the right. Both rails drag to resize.

light

The parts worth looking at

The inspector is the substance of it. A text layer gets font, weight, colour, size, line height, letter spacing, horizontal and vertical alignment, slant, decoration, transform, a text shadow and a stroke; an image layer gets fit and the nine CSS filters, each on a number and a rail that move together. Everything that can reach the artboard does — typing in Transform recases the poster, dragging Sepia tints the photograph.

inspector

The artboard is themed, not styled. It runs under its own defineTheme pinned to mode="light", so the poster keeps its palette when the editor goes dark. A poster is artwork — it should not invert because the tool around it did. That is the dark shot in the details below: chrome flips, artboard does not.

Document tabs are Items, not a hand-rolled strip. TabList is the obvious reach and it does not fit: its label lives in internal labelText/labelSizer spans with whiteSpace: nowrap and no text-overflow anywhere in the directory, so a tab cannot truncate — and document names have to. Its selected state is an internal 2px accent underline span with no prop to suppress it, and a document tab is a filled pill. Item gives all of it: truncation, a fill, 28px at density="compact", an icon slot and a close in endContent.

Two things needed care. Item's 8px gap and symmetric padding left 96px for a label that wants 102, so the active tab truncated to "Salzburg pos…" — a 6px gap and a tightened end padding buy the 8px back. And isSelected paints --color-accent-muted, which in dark mode is light-dark(#f1f1f1, #262626) — the same rgb(38,38,38) as the header bar behind it, so the active tab vanished. It takes --color-background-muted through xstyle instead, which merges after Item's own styles.

tabs

A nested row action is a real IconButton. It was a hand-rolled 20px button because the element scale stops at 28px and a control the row's own height would push a 28px row to 36. A size="sm" IconButton pulled in by the row's padding step on every edge — margin: calc(-1 * var(--spacing-1)) — lays out as 20px while staying 28px to the pointer. The glyph does not move: it stays 18px in from the row's right edge, measured before and after.

No tooltip on these. A bubble opening off a 28px row covers the row above it, and a padlock and an × already say what they do; label still names them for assistive tech.

row-action

The top bar is a LayoutHeader, not a Toolbar. It reads like a toolbar and it is not one. A toolbar is a set of peer commands that arrow keys walk across, and the document tabs break that twice: arrowing off a tab landed on that tab's own close button (Brand sheet → Close Brand sheet → Untitled draft), and a strip of open documents is not a band of tools in the first place.

It fought the padding too. A toolbar sizes its gutters for a band heading content, and app chrome wants to sit tighter — which took a --astryx-section-padding-inline override plus a new paddingBlock prop on Toolbar to keep the ghost-trigger edge compensation honest. LayoutHeader is the component for the slot this already sat in, and padding={1} settles all of it: 4px on every edge puts the menu button's box exactly where the ghost inset used to pull it, so the glyph lands on the same pixel with nothing pulled back out.

Measured identical before and after — 45px bar, 18px glyph centre, 34px strip origin, same 1px divider — minus a role that was describing the wrong thing. This removed the Toolbar core change entirely; Toolbar.tsx is byte-identical to main again. The floating canvas tool bar stays a Toolbar, because that one really is a row of peer commands, and it still roves Undo → Redo → Add frame.

One honest note: arrow keys in the tab strip now do nothing rather than doing the wrong thing. Tab moves between tabs, which is what a group of buttons should do. Making the strip a true arrow-navigable tablist is a separate change — TabList itself can't take it, for the reasons above.

One widget is hand-rolled, and it is the colour picker. A saturation/value plane, a hue rail and a hex field. The hue rail is a real themed Slider; the plane is not, and cannot be — there is no two-axis picker in core, and nothing composes into one. Four of this template's seven raw tags are this widget, and it is the single largest thing standing between the score below and an A. It stays hand-rolled deliberately: the lab→core loop is longer than this template's runway.

color picker

Remaining states — dark, layer rail, menubar

dark
layer rail
menu

Stacked on #6238

This PR contains no packages/core changes, and its base branch is #6238 rather than main, so GitHub computes the diff against that branch and the eleven files below are template, CLI, docsite and tooling only. Merge #6238 first and this retargets to main on its own.

#6238 is the one core change the template needs: TreeListItemData gains xstyle, className, and style on the row box, which is what lets useContainerReveal scope the layer rail's per-row action to a single row instead of the whole tree. It implements FR5 of the now-current TreeList contract.

Two earlier core changes on this branch are gone rather than split out: a paddingBlock prop on Toolbar (see the header section below for why it stopped being necessary), and a hand-rolled stylex.defaultMarker() reveal, replaced by useContainerReveal.

Rubric score: 87/100 (B)

Self-assessed. The ledger fetches its rubric from the wiki and I could not reach it from here, so this is scored against the seven categories and weights in scripts/template-score-ledger.mjs, calibrated by measuring all 54 page templates on the same axes. Worth a maintainer's check rather than taking at face value.

Category Score
Astryx component purity 24/30 38 components, 188 element instances, 7 raw tags in 2,935 lines
Icon purity 13/15 44 Lucide icons, every one through Icon; one custom SVG factory
Custom CSS 10/15 41 rules / 69 declarations — high, and the honest number
Layout & structure 15/15 Layout root, LayoutPanel/Content/Footer, Resizable, Section, Toolbar
Doc metadata 10/10 6/6 fields, 3/3 description (349 chars / 55 words), 1/1 naming
Image handling 5/5 /template-assets, AspectRatio for the artboard, Thumbnail for the picker
Code quality 10/10 tsc --noEmit and eslint both clean

Where the 13 points go:

The 7 raw tags (−6). Four are the colour picker above. One is the <img> inside AspectRatio, which is that component's documented child rather than a workaround. One is a hidden file input that never renders — Astryx's FileInput is fixed at the medium element height and this row is on the 28px rhythm, so the picker is driven from the Thumbnail and the input just sits there to be opened. One is the SVG below. Only 20 of 54 templates carry any raw tag at all, so this is a real deduction and not a rounding error; it is also concentrated in one missing primitive.

The custom SVG (−2). glyph() draws letterforms — X, Y, W, H — on the same 24px grid Lucide uses, for the start-icon slot of the geometry fields. A design tool names a numeric field from inside it so the row reads as one control, and Lucide ships no letterforms. They inherit currentColor and the slot's sizing, so a letter and an icon are interchangeable in the same position.

The CSS (−5). 69 declarations over 2,935 lines is 2.4 per 100, against a median of 0 — second only to table-filter. It is mostly the price of the artboard: a zoomable, pannable plane and a scaled frame are geometry no layout prop expresses. Of the 69, 15 go through var(--…) and the rest are structural (display, position, overflow, flex). Only four are literal values, and three of them are the colour-picker thumb — a white ring with a dark halo that has to read against any hue the user picks, so a theme token would be the wrong answer there, not the right one.

A two-axis colour picker in core takes this to roughly 95.

Test plan

  • pnpm -F @astryxdesign/cli typecheck — clean.
  • Header swap verified against a captured baseline: bar height, menu-button origin, glyph centre, strip origin and divider all unchanged; [role=toolbar] count on the page drops from 2 to 1.
  • eslint on the template — clean.
  • Full pre-commit suite (lint-staged + 13 check:* scripts) — clean on every commit.
  • astryx template --list shows the new name and description, with no (WIP) marker.
  • Eight states captured above at 2×, light and dark.
  • Walked with Playwright: tabs select and close independently, the active label does not truncate (104px available against 104 needed) and stays visible in dark mode; row actions hold the row at 28px with a 28px target and the glyph fixed 18px from the edge; both rails resize; the menubar opens File/Edit/View/Object/Help; zoom drives the artboard; inspector edits reach the poster live.

Made with Cursor

@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 22, 2026 6:22pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 11, 2026
@astracat-bot

astracat-bot Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
⏳ Waiting for review (for maintainers only) Sep 22, 2026, 7:33 PM UTC

@github-actions github-actions Bot added the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Sep 11, 2026
TreeList takes rows as data, so nothing handed back the row's element.
That blocks StyleX markers specifically: a marker's class is the only way
to scope when.ancestor() to one row, so revealing an endContent action on
its own row's hover had nothing to mark and had to mark the whole tree,
which reveals every row's action at once.

Item already accepts className for this, so the gap surfaced as a
regression when converting a list to a tree. The class lands on the row
box rather than the <li> — the boundary a consumer means by 'this row' —
and merges last so it wins ties.

Co-authored-by: Cursor <[email protected]>
@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: 36 accessibility violation(s) found — 2 critical, 34 serious.

Button pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/19 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposerInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatReasoning - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatToolCalls - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 10/11 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Checkbox pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/33 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CheckboxList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/17 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ClickableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditor - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorPerf - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/2 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 13/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 14/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
DateRangeInput - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/21 stories · Learn more
    • WCAG: 4.1.2 (Level A)
FileInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
GridMasonry - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Heading - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Icon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
LogStream - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
MediaTheme Auto - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PowerSearch - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ProgressBar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Radio group pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RadioList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RichTextEditor - 2 issue(s)
  • 🟠 serious: Ensure every ARIA input field has an accessible name
    • Rule: aria-input-field-name · Affects 2/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🔴 critical: Ensure every form element has a label
    • Rule: label · Affects 1/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
SelectableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/4 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Stepper - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/30 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
TableGroupedRows - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 3/3 stories · Learn more
    • WCAG: 4.1.2 (Level A)
TableTree - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 8/9 stories · Learn more
    • WCAG: 4.1.2 (Level A)
Text - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/23 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Theme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PopArt - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/6 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Thumbnail - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Timestamp - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/20 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Token - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

ernestt and others added 14 commits September 11, 2026 09:38
44 templates reference /template-assets/*, which only the docsite's public
dir serves. The viewer had no publicDir, so every one of those previews
rendered a broken image. Point it at the docsite's public dir so a preview
here matches what the docsite shows.

Co-authored-by: Cursor <[email protected]>
A layered-artboard workspace, staged hidden: a layer rail and asset library
on the left, the artboard centered on a muted backdrop under a floating tool
pill that sets zoom, and a property inspector on the right whose fields
retarget to the selected layer.

It fills the gap next to Tools - Page Editor. That one composes a document;
this one moves objects on a fixed 1080x1920 frame, where position and size
are coordinates rather than an order.

The artboard runs under its own defineTheme pinned to mode="light", so the
poster keeps its palette when the editor goes dark. The theme carries what
belongs to the poster as a whole -- face, leading, uppercase treatment, frame
margins. Per-layer size and tracking stay on the layer, where the inspector
edits them live.

Zoom is a transform, not a re-layout: the artboard lays out once at native
size and the frame scales the painted result, so the theme's numbers stay in
artboard pixels and the poster does not reflow between zoom steps.

Co-authored-by: Cursor <[email protected]>
Text layers get colour, line height, alignment on both axes, slant,
decoration, transform, a text shadow and a stroke; image layers get fit
and the nine CSS filters, each on a paired number and slider. Border,
Shadow and Fill stop being text fields and become swatch-triggered
colour pickers, with the shadow's X/Y/Blur/Spread in the same popover.

The picker is built from Popover and TextInput plus a painted
saturation/value plane and hue rail, since neither exists as a
component. Both carry role=slider, arrow keys and pointer capture.

Row actions drop IconButton for bare icon buttons, which is what gets
the layer rail from 36px to the 28px compact density asks for -- the
smallest IconButton is 28px on its own and cannot fit inside it.
Slider exposes slider-track as a theming target, so the spectrum can be
a defineTheme override on a real Slider instead of a div reimplementing
drag, arrow keys and ARIA. Scoped under its own Theme so the nine
filter sliders in the same panel keep a plain track.

Only the saturation/value plane stays painted, since it is two axes at
once and no slider is.

Also captions the text layer's shadow row 'Shadow' to match its
reference and fit the label column, while keeping 'Text shadow' and
'Box shadow' as the accessible names -- the section heading
disambiguates the two visually, but not for a screen reader.
An action beside a field goes back to IconButton size=sm so its box ends
level with the input's: clear, rotate, per-side, per-corner, and the
colour swatch and image thumbnail, which take the same 28px square.
Rows now read as one band instead of a field with something small
floating next to it.

Only an action nested inside a row stays small, because a 28px compact
row has no space for a 28px button. That is the layer rail's lock, and
RowIcon is renamed ItemAction to say so at the call site.

Sliders stay 20px and centred -- a slider is a line to aim at, not a
box to stack.
Left rail gutter drops to 8px so its rows read as a list; the inspector
goes to 12px, carried by each section rather than by the panel so the
rules between sections stay full-bleed -- padding the panel would inset
every divider by the gutter.

Swatches and the image thumbnail round to --radius-element, the token
the inputs beside them use, rather than the tighter --radius-inner. At
28px next to a 28px field the two curves read as different families.
The rail was a flat List, which left the reader to infer from sort order
that the two text layers belong together and the images belong together.
A tree states it, and gives documents with more layers than fit a way to
fold the groups away.

Rows are supplied as data because TreeList owns the disclosure state, the
guide lines and the roving focus a hand-rolled tree would reimplement.
The trade is that no per-row element survives to carry a hover marker, so
the marker moves to the rail and the locks reveal together on rail hover
rather than one row at a time. Locked layers still show at rest, so the
state stays visible even when the affordance is not.

Co-authored-by: Cursor <[email protected]>
The trailing zoom control is a ghost, so edge compensation pulled it out
to the card's edge to optically align its label. That is right when the
control is alone in a container; here it left the bar with 8px on the
leading end and nothing on the trailing one.

The step goes back on a wrapper rather than the control's own xstyle:
Selector forwards xstyle to an inner node, so a margin set there leaves
the field where it was.

Co-authored-by: Cursor <[email protected]>
The Edit row's thumbnail looked like a control and did nothing. It now
opens a native image picker.

FileInput is the obvious component and is not usable here: it is fixed at
the medium element height, and this inspector holds a 28px rhythm the row
would break. The picker is driven from the thumbnail instead, with the
file input hidden in the DOM rather than unmounted so the button has
something to open.

Choosing a file names it in the adjacent field and stops there. A
template has no upload endpoint to post to, and repainting the artboard
from a local object URL would show something the template does not
ship.

Co-authored-by: Cursor <[email protected]>
The rail's locks all revealed at once because the hover marker sat on a
wrapper around the tree; TreeListItemData.className now marks each row, so
the selector scopes to the row being pointed at.

Groups take the frame mark instead of repeating a child's glyph — a parent
is a container, not another layer of that kind — which frees the tabs to
carry a pen.

Rail glyphs all resolve to the secondary icon token. It and its text
counterpart agree at the theme root but diverge under this editor's theme,
so the lock, keyed to the text ramp, rendered darker than the layer glyphs
on its own row. Tabs dim icon and label together; dimming the label alone
left the icon at full strength and read as half-active.

Co-authored-by: Cursor <[email protected]>
Fading a control that still occupies its box costs the tab's name 20px
permanently to hold room for something usually invisible. The close now
collapses to zero width at rest and takes its 20px back on hover, so the
space belongs to the name until the close is actually wanted.

That needs a set tab width. With content sizing the label has nothing to
shrink against, so revealing the close would push every tab to its right:
the strip reflows under the pointer and the tab being reached for moves
out from under it.

Also swaps the per-side padding button to square-square, which reads as a
box inside a box rather than as one more dashed outline among the axis
inputs beside it.

Co-authored-by: Cursor <[email protected]>
Separate tabs with a 16px vertical Divider, dropped either side of the open
document — tabs are one width, so the rule marks a boundary rather than a
midpoint, and the open tab already reads as separate by its fill. Hidden
rather than unmounted so changing the selection does not add or remove a flex
item and slide the strip under the pointer that just clicked it.

Tabs take the file mark: a tab stands for an open file, and the frame mark
belongs to the layer groups where it names an actual container. The strip's
new-document + joins the rest of the chrome on the secondary icon token.

The close reveal is instant. Easing a width reflows the label for the length
of the animation, so the name wobbled every time the pointer crossed a tab.
Widen the set tab width to hold the longest seeded name with its close
showing, since the open document never hides one.

Swap the hand-rolled button-wrapping-an-img in the image row for Thumbnail,
which already carries the button semantics, hover overlay, accessible name
and radius it was re-deriving. It ships at 64px for media grids, so it takes
a width override to join a row of 28px controls.

Co-authored-by: Cursor <[email protected]>
A tab sits at its widest and gives ground as documents are added or the
window narrows, spending the label's slack before truncating and stopping at
a floor so a crowded strip scrolls rather than grinding every tab to a
sliver. The ceiling has to be width and not flex-basis: a basis does not
raise an item's max-content contribution, so the strip sized itself to the
tabs' content and then squeezed them back under their own basis, leaving
every tab short with the bar half empty.

The strip caps itself too. It sits in Toolbar's start slot, and that is not
the slot built to give way — only the centre slot carries min-width: 0, so a
start slot grows to its content and pushes the bar wider. Widening the start
slot in core would change every toolbar to suit one page, so the cap is
local, measured in cqw against the header. The new-document button moved out
of the strip: it is not one of the open documents the group is named for, and
inside a scrolling strip it would be the first thing to scroll out of reach.

Both side panels fold below a width rather than being switched off, so the
View menu's toggles keep recording intent and a panel that vanished for room
returns when the window grows. The inspector goes first, the rail later, and
each resize handle folds with its panel.

Tabs also separate with a 16px rule, dropped either side of the open tab and
hidden rather than unmounted so changing selection does not slide the strip.

Co-authored-by: Cursor <[email protected]>
@thedjpetersen

Copy link
Copy Markdown
Contributor

@ernestt this looks great - is it going to get merged?

# Conflicts:
#	apps/template-viewer/package.json
Reuse the template theme for the hue track, adopt the shared container reveal primitive for row actions, and complete TreeList per-item styling support.

Normalize both Changesets with the pull request reference and owner attribution.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 21, 2026
github-actions Bot added a commit that referenced this pull request Sep 21, 2026
TreeListItemData accepts xstyle, style, and className; all three compose on
the Item row box in the precedence the TreeList contract records (component
styles, then xstyle, then className, then inline style, merged after the
private indent custom property).

Completes FR5 of the TreeList component contract, which requires all three
mechanisms on the same row rather than className alone.
# Conflicts:
#	.changeset/tree-list-item-classname.md
A table reflow in the DialogHeader module contract and a trailing blank line
in the TextInput tests rode along with an earlier merge. Neither belongs to
this template, and the branch should touch no packages/core file.
@ernestt
ernestt changed the base branch from main to core-tree-list-item-classname September 21, 2026 16:45
@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Sep 21, 2026
@ernestt

ernestt commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Restructured against the TreeList contract that landed in #6406.

Verified on the merged branch: core and neutral-theme builds, CLI strict and template-doc typechecks, and the docsite template-preview coverage test all pass. On #6238: 85 TreeList tests, core typecheck, check:knowledge, and check:repo pass.

Still open here, unchanged: the inspector controls that update state the artboard does not read.

astracat-bot[bot]
astracat-bot Bot previously requested changes Sep 22, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for one material issue: the inspector exposes editable layer controls whose values never reach the artboard. I reviewed exact head 411cc6a9a57237817ab64537aa0a1b5a072dd935; focused TreeList tests (85/85), the generated docsite preview test, builds, typechecks, and formatting pass. The supplied exact-head light/dark screenshots render the editor, but the state-to-render binding is incomplete as noted inline.

icon={GLYPH.x}
label="Horizontal position"
value={selected.x}
onChange={next => updateSelected({x: next})}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the geometry and appearance controls affect the selected artboard layer (or remove them from this slice). This handler updates selected.x, but the artboard render above never reads x, y, width, height, padding, radius, border, fill, box shadow, or rotation; image fit and text family/weight are likewise stored but unused. In the normal editor flow, a person can change these apparently functional controls and see no visual change, so the template does not deliver its core fixed-coordinate inspector workflow. Please wire the supported controls into rendering and add an interaction test that changes one of these values and verifies the artboard output.

@ernestt
ernestt changed the base branch from core-tree-list-item-classname to main September 22, 2026 18:09
@ernestt
ernestt requested a review from cixzhang September 22, 2026 18:12
@ernestt
ernestt dismissed astracat-bot[bot]’s stale review September 22, 2026 18:14

not intended to be functional

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Sep 22, 2026
github-actions Bot added a commit that referenced this pull request Sep 22, 2026
@ernestt
ernestt merged commit 4a96203 into main Sep 22, 2026
33 checks passed
@github-actions
github-actions Bot deleted the template-canvas-editor branch September 23, 2026 06:24

This branch was successfully deployed

1 active deployment
Preview — eedd7ac0 Deployed Sep 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants