v0.4.0-alpha — admin grows up
Pre-releasehooked on facets v0.4.0-alpha — admin grows up
Fourth alpha. The facet editor goes from "scaffold that works if you know what you're doing" to a real CRUD experience: drag rows to reorder, duplicate or delete inline, and get caught at the door if your config has problems.
⚙️ Admin facet editor — the gap closes
Up until v0.3 the admin UI could read facets and let you edit one at a time, but the day-to-day operations on a facet list (reorder, duplicate, delete, validate) were either missing or buried. v0.4 finishes the loop:
| Before | After |
|---|---|
| List order was whatever order facets were saved in. No drag. | Drag any row by its grip handle to reorder. Pointer-based with FLIP-style row physics so the motion feels right. |
| Delete lived at the bottom of the editor pane, after you'd selected the facet. | Per-row × button on hover. Confirm dialog stays. |
| No duplicate. To copy a facet you'd manually re-enter every field. | Per-row ⎘ duplicate. Clones with a -copy / -copy-N suffix; deep-clones settings so editing the copy doesn't mutate the source. |
| Save would happily persist a facet with no slug, no source, or a duplicate name. Silent data loss. | Validation gates the save. Required fields go red, the offending row gets a ⚠ badge with tooltip, and the Save button switches from Save changes to Fix N issues in red — so users see it's a deliberate block, not a hung UI. |
Validation rules (new admin/src/validation.js)
- Slug: required, slug-safe (
^[a-z][a-z0-9_-]*$), unique across the list. - Label: required.
- Source: required for non-view kinds.
- Kind alignment: view-display facets must have
kind = view. - 2D Slider:
x_facetandy_facetrequired and must be different. - Visual DNA:
target_facetrequired and must point to a color-bearing display (checkbox/radio/dropdown/swatch/swiper).
The same validateFacet(facet, allFacets) function powers per-field inline errors in the editor, row-level ⚠ badges in the sidebar, and the save-button gating in App.jsx. One source of truth, three surfaces.
🆙 Upgrade from v0.3.0-alpha
Drop-in. No schema changes; no settings changes; existing facet configs continue to work. The new validation runs on the in-memory state — invalid facets are flagged but already-saved facets aren't deleted.
Still in the box
Everything from v0.3.0-alpha continues to work: ten public facet displays (Checkbox, Radio, Dropdown, Toggle, Hierarchy, Range, Date Range, Search, Color Swatch, Swipe Deck), the 2D Slider / Ask / Visual DNA view facets, Visual DNA v3 palette-matching with MIN-ΔE76 cross-product ranking, the React 18 admin SPA, the vanilla JS public runtime, BYOK Anthropic key for Ask.
Feedback
Issues, PRs, "this didn't work for me" reports — all welcome.