feat(www): create builder panel implementation - #664
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The panel chrome acts on the real create engine: the switcher shows the working system name and applies saved systems, reset clears engine + lab state, search drills into chapters (member labels match composites), Save opens the preset dialog and adopts the saved name, Export opens the export dialog. /internal/panel-lab keeps the inert design shell (no PanelSystem).
Built-in presets (Origin, Linear, Vercel, …) surface as a Presets submenu in the system switcher, each with its swatch dot. Applying one detaches from any active saved system and adopts the preset's name — a starting point, not saved state.
Replaces the hand-rolled switcher menu with the existing PresetPicker: saved systems and built-in presets in one searchable list with live preview flyouts, saved-system actions (rename/duplicate/delete), the unsaved-changes guard before applying over dirty work, and the ?gallery= deep link restored. Preset states compare in canonical form — the codec's encode∘decode isn't byte-identical, which falsely flagged pristine built-ins as unsaved after a reload. Picking a preset now also adopts its name into the working system.
a7c9302 to
31f83f6
Compare
Spacing/radius tweaks matched their baked defaults (12px gaps, 10px radius) so the scaffolding deletes cleanly; the index value line ships enabled — every row shows its chapter's current value under the label.
The incoming pane fades in over a 20px slide — from the right drilling in, from the left coming back — 220ms cubic-bezier(.2,.7,.3,1), taken from the Design System Builder canvas (pageIn/pageBack). Outgoing pane swaps out instantly so motion never gates input; transitions target the CSS translate property (Tailwind v4 translate-x-* utilities), honoring reduced motion.
Motion group in the dev tweaker: Drill-in (slide / fade / instant, default slide) picks the pane-entry treatment, and Popovers (animated / instant, default animated) zeroes the .popover slot transition via a root attribute + injected rule so every popover surface opens with no easing. Defaults match the shipped look; scaffolding to bake out once picked.
80e99b4 to
d6a52f1
Compare
A fresh /create seeds the Origin preset (brand blue, primary from accent) instead of a blank "Untitled" system: the header names it Origin, the modified indicator and global reset now diff against and return to Origin rather than the bare engine defaults, and the save/ rename dialogs drop the Untitled placeholder.
|
Code review Found 2 issues. 1. Unrelated devtools/react-grab removal bundled into a scope-limited PR This PR's stated scope is the header/chrome controls (switcher, reset, search, save, export) plus carried-forward design-only work (illustrations, Charts/Invalid split). Separately, and unmentioned in the PR description, a standalone commit (
CLAUDE.md: Lines 90 to 92 in 3327744
Worth splitting into its own PR (or at least calling out explicitly in the description) so it doesn't ride along silently with an unrelated feature change. 2. New Charts axes (
CLAUDE.md: Lines 89 to 91 in 3327744
Notably, this PR's own CLAUDE.md edit (tracking issue #666) states the rewrite process still requires this: "A chapter carries a WIP chip until its values actually drive the preview and export." Charts is wired into the live /create route with no WIP chip and no linked approval/discussion for this specific axis set — the PR body frames it only as "carried-forward design-only work," not a separately proposed axis. |
Every chapter wears a small WIP chip inline after its title — on the index row and the drilled-in header — until its values drive the preview and export. Driven by WIRED_CHAPTERS (wired.ts): a chapter's chip drops in the PR that wires it (issue #666).
What
The panel-lab drill-in panel becomes the real /create builder panel. Design landed first (below); this PR now carries the implementation, feature by feature.
Decision: the panel schema is the source of truth. The panel-lab schema (
www/src/modules/panel-lab/state.ts) defines what a design system's config is. Implementing a chapter means making the engine/preview/export respond to its axes — reusing existing engine machinery where an axis already matches, adjusting the engine where it diverges, building the mechanism where the axis is new. We never bend the panel to fit old engine params.Plan
PanelSystemwiring (create.tsx);/internal/panel-labkeeps the inert design shell. Switcher shows the working system name, lists saved systems (active checked), applies on select, "New design system" resets; global reset clears engine + lab state and only shows when something differs from defaults; search (⌘P) takes over the header and drills into chapters — composite members match, so "segmented" lands on Buttons; footer Save opens the preset dialog (saving now adopts the name into the working system) and Export opens the export dialog.Remaining work moved to the tracking issue: Create panel: wire chapters into the engine #666 (chapter skeleton + WIP chips, then one PR per chapter, merged to main).
Pending from the design streamDone: the dev-tweak scaffolding is baked in — 12px gaps, 10px radius, index value lines always on.Background — design work already on this branch
Index illustrations — React Aria anatomy school
Every index card carries a stateless monochrome illustration of its chapter's subject (modeled on React Aria's component illustrations): flat schematic geometry on the fg alpha ladder, real words at specimen size, complete miniatures sized for the row band. One grammar across all 40 cards; shared vocabulary in
variants/demos/ink.tsx. Selection controls draw from the themed--neutral-*palette; Color keeps the live brand seed; Invalid keeps danger red; Disabled is a ghosted button under the ban cursor. Registry now only carries ids the index renders. Net −780 lines invariants/.Index rows — live value line
Each row can show its chapter's current value under the label at 12px
fg-muted/60; gated behind a dev tweak (Index → Index values, default off) pending a keep/drop call.Also from the design stream
LabCreatePanelmounted in /create's desktop slot in place ofCreatePanel.