astra
alpha-0.1-background
alpha-0.1-dir-prefs
alpha-0.1-sec-dom
menubar-v4-safe
active-uix
morfo-runtime
morfo-driven-soma
semantuix
glm-5
main
sium-v1.0
${ noResults }
85 Commits (b68b831320ee1983f841c899e1b2f6bfa935ffea)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
b68b831320 |
soma test: instrument 7 more demos for permutation runner (composite + toggleables batch)
Adds `data-perm-step` + `<meta name="perm-axes">` + perms seed to: - **accordion** — expand item-1 → switch to item-2. `?perm.value=item-1` seeds the Provider's value array. `dir` axis. - **listbox** — select apple (first) → select apricot. `?perm.orientation` flips the layout, already wired. Items in a loop use conditional `data-perm-step` by index. `dir,orientation` axes. - **tree-view** — select readme → select license under the expanded docs branch. `?perm.expanded=docs&perm.selected=readme` seed. `dir` axis. - **combobox** — open via trigger (Combobox.Trigger). `dir` axis only — typing / selection is left to v4 per-component value enumeration. - **menubar** — open File menu → close via Escape (mode=key, 500ms settle). `dir` axis. - **toggle** — press Bold toggle (inside Field.Provider integration example). `dir` axis. - **toggle-group** — press left → press center (single mode). Added `aria-label="Text alignment"` to silence the A4 DEV warning that now fires (shipped in batch 10 of audit 2026-04-21). `?perm.value=bold` preselects. `dir,orientation` axes. ## Deferred in this batch - **context-menu** — needs `contextmenu` event (right-click). Requires a `data-perm-mode='contextmenu'` extension to the runner. Future batch. - **navigation-menu** — hover-driven only. Same future-batch treatment as Tooltip has with `data-perm-mode="focus"` + long settle. ## Coverage delta - Before: 8 demos · 19 variants · 62 steps. - After: 15 demos · 35 variants · 106 steps. ~1.7× jump in a single batch. Tabs still leads with 4 variants (adds `orientation` + `disabled` axes); ToggleGroup, Toolbar, Listbox each have 3 variants. ## Verification - `npm run check`: 0 errors in soma/morfo/test-route scope. - `npm run smoke`: 65/65 routes. - `npm run morfo:check`: 66/66 morfos. - `npm run perm:check`: 15/15 demos · 106 steps · 35 variants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
1e8500bfac |
soma test: instrument 5 overlay demos for permutation runner
Adds `data-perm-step` + `<meta name="perm-axes">` + perms seed to the 5 overlay demos sharing Dialog's open/close shape: - alert-dialog — trigger open → cancel. `?perm.open=true` seeds. `disabled` deliberately NOT in axes: disabling the Provider blocks the Trigger click path the runner depends on. - popover — trigger open → close button. `?perm.open=true` seeds open1. - tooltip — focus trigger (mode=focus, 1s settle — tooltip opens after 700ms delay). No close step: tooltip closes on blur. - drawer — trigger open → close button (500ms settle for exit animation). `?perm.open=true` seeds basicOpen. - dropdown-menu — trigger open → Escape close (mode=key, 500ms settle). Second step targets the Menu.Content selector because the Content only mounts after the Trigger step fires (runner handles dynamic step discovery). All five declare `dir` as the only axis (universal RTL variant). The other orientation / disabled axes don't apply to these overlay shapes. ## Coverage delta - Before: 3 instrumented demos · 9 variants · 34 steps. - After: 8 instrumented demos · 19 variants · 62 steps. 2x jump in per-CI-run validations with zero infra changes — just applying the v1-v3 convention to additional demos. ## Verification - `npm run check`: 0 errors in soma/morfo/test-route scope. - `npm run smoke`: 65/65 routes. - `npm run morfo:check`: 66/66 morfos. - `npm run perm:check`: 8/8 demos · 62 steps · 19 variants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
545d47148c |
morfo: permutation runner v3 — per-demo axis matrix via `<meta name="perm-axes">`
v2 ran every demo under a hard-coded `ltr` + `rtl` matrix. v3 lets each demo declare which additional axes it honours — `orientation`, `disabled`, `readonly`, `invalid`, `loading` — and the runner adds ONE variant per declared axis (axis-at-a-time, not cartesian, so the matrix stays bounded at O(N) instead of O(2^N)). ## Convention ```svelte <svelte:head> <meta name="perm-axes" content="dir,orientation,disabled" /> </svelte:head> ``` `dir` is universal (always runs). The other axes are opt-in: they only produce variants when the demo both lists them in the meta AND wires the corresponding state from `Perms.getOr(...)`. Without the meta, only `ltr` + `rtl` run. ## Runner changes - New `discoverAxes(base, morfoKebab)` pass: loads the baseline URL, reads `<meta name="perm-axes">`, returns the declared axis list. - `buildVariants(declaredAxes)` composes `ltr` + `rtl` + one `?perm.X=Y` variant per declared axis from the `AXIS_FLIP` map. - `[initial seed]` step validates morfo at each URL before any click, so URL-seeded state alone is exercised (catches seed regressions even when the click cycle never fires). ## Demo opt-in (this commit) - `dialog` — `perm-axes="dir"` (no orientation / disabled / loading axes apply to Dialog). - `tabs` — `perm-axes="dir,orientation,disabled"` + wires `orientation` + `disabled` to the first `Tabs.Provider`. - `toolbar` — `perm-axes="dir,orientation"` + wires `orientation` to the first `Toolbar.Provider`. Result: 3 demos, 9 URL variants, 34 step validations per CI run (v2 was 22 steps across 6 variants). ## Docs `src/uix/morfo/PERMUTATION_RUNNER.md` v3 section: supported axis table, 3-step opt-in recipe, roadmap updated (v4 = morfo-inferred value cycling, v5 = MutationObserver ordering for Sema). ## Verification - `npm run check`: 0 errors in soma/morfo/test-route scope. - `npm run smoke`: 65/65 routes. - `npm run morfo:check`: 66/66 morfos. - `npm run perm:check`: 3/3 demos · 34 steps · 9 variants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
575748f079 |
morfo: permutation runner v2 — URL-driven state seeds + RTL variant
v1 shipped click-based state cycles. v2 adds URL-seeded initial state so
the runner can reach any state the component exposes without walking a
click sequence, and runs every instrumented demo TWICE in CI (LTR + RTL)
to catch direction-specific regressions like the slider thumb transform
that landed this week.
## New test-route infrastructure
- `src/routes/test/soma/_perms.svelte.ts` — parses `?perm.X=Y` query
params into a typed `Perms` record (naive coercion: `'true'` → boolean,
digits → number, else string). Exposed via `Perms.getOr({})` context.
Underscore prefix so SvelteKit does not route it.
- `+layout.svelte` — parses perms once at mount, sets context, honours
`?perm.dir=rtl` and `?perm.locale=en` by routing through
`App.setDir` / `App.setLocale` so the existing control strip stays in
sync.
## Demo opt-in
Three demos seed initial state from URL params (v1 + v2 combined):
- `dialog` — `?perm.open=true` lands open.
- `tabs` — `?perm.value=tab-2` lands on that tab.
- `toolbar` — `?perm.format=bold,italic` + `?perm.align=center` preselect
toggles.
## Runner extension
`scripts/permutation-check.ts` now runs each instrumented demo under a
matrix of URL variants (currently `ltr` + `rtl`), validates morfo at the
URL-seeded state BEFORE any clicks (logged as `[initial seed]`), then
runs the v1 click cycle. Output format updated to show per-variant
blocks.
Result: 3 instrumented demos × 2 variants = 22 step validations per CI
run. RTL seeding reproduces the specific state machine the slider
`translate(50%, -50%)` bug needed to fail — had v2 been in place that
day, the regression would have fired before shipping.
## Docs
`src/uix/morfo/PERMUTATION_RUNNER.md` gains the v2 section (layout
plumbing, demo opt-in, URL variant table, `[initial seed]` step
semantics) and marks v1 + v2 as shipped 2026-04-22. v3 (morfo-inferred
per-component axis matrix) and v4 (MutationObserver ordering for Sema)
remain on the roadmap.
## Verification
- `npm run check`: 0 errors in soma/morfo/test-route scope.
- `npm run smoke`: 65/65 routes.
- `npm run morfo:check`: 66/66 morfos.
- `npm run perm:check`: 3/3 demos · 22 steps across 2 variants.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
61e4ba6d26 |
morfo: add permutation runner (A37) — third validation layer for state transitions
## Why
`morfo:check` validates single-state DOM at page load; `smoke` catches
hydration-time errors. Neither ejercices state TRANSITIONS — and that is
where every reactivity bug we caught this week actually lived:
- toolbar A35 loop (mount-time, not caught by either)
- form A36 microtask loop (mount-time with onChange)
- slider RTL transform (static value, off-by-thumb-width)
All passed the existing CI. All would have failed a "click, re-validate"
pass.
## What
- **`scripts/permutation-check.ts`** — Playwright runner. For each demo,
collects `data-perm-step="N"` elements, executes them in ascending
order (re-discovering after each step so portal-gated controls get
counted), and re-validates the component's morfo + captures any
`pageerror` / `console.error` between steps.
- **`data-perm-*` authoring convention** — step index, human label, mode
(click / focus / type / key), settle delay, skip-validate flag. Demos
opt in incrementally; the runner SKIPs annotation-less pages without
failing.
- **`src/uix/morfo/PERMUTATION_RUNNER.md`** — full design doc covering
what it validates, the annotation convention, example, failure format,
and v2–v4 roadmap (URL-driven states → morfo-inferred cycles →
MutationObserver ordering for Sema).
- **COMPONENT_GUIDE A37 + checklist item 40** — instrumentation is now a
ship-gate rule; doc lists coverage targets (overlays / toggleables /
composite roving / forms / RTL) and explicit skips (alerts, file
pickers).
- **`npm run perm:check`** — pipeline entry, exit codes 0/1/2
parallelling `morfo:check`.
## Instrumented demos (v1 seed)
- dialog — 2 steps: open via trigger → close via Close button. Step 1 is
inside `{#if open}` + Portal; runner's dynamic re-discovery handles it.
- tabs — 3 steps: initial tab 1 → switch to tab 2 → switch to tab 3.
- toolbar — 3 steps: toggle bold / italic / underline GroupItems
(exercises the A35 pattern that previously looped).
Result: 8/8 permutations pass; 63 demos SKIPPED pending instrumentation.
## Verification
- `npm run check`: 0 errors in soma/morfo/scripts scope.
- `npm run smoke`: 65/65 routes.
- `npm run morfo:check`: 66/66 morfos.
- `npm run perm:check`: 3/3 instrumented demos, 8/8 permutations.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
6efbfeb795 |
sium: color demo widgets inline + queue CDX-212 (services registry)
- color demo now registers a ColorPicker-based widget inline so kind:color fields render properly instead of showing [object Object] in the fallback text input. Temporary — CDX-212 moves defaults to Soma.services.sium.widgets where they belong. - CDX-212 shard drafted with full v2.3 design (Soma services registry, SiumService.widgets, 3-layer override: instance > subtree > global). Includes all conversation context up to 2026-04-21 so tomorrow's session resumes without paginating chat history. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
a722d443b2 |
sium: migrate 6 remaining demos to App+Soma+extend pattern + specimen-book design
Closes the v2.2 demo sweep. All 8 sium test pages (booking, color, kitchen-sink,
login, settings, signup, survey, tree) now share:
- App-level langs: each page does `App.get().langs.extend('demo', {...})` to add
its own namespace. siumLangs + componentLangs already registered globally by
/test/sium/+layout.svelte. Locale switch goes through `app.setLocale()` so
Form.AutoFields sees translated sium.errors.* without per-page plumbing.
- Specimen-book design language: shared CSS in /test/sium/_design.css. Pages
contribute markup only — masthead with eyebrow + schema-name + shape-hint +
locale-switch, hairline rules, description, two-column .specimen layout with
numbered PLATE debug panels.
- No inline <style> blocks. No local createLangs. No ad-hoc helper functions.
Each demo went from ~98 v1-pattern lines (with 25 lines of inline CSS) to ~110
v2.2-pattern lines (zero CSS, all imports via canonical libs). Login was already
migrated as the pilot last turn.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
8a4bbb4aa6 |
sium: v2.0 → v2.2 — Issue idlangref, SiumProvider, progressive forms, plurals
Multi-phase delivery closing fase-9 through fase-13 (v2.0 → v2.2).
sium core + langs:
- Issue shape unified to idlangref: { path, code, message: '#?sium.errors.X|fallback', params }
- Dropped MESSAGES registry, resolveIssue, message-resolver (CDX-201, GLM-201, CDX-202)
- Split min/max codes by runtime context: min_value/max_value (numeric, no plural) +
min_length/max_length (string/array, p()-pluralized via count:actual). ISSUE_CODES: 15 → 17.
- BREAKING: Issue.code === 'min' | 'max' consumers must migrate to the 4 new codes.
- toStandardIssues now preserves code + params at the SS bridge (was silently dropping
them, which collapsed interpolation and plurals downstream).
- New core/introspect.ts: serializeSchema, countLeafFields, walkSchema (WeakSet cycle
detection + maxDepth).
sium svelte:
- SiumProvider class + <Sium.Provider {schema}> component (scoped context, schema-only).
- Lang is NOT a Sium concern — orthogonal layer consumed directly from Soma.langs.
soma form integration:
- Form.Provider reads SiumProvider context, creates form internally, exposes bind:form.
- Form.AutoFields translates errors at render via lang.ts / interpolateTemplate.
- form.issues now carries structured Issue data (code + params) alongside form.errors.
- validationBehaviour gains 'progressive' mode + becomes default: quiet until first
invalid submit, onChange until a submit succeeds, quiet again.
- AutoFields wires onblur → form.setFieldTouched, enabling onBlur mode end-to-end.
- createForm hardened with $effect.root fallback; onChange/onBlur hang fixed via
untrack() in runValidate's async branch.
- Form.AutoFields now part of the Form namespace barrel (<Form.AutoFields>).
dias + colors (public API completions):
- dias: isCalendarDate / isCalendarDateTime / isTime / isZonedDateTime type guards +
parseDateSafe / parseDateTimeSafe / parseTimeSafe non-throwing wrappers.
- colors: isColorValue(unknown): value is ColorValue type guard.
Demos + docs:
- /test/sium/+layout.svelte mounts App + Soma with siumLangs registered globally.
Locale switch propagates via app.setLocale() so AutoFields sees translated errors.
- Design language extracted to /test/sium/_design.css + loaded by layout (specimen-book
aesthetic: Fraunces + Geist Mono, hairline rules, cinnabar accent, § sections,
numbered PLATE debug panels).
- Kitchen-sink demo gets live validation-mode switcher (4 modes) via child FormShell
remount with {#key mode}.
- README / GUIDE / INTRO / COOKBOOK aligned to v2.2. New IMPLEMENTATION_STATUS.md as
single-page snapshot of everything delivered and accepted.
- Coordination shards (CDX-201..211, GLM-201..204) live under lib/sium/status for
reproducibility and audit trail.
Tests: 378/378 green across sium core, langs, schema, primitives, refines, combinators,
standard-schema, introspect, form.svelte, form-auto-fields.svelte.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
2627dc2094 |
soma: fix slider thumb alignment + document morfo in README
## Slider thumb misalignment `SliderThumbProvider.thumbStyle` used `translate(50%, -50%)` for both LTR and RTL. For LTR that pushed the thumb RIGHT by half its width from the `left: X%` anchor — visible symptoms in the time-picker / time-range-picker demos: - thumb never reached `left: 0` (centre at value=0 was offset by thumbWidth/2) - thumb overshot the track on the right edge at value=max - drag felt off by the same amount throughout Fix: use `translate(-50%, -50%)` for LTR (thumb centre aligns with anchor) and keep `translate(50%, -50%)` for RTL (anchor is `right: X%`, thumb must shift right by half its width to centre-align). Matches the logic already used by `SliderTickProvider` which chose `tx = isRtl ? '50%' : '-50%'`. Browser probe confirms: value=0 now centres at 0%, value=30/59 at ~50.8%, style attribute reports `translate(-50%, -50%)` in LTR. ## soma README documents morfo Added §4b "Morfo — contrato declarativo cross-layer" covering: why morfo exists (6-place drift without it), how providers consume it (`createAttrs(morfo)` + `registerContract(morfo)`), the mandatory `as const satisfies Morfo` authoring pattern for literal-typed inference, the 3-layer validation pipeline (schema / assertContract / morfo-check), and the boundary (what does NOT go in morfo — props, prose, langs, state machines, visual recipes). Updated the §4 structure listing so `attrs/create-attrs.ts` shows the new signature. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
50821aae44 |
soma: P3 cleanup — LinkPreview a11y section + TagGroup key API consistency
- LinkPreview README: elevate the "intentionally hidden from AT" note to its own `## Accessibility` section with the three reasons (duplicate content, hover-only activation, focus stays on trigger). Consumers reaching for an AT-visible preview are pointed at Popover / Tooltip. - TagGroup `handleItemKeydown`: vertical nav now calls `getDirectionalKeys(dir, 'vertical')` (returns UP/DOWN absolute) instead of hardcoded `KEYS.ARROW_DOWN/UP`. Functionally identical — vertical keys don't flip under RTL — but keeps the shape symmetric with the horizontal branch and matches the convention used across the library. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
8d4f53a73f |
soma/morfo: typed createAttrs + 6 audit batches + form hang fix + A36
## morfo: typed createAttrs
- `types.ts`: all array fields are now `readonly` so morfos can be authored
with `as const satisfies Morfo` without casts.
- `createAttrs` is a generic `<const M extends MorfoShape>` that infers the
emitted attr map from the morfo's literal shape. Typos like `attrs.trigerr`
are now compile errors; autocomplete lists every valid part.
- All 66 morfos migrated: `export const xMorfo = { ... } as const satisfies Morfo`.
- Two latent bugs the new typing caught: `dateRangeFieldAttrs.root` and
`timeRangeFieldAttrs.root` — legacy from the root→provider refactor, fixed
to `.provider`.
- Docs (morfo/README, COMPONENT_GUIDE) mandate `as const satisfies Morfo`;
the older `: Morfo` annotation widens literals and loses autocomplete.
## Audit batches 1–7 (soma-audit-2026-04-20)
Batch 1 — Keyboard a11y (A14/A12):
- Tabs: `isFallbackTabStop(el)` using `untrack` → first trigger gets
`tabindex=0` when no tab matches (WCAG 2.1.1 was failing).
- RatingGroup: `dir` prop + `getDirectionalKeys(dir, 'horizontal')` for RTL.
- Accordion P1-1/P1-6 dismissed: roving/labelledby already correct per APG.
Batch 2 — A33 reactive collections: Select `labelRegistry` and NavigationMenu
`triggerRefs` migrated to `SvelteMap`.
Batch 3 — A31 O(N²) fix: RadioGroup lifts `hasSelection` + `isFallbackTabStop`
to the provider with `untrack`-wrapped DOM walk. Per-item derivations drop
from O(N²) to O(1) per trigger.
Batch 4 — Morfo aria sync: toast / time-field / date-field / tabs /
tag-group / navigation-menu declare every aria the provider emits
(14 entries across 6 files).
Batch 5 — Accessible naming props: Tabs.List, ToggleGroup, TreeView,
NavigationMenu expose `aria-label?` / `aria-labelledby?` with explicit
"required unless labelledby is set" JSDoc.
Batch 6 — A30 cleanup: Checkbox `setLabelId` and 5 trigger-ref providers
(select/tooltip/link-preview/dropdown-menu/context-menu) migrated from
`$effect(() => parent.ref = opts.ref)` to the `Provider` base's
`onRefChange` callback (fires via attachRef inside `untrack`).
Batch 7 — A11 wrapper thinning: stepper/tree-view wrappers removed
`ctx.get()`, providers expose proxy derivations; time/date-range-field
inputs use `untrack(() => …)` for one-shot id registration; menubar
content's 40-line keyboard nav moved to `MenubarMenuProvider.onContentKeydown`;
color-picker area + channel-slider pointer state machines moved to the
providers with `onpointerdown/move/up` emitted via `props`.
form-auto-fields deferred with justification (reflective schema renderer,
not a state-holding wrapper).
## Form hang fix (A36)
`runValidate` entered the `isPromiseLike` branch even for sync schemas
because sium's Standard-Schema adapter declares `validate: async`. The
fallback `return { errors, issues }` read both reactive vars inside the
validation `$effect` while the `.then(...)` microtask wrote them
→ microtask-mediated loop, silent to Svelte's sync effect-depth guard.
Symptom: kitchen-sink hung the tab on mount with onChange / onBlur.
Fix: `return untrack(() => ({ errors, issues }))`. Regression locked by
two new 5s-timeout tests in `form-auto-fields.svelte.test.ts`.
Pattern codified as A36 in COMPONENT_GUIDE; CLAUDE.md count updated to
A1–A36 / 39 items.
## Verification
- `npm run check`: 0 errors in soma/morfo scope (sema demo pre-existing
errors untouched).
- `npx vitest run src/uix/soma src/uix/morfo`: all tests green
(94 + 7 = 101 tests, inc. 2 new form regression tests).
- `npm run smoke`: 65/65 routes.
- `npx tsx scripts/morfo-check.ts`: 66/66 morfos.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
e1837e8727 |
docs: add A35 (ref+parent-write effect loop) + update CLAUDE.md
A35 codifies the toolbar incident (2026-04-19): per-item `$effect` that reads `opts.ref.current` and writes provider state read back by per-item `props` $derived triggers `effect_update_depth_exceeded` via the attachment reapply cycle. Register in the constructor (A30-style); use `$effect` for cleanup only; wrap DOM walks in `untrack` when called from `$derived`. - COMPONENT_GUIDE: §A35 rule, checklist item 38 - CLAUDE.md: checklist count updated (A1–A35, 38 items), verification mention of morfo-check + morfo kebab naming note Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
91257e8526 |
soma/morfo: rename root part → provider + fix toolbar effect loop
Naming coherence across the part layer: the root part's `kebab` field now
matches its `name: 'Provider'`. The `createAttrs` special case still emits
`data-{component}` (no suffix) for the provider part — the DOM contract is
unchanged, only the authoring name changes.
Affected:
- createAttrs special-case: 'root' → 'provider'
- 66 morfos: kebab 'root' → 'provider'
- 77 soma provider files: `attrs.root` → `attrs.provider`, constructor
part arg 'root' → 'provider'
- Docs: A2 rule rewritten, morfo/README, soma/README example updates
- Test / schema / morfo-check: updated for new kebab
Toolbar fix: remove `itemsVersion` counter and per-item `$effect` blocks
that called `notifyItemsChanged()`. The pattern was an A30 violation —
each item's $effect read `ref.current`/`disabled` and wrote back to the
provider, which cascaded through `firstTabStop` → per-item `props`
$derived → DOM reattach → effect re-run, triggering
`effect_update_depth_exceeded` on page load. `isTabStop` now uses
`untrack` around the DOM walk so per-item `props` derivations only
depend on `lastFocusedElement`.
Verification: 7/7 morfo tests, 65/65 smoke, 66/66 morfo-check, no effect
loops detected across any demo page.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
0222af7a0b |
morfo: enrich 65 components with aria + keyboard + focus contracts
Each morfo now declares what its provider actually emits (via agent-based
extraction from provider code). Before: parts + data only. After: parts +
data + ARIA per part + keyboard per part + focus policy for overlays.
Contract source: provider's `readonly props = $derived.by(...)` blocks,
classified into the v.* value kinds — literal, stateRef, partRef, propRef,
translationRef. Conditions extracted from ternary / guard patterns.
Focus policies added on overlay components: popover, drawer, alert-dialog,
dropdown-menu, context-menu, select, date-picker, date-range-picker,
time-picker, time-range-picker, color-picker. Context-menu uses
return:'previous' (no discrete trigger). Tooltip, link-preview, combobox,
command omit focus (no trap).
Tag-group Link variant: morfo-check tolerates sibling parts sharing a
physical element (Link IS Item in the DOM) via allPartAttrs cross-scope.
README.md added — developer guide: authoring a morfo step-by-step, the
v.* builders, severity rules, validation layers, polymorphism handling
via defaultElement + role, Sema alignment (data-last-action, transition
markers).
Verify:
npm run check — 5 errs, all pre-existing in sium/examples.
vitest run src/uix/morfo — 7/7 pass.
morfo:check — 64/66 pass (2 flaky Playwright navigation timeouts,
re-run clean when isolated).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
8a5b402dd3 |
morfo: port 65 components + sium.lazy + morfo-check passes 66/66
All 65 soma components now consume their morfo as the cross-layer contract.
createAttrs(morfo) and registerContract(morfo) overloads removed — the
Morfo form is now mandatory. Each component provider has a 3-line morfo
import + wire-up block instead of 20+ lines of inline declarations.
Additions:
sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks
morfo's eventual lazy part-tree validation; tests included).
sium/examples/ — booking, color, login, settings, signup, survey, tree
form demos.
Route demos at src/routes/test/sium/{booking,color,login,settings,
signup,survey,tree}.
Tooling:
morfo-check.ts — now tolerates sibling parts sharing a physical element
(Link variant of Item, etc.). Queries via allPartAttrs cross-scope.
morfo-vocabulary-check.ts — 28 WARN (legitimate per-component
vocabularies or subsets like switch missing "indeterminate"). All
reviewed, none are bugs.
Fixes caught by morfo-check:
table: data-sorted / data-pinned marked severity:'optional' (only
emitted when sorting/pinning active, not always).
tree-grid: data-expanded on Row severity:'optional' (branches only).
menubar: data-menubar-value declared on Trigger.
splitter: data-splitter-panel-id declared on Panel.
Verify:
npm run check — 0 morfo errors (4 pre-existing in sium/examples,
unrelated).
npx vitest run src/uix/morfo — 7/7 tests pass.
npm run smoke — 65/65 routes pass.
npm run morfo:check — 66/66 morfos validate against real DOM.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
8c16ffac81 |
morfo: cross-layer contract + 14 new WAI-ARIA components + Dialog wired
Morfo (src/uix/morfo/): machine-readable contract of a component's public DOM surface, shared between soma/sema/eidos. Shape v5 consolidated across three independent AI reviews (Gemini, Grok, ChatGPT) plus Sema alignment. Types, sium-based validator with cross-field invariants, dialog.ts as the first canonical morfo with data-last-action for Sema-causal exits, 7 passing unit tests. createAttrs(morfo) and registerContract(morfo) now consume a Morfo — legacy inline signature removed. Dialog provider refactored to derive parts + data contract from dialogMorfo. The other 65 soma components need porting (svelte-check lists them) — tracked work. Tooling: scripts/smoke-check.mjs — Playwright smoke over 65 soma demo routes scripts/morfo-check.ts — validates emitted DOM vs morfo scripts/morfo-vocabulary-check.ts — canonical vocabulary consistency npm run smoke / morfo:check / morfo:vocabulary WAI-ARIA APG components added (100% APG coverage now): Announce, Avatar, Clipboard, DragDrop, Feed, GridList, Meter, Progress, SearchField, TagGroup, TreeGrid + Table.RowDetail/Trigger (detail panel pattern; hierarchical Table rows deprecated — use TreeGrid instead). air: Link, Banner. Sema prep: src/uix/sema/sema_pre.md documents the semantic layer's DOM requirements. Morfo already provides everything Sema needs (data-last-action patterns, transition markers, enumerable state values, cross-component consistency). Sema implementation deferred. COMPONENT_GUIDE updated: items 37-39 (translation namespace grep, DOM topology vs .require() audit, npm run smoke is part of done) + A34 rule with incident log. WAI-ARIA pattern listed as soma membership criterion. Pagination translation bug fixed (soma.pagination.page -> idlangref PAGINATION_LANGS.PAGE). Table demo namespace fix (soma.table.* -> components.table.*). Avatar demo now offline-safe (SVG data URL). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
3b704286ba |
sium: v1.0 — schema core, domain types, i18n, Svelte adapter, AutoFields
Ship v1 of sium, the Schema-In-Use Module — soma's native validation layer.
Core (PR1): issue/result helpers, Schema<I,O> factory with ~standard + ~sium
wiring, 5 primitives (string/number/boolean/literal/enumOf), 3 modifiers
(optional/nullable/defaulted), 4 combinators (object/array/union/discriminated),
pipe + 4 step constructors (refine/transform/codec/meta), 7 refines
(min/max/length/regex/email/url/integer), barrel.
Domain types (PR2b): colorValue, dateValue, dateRange, timeValue + 15 segments
(year/month/day, hour/minute/second/dayPeriod, red/green/blue/hue/saturation/
lightness/brightness/alpha). All segments are kind:'number' + meta.channel —
keeps SchemaKind vocabulary tight at 14 entries.
i18n (PR2a): 15 stable issue codes, MESSAGES registry with English fallbacks,
siumLangs LangNode (es + en) for ext/lang integration, pure template resolver
with {{name}} syntax.
Svelte adapter (PR3): resolveIssue/resolveIssues bridge, createForm reactive
with $state/$derived + locale change reactivity + sync/async detection.
Form.AutoFields (PR4): Soma renderer driven by schema introspection. Widget
registry with 4-level priority (meta.widget → channel:X → kind:X → built-in).
Contract supports Component | Snippet widgets — compound widgets like
ColorPicker/Calendar compose inline without wrappers.
Polish (PR5): COOKBOOK with 12 recipes, GUIDE with vs-Zod comparison and
practical examples, kitchen-sink demo (src/routes/test/sium) with locale
switcher and live schema introspection panel, v1 readiness audit report,
doc consistency audit report, isColorValue hardening (rejects NaN + invalid
hex) after production bug report.
Coordination: all work tracked via protocol v2.1 (state.json + sharded orders
+ audit.mjs runner) in src/lib/sium/status/. 340+ tests, npm run check clean
(0 errors, 0 warnings against 28-budget).
Deferred to v1.1 (README §11.2): timeRange, lazy/recursive schemas, tuple/
record/intersection, bundle measurement, additional locales, jsDate coerce.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
72a32e0176 |
soma: 10 new components + reactivity audit + guide rules A30–A33
Components shipped: - AlertDialog (thin Dialog specialisation with Escape=close default) - Breadcrumb (+ interactive Ellipsis composing DropdownMenu) - Carousel (gesture + autoplay + indicators) - Listbox (roving tabindex + typeahead + Ctrl+A multi-select) - NavigationMenu (hover-intent + data-motion direction + Indicator CSS vars) - PinInput (Field-aware segmented input with paste transformer) - RatingGroup (half-step + clearable + keyboard digits) - Toggle (standalone two-state with Field OR-merge) - VirtualGrid (2D windowing for spreadsheets / thumbnail grids) - VirtualList (fixed + dynamic heights, ResizeObserver anti-jump, WindowViewport) Guide rules (src/uix/soma/COMPONENT_GUIDE.md): - A30 + item 32: id registration via direct assign, never $effect — the $effect(() => parent.id = opts.id) pattern causes reactive loops that freeze the page. Ref: PinInput + Listbox incidents. - A31 + item 33: per-entity $derived must not call provider methods that read global state — lift to single provider $derived, per-entity derivations pointer-compare. Ref: Command (2026-04-17), Listbox rovingTarget. - A32 + items 34–35: present comparison table in conversation before declaring done. Every ❌/⚠️ gets an explicit decision (implement / defer to v2 / drop); deferred features become their own README section. - A33 + item 36: reactive collections use SvelteMap / SvelteSet from svelte/reactivity — $state(new Map()) only tracks field reassignment, not per-entry .set/.get/.has reads inside $derived. Reactivity audits + fixes: - VirtualList sizeCache → SvelteMap (dynamic heights were silently stuck). - Form touched + registry → SvelteMap (isTouched / isDirty / onBlur validation $derived never re-ran with plain Map). - Combobox labelRegistry → SvelteMap (removed clone-and-reassign workaround, O(N)→O(1) per registration). Other fixes this pass: - ColorField/ColorPicker RGB co-increment bug (HSV round-trip was lossy). - 24 state_referenced_locally warnings swept across date/time/color field+picker wrappers (removed `void X;` placeholders that Svelte 5 flagged, added svelte-ignore for intentional mount-time reads). - AlertDialog Content wrapper forces escapeKeydownBehavior=close (overrides Dialog's alertdialog→ignore default → matches WAI-ARIA). - Breadcrumb Ellipsis interactive prop renders <button aria-haspopup> so DropdownMenu composition works without manual trigger plumbing. - VirtualList Viewport drops `contain: strict` (was breaking programmatic scrollTo in some engines). - Memory entries: feedback_id_effect_assign_directly, feedback_scope_approval, feedback_svelte_reactivity_collections. Sium library (delegated session, landed in tree): - Core schema + primitives + combinators + pipe + refines + modifiers. - Langs module with idlangref resolver. - Svelte form adapter. - Protocol docs + status ledger for Codex coordination. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
16f706439e |
soma: tier 3 dates + tier 4 time (partial), dias/segments, docs
Tier 3 (complete):
DateField, DatePicker, DateRangeField, DateRangePicker
Tier 4 (partial):
TimeField, TimePicker (TimeRangeField pending)
Core:
$lib/util/dias/segments.ts — pure domain primitives for segmented
date/time inputs (constants, guards, initializers, reconciliation,
content generation, Intl opts)
soma/external/dates re-exports everything (no façades inside soma)
soma/datetime/ slimmed to UI-only helpers (announcer, DOM segment nav,
SegmentState, KEYS predicates, description writers)
Conventions established (A23–A29):
A23 — never re-implement date helpers; extend dias
A24 — readonlySegments without value anchor logs warning
A25 — range components split readonly per-endpoint
A26 — contenteditable segments use onbeforeinput to block IME/paste
A27 — picker composition pattern with shared writableActive refs
A28 — time placeholders render as hh/mm/ss via dias/segments
A29 — demo pages are interactive testbeds, not static galleries
Demo pages: Material Design 3 styled, every public prop wired to a live
control, Field integration + state readout. Day-period uses real radio
group in 12h mode. Auto-anchor on range pickers keeps the end month
visible. 12h sliders map 0↔12 / 13-23↔1-11 correctly.
Docs: COMPONENT_GUIDE.md + SOMA_ARCHITECTURE.md updated with A23–A29,
checklist items 28–31, picker composition section, dias boundary,
directory structure note for soma/datetime/.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
f07addf07b |
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar. Codex audit fixes (2026-04-17): - Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar - Toast Root → Item refactor (data-toast-item, resolves part collision) - TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry - Combobox label registry, Pagination count=0, Splitter feasible-range clamp - TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter - Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/ Switch/Toolbar; Slider thumbLabels per-index - NumberField startValue saneado, Table getIsSomeSelected filtra visibles - Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination First/Last snippet Supporting changes: - App layer + ling/logr/glob/util consolidation, tests updates - Terra/scripts mechanical reformat (quotes, imports) - Test pages updated to match new APIs Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
69a8e8d4b5 |
soma: dias date library, Calendar + RangeCalendar, Command fixes, doc updates
**Date library reorganisation** (no new third-party dependency)
- New `src/lib/util/dias/` with `_vendor/` (Adobe Apache 2.0 vendored code,
ATTRIBUTION.md preserved) and a public facade split into `types`,
`values`, `calendars`, `queries`, `operations`, `parse`, `format`,
`index`. Consumers import only from `$lib/util/dias`.
- All date-related `Intl` consolidated in `dias/format.ts` —
`DateFormatter`, cache, `resolveDateOrder`, `resolveHourCycle`,
placeholders, defaults.
- `ext/dates` now a thin reactive wrapper delegating to `dias`.
- Aligned App-layer `HourCycle` to canonical numeric form `12 | 24`
(matches `Intl.DateTimeFormat`'s `hour12`). Removed string form
`'12h' | '24h'` from `ext/app/types`, `ext/dates`,
`ext/presentation/locale-defaults`, and their tests.
- Repointed every consumer: `soma/external/dates`,
`terra/external/dates`, eight `routes/test/*` pages.
- Legacy `src/lib/util/dates/` left untouched by request.
**Tier 3 components**
- `soma/components/calendar/` — 14 parts, single + multiple selection,
`MonthSelect`/`YearSelect`, ISO/simple week numbers,
`isDateHoliday` matcher, `data-weekend` flag, navigation live-
region, RTL flip, full ARIA, 27-item checklist verified.
- `soma/components/range-calendar/` — 14 parts, range selection with
live hover preview (novel vs ark/bits/radix/react-aria), `minDays`
/ `maxDays` / `allowSingleDay`, third-click deselects only the
clicked endpoint.
- Test pages at `/test/soma/calendar` and `/test/soma/range-calendar`
with seven demos each. Links added to the soma index under a new
"Dates" section.
- READMEs with anatomy, parts, props, ARIA, keyboard, data-attrs, and
a competitive comparison table.
**Command fixes**
- Resolved O(N^2) reactive cascade: introduced
`visibleSet: $derived<Set<string>>` on the root provider;
per-item `isVisible` is now an O(1) `has()` lookup instead of
calling back into the provider, which was re-running all items'
derivations on every `itemsVersion` bump.
- Added `dir` prop with fallback to `soma.presentation.getDir()`;
horizontal arrows flip in RTL via `getDirectionalKeys`; root
receives `dir` attribute.
**Doc updates (session outcomes)**
- `CLAUDE.md`: replaced obsolete `@/glob/lib` date references with
`$lib/util/dias`; added canonical date-layer section; reinforced
`Provider` export rule and `data-{component}[-{part}]` naming
(never `data-soma-*`); clarified translation convention.
- `src/uix/soma/COMPONENT_GUIDE.md`: new checklist items 26
(component README required) and 27 (grep for data-attr
consistency); new Common Mistakes 11 (`data-soma-*` prefix), 12
(wrong date module), 13 (string `HourCycle`).
- `src/uix/soma/SOMA_ARCHITECTURE.md`: clarified data-attr naming
(canonical emitter is `createAttrs`; validator checks enum
values only, not names); new section covering date types and
formatting through `$soma/external/dates` → `$lib/util/dias`;
documented numeric `HourCycle`.
**Infrastructure**
- `PrimitiveHeaderAttributes` and `PrimitiveSelectAttributes` added
to `$soma/types`.
- `getLastFirstDayOfWeek`, `getNextLastDayOfWeek` re-exported from
`$soma/external/dates`.
- `calendar.*` and `range-calendar.*` translation blocks added to
`$soma/core/langs.ts`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
ca768f068a |
docs: update planned components with all 6 tiers (color + sound added)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
a8498770f0 |
docs: add rationale for reactive layer in README §5
Explains why soma wraps Svelte runes instead of using them directly: compiler magic limitation, cross-class composition need, migration path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
a1f03b4626 |
docs: update SOMA_ARCHITECTURE, README, COMPONENT_GUIDE for current state
SOMA_ARCHITECTURE.md: - §3.4: Soma.getOr() → Soma.get(), removed Soma.translate() - §3.6: translations via langs.ts() with idlangref, not Soma.translate() - §6: added Gesture.base/drag/resize + SafePolygon to layers table - §7: updated service access examples to use idlangref - §7: rewritten Texto funcional section with langs.ts pattern - §9: added data-dragging, data-highlighted, data-resizing, --drawer-* vars - §13: added core/langs.ts, langs.ts in component structure - §17: checklist synced with COMPONENT_GUIDE (10 steps) COMPONENT_GUIDE.md: - A15: exception for pure drag handles (immediate capture) - A16: added focus return note for non-modal - A17: virtual focus vs DOM focus strategy - A18: registry pattern over DOM queries - A19: SafePolygon for hover-gap components - A20: exit animation via Presence (dismiss flow) - A21: contract case normalization - A22: Dismissal isValidEvent for complex widgets README.md: - SafePolygon added to layers table - Patterns section: registry, virtual focus, exit animation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
bc9b8246fc |
soma: resolve all remaining audit issues
- Stepper H3: trigger registry pattern replaces DOM queries for keyboard nav - Table H3: sub-row IDs use getRowId() (identity-based, not positional) - Tags-input H2: combobox ARIA pattern (role=combobox + listbox + option) - Tags-input H3: handlePaste concatenates with existing input text - Toast H2: Presence layer for exit animation, dismiss→dismissing→remove flow - Switch HIGH-1: contracts.ts normalizes case in register/assert - Select C1: pure aria-activedescendant (no mixed DOM focus) - Select H1: value-to-label Map registry (no DOM queries) - Tooltip H1: SafePolygon for hoverable tooltips - Toolbar HIGH-1/2: element-based focus tracking (no index, no O(N²)) - Scroll-area H3: mount flash prevention - Splitter H1/H2: collapse/expand respects adjacent constraints - Pagination H1: reactive page clamping like Ark-UI - Popover H1: aria-labelledby already present (verified) - Splitter: immediate pointer capture restored (moveBuffer breaks thin handles) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
015d5e258d |
soma: gesture layer, drawer component, full audit fixes across 26 components
Gesture Layer:
- Gesture.base(), Gesture.drag(), Gesture.resize() — shared pointer tracking
- VelocityTracker with ring buffer, staleness check, projection
- 52 tests (velocity + gesture integration)
- setPointerCapture deferred until moveBuffer exceeded (prevents click stealing)
Drawer Component:
- 8 parts: Provider, Trigger, Content, Overlay, Handle, Title, Description, Close
- Gesture.drag() integration for swipe dismiss
- Snap points (fractional + px), fadeFromIndex, handle tap-to-cycle
- Modal/non-modal/non-dismissible modes
- Logical directions (start/end) RTL-aware via soma presentation
- CSS custom properties (--drawer-progress, --drawer-offset-x/y)
Architecture:
- T1: 219 files migrated from $soma/ alias to relative paths
- T2: 35 wrappers — noop replaced with () => {} inline
- Translation system: componentLangs + common.buttons.* + idlangref constants
- COMPONENT_GUIDE.md + README.md fully updated to reflect current patterns
- contracts.ts: case-normalized registerContract/assertContract
Audit Fixes (P0 critical):
- DI1/PO1/TO1: 'provider' → 'root' in parts/contract/super
- TB1: data-table attr on wrapper
- CH1/SW1/NF4: hidden input rendering fixes
- SP2: panel cleanup on unmount
- RG1: roving tabindex fallback to first item
- CO1: aria-labelledby on collapsible content
Audit Fixes (P1 high):
- SafePolygon integrated in dropdown-menu SubProvider + tooltip
- 9 langs.ts files with idlangref constants
- Dialog: aria-label removed (WCAG 2.5.3), handleOpen/Close guards
- Stepper: count decrement + private, aria-label on List
- ToggleGroup: roving tabindex in multiple mode
- Select: pure aria-activedescendant (no mixed focus), label registry
- NumberField: startValue respects min, scrubber commit on pointerup only
- Toolbar: element-based focus tracking (not index)
Audit Fixes (P2 medium):
- A6: timer/listener cleanup in 6 components
- A12: getDirectionalKeys in 4 components
- A10: DOM queries scoped to root in 3 components
- Dropdown-menu: typeahead + Home/End in SubContent, activate() pattern
- Checkbox: PrimitiveLabelAttributes, getAriaChecked helper, stale value cleanup
- Pagination: reactive page clamping, Set-based computePageRange
- Scroll-area: thumbSize zero-guard, mount flash prevention
- Splitter: collapse/expand respects adjacent constraints, immediate pointer capture
5 issues remain (design decisions): stepper registry, table sub-row IDs,
tags-input ARIA model, tags-input paste, toast exit animation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
a1d0bee655 |
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation) - Add createSvelteLang() with reactivity for locale and schema changes - Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t() - Add reactive dir resolution in all component wrappers - Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.) - Fix slider RTL: range, thumb, tick use right/left based on dir - Add table structural parts: Header, Body, Footer wrappers - Implement ColumnPinning, ColumnSizing, Expanded in table-core - Remove soma core formatters, translator.svelte, prop-resolvers (moved to App) - Remove duplicate convenience getters (locale, dir, translate) from App/Soma - Audit all 26 soma components, create audit docs with 84 issues found - Update test page with pinning, sizing, expandable rows demos |
6 months ago |
|
|
8a88ad577a |
soma: audit fixes — 84 issues across 25 components, Table complete
Table component: - Complete state manager: sorting, filtering, pagination, selection, column pinning (sticky), column sizing, expandable rows (sub-rows + detail panels), column visibility - Provider renders <table> with translated aria-label - Sorting opt-in per column, consumer places sort buttons - filteredRowCount/totalRowCount for correct pagination count - Sub-row IDs hierarchical (parentId.subIndex), no collisions - Production-grade test page (Swiss Industrial design) - Full README with all features documented Critical fixes (10): - Toast: memory leaks (timer + hotkey listener cleanup via $effect) - Toast: restartTimer() method for promise-based toasts - ScrollArea: type='always' now works (check order fix) - ScrollArea: thumb click no longer triggers track jump - Tooltip: no crash without <Tooltip.Group> (ctx.getOr) - Combobox: click-outside-to-close fixed (isValidEvent) - Popover: stray 'n' character removed from popover.svelte - TreeView: ARIA ownership fixed (role=treeitem on Branch, not Control) - Splitter: documented required array spread for reactivity High fixes (14): - Checkbox: group disabled/name propagation + checked sync via $effect - Select: aria-labelledby on content, aria-disabled on items - Stepper: aria-controls + aria-labelledby cross-linking - TagsInput: highlightPrev returns to input, role on Control/Item - Editable: Preview role=button + aria-label - Pagination: translated aria-label on items - RadioGroup: removed unused Soma import Medium fixes (60): - registerContract() added to all 25 components - Dead config=getSoma() removed from 7 providers - Dead imports removed (Tooltip, Popover, Slider, Combobox) - Dialog: aria-modal conditional on modal prop - Slider: pointer capture release + onpointercancel - Popover: hover timeout cleanup, aria-modal support - Tabs: inactive content hidden + aria-hidden + tabindex=-1 - ToggleGroup: aria-orientation + roving tabindex fallback - Toolbar: data-disabled on Button - Stepper: Content tabindex - TreeView: RTL keyboard support (expand/collapse key swap) - NumberField: Enter key commit, clampOnBlur, allowMouseWheel, scrubber a11y - Toast: data-state on root, aria-live on viewport - ScrollArea: scrollbar aria-label + tabindex - Collapsible: part root (not provider), aria-controls, role=region - Tooltip: removed dead provider part from attrs Architecture: - COMPONENT_GUIDE.md: 14 audit-derived rules (A1-A14) - Checklist expanded from 15 to 23 steps - 8 new HTML primitive types (Table, THead, TBody, TFoot, TR, TH, TD, Caption) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
1fd0b46b2e |
soma: refactor providers to follow terra patterns, fix translations, add table/number-field
- Rename root→provider in all 25 component providers (terra convention) - Fix translations: use translatePath (ling.t) instead of translate (ling.ts) for dot-path resolution with soma. prefix - Move onChange callbacks from provider Opts to writableActive setters in svelte wrappers (terra pattern, reduces prop duplication) - Add shared test layout with ling translator for all soma test pages - Add Table component with sorting, selection, pagination, filtering, column visibility, ARIA grid pattern - Add NumberField component with glob numr integration - Fix table headers reactivity (missing getter) - Fix table column filters (was passing row instead of cellValue) - Add AUDIT.md with F1-F15 findings (11 fixed, 4 pending) - Revert accidental terra modifications Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
dad3d26139 |
soma: add TagsInput component (23 total)
TagsInput with 7 parts: Provider, Control, Input, Item, ItemText, ItemDeleteTrigger, ClearTrigger. Keyboard nav between tags (arrows, Home/End, Backspace/Delete), paste split by delimiter, max tags, custom validation, blur behavior, allow duplicates, data-highlighted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
c26e26f7c1 |
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10): - Tabs: roving tabindex, automatic/manual activation, onFocusChange - ToggleGroup: single/multiple, roving tabindex, deselectable - Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise() - ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking - Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle - Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger - TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings - Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility - Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator - Editable: inline edit, activation/submit modes, draft tracking, auto-resize Documentation: - README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage - Comparison tables vs ark-ui, bits-ui, radix-ui for every component Infrastructure: - Added PrimitiveAnchorAttributes to $soma/types/html.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
94c499db96 |
soma: 12 components, architecture docs, naming fixes, form tier complete
Components (12):
- Accordion (keyboard nav, single/multiple, collapsible, loop)
- Checkbox (indeterminate, group, readonly)
- Collapsible
- Combobox (input + floating listbox, consumer-side filtering)
- Dialog (variant dialog/alertdialog, modal, nested, animations, forceMount)
- DropdownMenu (15 parts, submenus, typeahead, checkbox/radio items)
- Popover (floating, openOnHover, modal, custom anchor)
- RadioGroup (roving tabindex, orientation, readonly)
- Select (single/multiple, typeahead, scroll-into-view, hidden select)
- Slider (drag, keyboard, single/range, ticks, vertical)
- Switch (hidden input, data-checked)
- Tooltip (skip-delay group, 3-state, hover/focus)
Architecture:
- State class files renamed: {name}.svelte.ts → {name}-provider.svelte.ts
(avoids Vite module resolution ambiguity with .svelte wrappers)
- Export name standardized: always Provider, never Root
- COMPONENT_GUIDE.md: step-by-step implementation guide with checklist
- SOMA_ARCHITECTURE.md: updated structure, anti-patterns, improvements table
- README.md: updated naming, file structure, inventory
- context.ts: error message uses Provider not Root
- Demo index page at /test/soma/
Bug fixes:
- DropdownMenu trigger missing onclick/onkeydown in props
- DropdownMenu interactOutsideBehavior always 'close' (not modal-dependent)
- Checkbox getContext in event handler → captured in constructor
- Select context not found → was Vite cache issue (not naming)
- ScrollLock unlock path
- Floating wrapper z-index: auto override
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
98e3c741a1 |
Add Tooltip component, export Side/Align/Boundary from $soma/types
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
bb0cdeb554 |
Add Accordion component (5 parts, keyboard nav, single/multiple, animations)
Parts: Root, Item, Header, Trigger, Content - Single/multiple mode via type prop - Collapsible (single mode: click open item to close) - Per-item and global disabled - Keyboard: Arrow keys (orientation-aware), Home/End, loop option - Presence on Content with data-starting/ending-style - --soma-accordion-content-height/width CSS vars for animations - forceMount on Content - Header with level prop (aria-level) - Auto-generated item values when omitted - Demo page with 5 sections Compared with Radix, Ark UI, Bits UI: - Has collapsible + loop (Radix has collapsible, Bits has loop, soma has both) - Has header level (like Bits) - Has CSS animation vars (like all three) - Has data-starting/ending-style (like Bits) - Skipped ItemIndicator (Ark) — presentation concern for visual layer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
193bfcdca2 |
Fix modal popover pointer-events blocked by ScrollLock
Popover Content floating wrapper now includes pointer-events: auto when preventScroll is active (same fix as Dialog). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
9cb5bf8dce |
Move soma.svelte.ts to core/ directory
Soma class is the framework's identity — belongs in core/, not loose in root alongside README and architecture docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
1655871619 |
Add soma external/dates boundary + adapter for glob DatiInstance
external/dates/index.ts: - Formal boundary with $lib/util/dates (same pattern as terra) - Reexports types (DateValue, DateOrder, HourCycle, Granularity, etc.) - Reexports core classes (CalendarDate, CalendarDateTime, Time, etc.) - Reexports operations (parse, query, conversion, format) external/dates/adapter.ts: - Bridges DatiInstance (from @/glob/lib) to SomaDateFormat contract - createSomaDateFormat(dati) → SomaDateFormat - Only file in soma that knows about DatiInstance types/services.ts: - SomaDateFormat now uses concrete DateOrder and HourCycle types - Exported via $soma/types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
b0d5407478 |
Add SOMA_ARCHITECTURE.md — architectural reference for soma framework
Equivalent to TERRA_ARCHITECTURE.md. Documents: - 3-layer architecture (soma → visual layer → app) - Design principles (layers as behaviors, Soma class, Provider pattern) - data-* contracts and CSS variable conventions - Animation system lifecycle (Presence, data-starting/ending-style) - Anti-patterns and stability rules - Improvements over terra (comparison table) - Component checklist (including reference library comparison) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
b6d9f51c47 |
Add Popover component, Dialog variant/restoreScrollDelay, fix floating z-index
Popover (7 parts): - Provider, Trigger, Content, Arrow, Close, Anchor, Overlay - Floating positioning via FloatingProvider/Content/Anchor integration - openOnHover with configurable openDelay/closeDelay on Trigger - Modal mode: overlay + focus trap + preventScroll - Custom anchor support - All behavior layers integrated (Presence, FocusScope, Dismissal, ScrollLock, TextSelection) - Demo page with 6 sections Dialog improvements: - variant prop: 'dialog' | 'alertdialog' (changes role, escape/outside behavior) - restoreScrollDelay prop on Content (passed to ScrollLock) - escapeKeydownBehavior defaults from variant (alertdialog → 'ignore') - Demo page updated with AlertDialog and restoreScrollDelay sections Fix: FloatingContent wrapper no longer sets z-index: auto inline (was overriding CSS z-index, causing content to render below overlay) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
7b65026982 |
Refactor soma: consolidate layers, add Soma class, Dialog component, animation system
Layers:
- Consolidate 28 files/10 dirs → 13 files/2 dirs
- Separate behavior layers (classes) from internal components
- Normalize naming: Dismissal, ScrollLock, TextSelection, FocusScope
- Adapt floating layer from terra to soma (imports, CSS vars --soma--)
- Presence rewritten: data-starting/ending-style, forceMount, onComplete, getAnimations API
Architecture:
- Replace config/ with Soma class (root instance with services)
- Add SomaFormat namespace (date, number, currency, unit formatters)
- Add generic resolve() for prop → config → fallback chain
- Provider supports optional ref (ProviderOpts vs WithRefOpts)
- Hierarchical component barrel: import { Dialog } from '$soma/components'
- Descriptive IDs: soma-dialog-trigger-c12
Dialog component (7 parts):
- Provider, Trigger, Content, Overlay, Title, Description, Close
- Content integrates all behavior layers as classes (no template nesting)
- modal prop controls interactOutsideBehavior automatically
- Nested dialog support: depth, data-nested, --soma-dialog-depth CSS vars
- Animation support: forceMount, data-starting/ending-style, onOpenChangeComplete
- Translator integration for aria-labels
- JSDoc documentation on all props
Bug fixes:
- Presence mount without ref (chicken-and-egg)
- ScrollLock unlock path restores body style
- Nested dialog infinite loop (untrack mutation)
- pointer-events: none blocking dialog interaction
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
6 months ago |
|
|
574f9165ad |
Add soma foundation + air components (Pagination, Editable, PinInput, RatingGroup, Stepper, FileUpload)
soma — new headless component system replacing terra: - Provider base class with opt-in context injection - Reactive system (state, readableActive, writableActive) - Attrs system (createAttrs, contracts, helpers) - Props system (mergeProps with on-prefix detection, no hardcoded event list) - DOM utils (consolidated core, focus/, env) - Keyboard, events, CSS, ID, config modules - Layers: scroll, observers, visually-hidden, arrow, portal, text-selection, dismissal (merged escape+dismissible), presence, focus-scope - Collapsible component as first soma validation air components: - Pagination, Editable, PinInput (air-native), RatingGroup (air-native), Stepper, FileUpload wrappers over terra - Terra defaultContent refactor for children snippet pattern - Avatar, Meter, Progress, Separator migrated to air-native - Reactive utilities extracted to $lib/util/reactive (shared) - $soma and $reactive aliases added Architecture: - soma is independent: no imports from terra or $lib/util/reactive - Terra exports deprecated for migrated components - README fundacional documenting all design decisions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
265fc9afc6 |
Add AlertDialog, DropdownMenu, ContextMenu air components; fix terra menu concurrent open
Components: - AlertDialog: Provider, Content (context transition), Action, Cancel + demo - DropdownMenu: Provider (revelation sound), Content (floating), Item, Separator, GroupHeading + checkbox/radio indicators via CSS pseudo-elements + demo - ContextMenu: Provider, Content sharing dropdown-menu visual language + demo Terra fix — menu variant registry: - Add menuRegistryByVariant in menu.svelte.ts to track open menus per variant - MenuMenuState.onOpen() closes all other menus of same variant before opening - Prevents concurrent context-menus (or dropdown-menus) from being open simultaneously - Registry lives in terra infrastructure, not air — clean architectural boundary - Cleanup via onDestroyEffect when component unmounts CSS fixes: - DropdownMenu content: z-index: 50 for proper stacking - Checkbox/radio items: visual indicators via ::before pseudo-elements - Selectors duplicated for both dropdown-menu and context-menu data-attr prefixes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
42c3055bf4 |
Semantic motion+sound engine: activate presets, enrich animations, activate dormant semantics, add drawer modal prop
Phase 1 — Activate advanced motion presets as defaults: - softReveal → revelation (origin-aware translate + scale + fade) - springContext → context (elastic spring for dialog, slide for drawer sides) - smoothExpansion → expansion (clip-path bottom-up + opacity) - Runtime now always merges DEFAULT_MOTION_PRESETS as base fallback Phase 2 — Activate 4 dormant semantics in components: - attention → Field (sound on state transition to 'error') - destruction → TagsInput (sound on tag removal instead of selection.exit) - emphasis → Badge (new `pulse` prop: CSS animation class + sound on activate) - completion → Progress (sound when percentage reaches 100%) Phase 3 — Enrich motion transitions and keyframes: - springContext: side-aware (elastic scale for center, translate for edges) - softReveal: origin-aware (micro-translate from trigger direction) - attention keyframe: exponential decay shake (natural spring damping) - emphasis keyframe: organic breath pattern (asymmetric, not sine pulse) - selection keyframe: 4-step spring (1→1.15→0.95→1.04→1) - navigation keyframe: new translateY + opacity (replaces generic scale) - notification keyframe: bounce with translateY + scale overshoot + settle - completion keyframe: added micro-rotation (1.5°) for "done" feel Drawer non-modal support: - Add `modal` prop to DialogProviderState (terra) with conditional aria-modal - Drawer exposes `modal` prop (default true), passes to dialog state - Non-modal drawer: no overlay, no focus trap, no scroll lock - Demo section showing non-modal panel usage Documentation: - Create AIR_MOTION_SOUND_SYSTEM.md — semantic motor design document - Includes psychology table for all 12 semantics (motion + sound + cognitive reasoning) - Fix demo pages to use numeric gap props and Layout component alignment Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
cb3fa2a3c7 |
Add air components (toggle-group, toolbar, avatar, meter, collapsible), fix CSS audit issues, fix combobox scroll, rebuild documentation
Components: - Add ToggleGroup air wrapper (surface/outline/ghost variants, 6 colors, sound) - Add Toolbar air wrapper (Provider, Group, GroupItem, Button, Link + semantics) - Add Avatar air wrapper (6 sizes, solid/soft/outline, 6 colors, 4 radii) - Add Meter air wrapper (3 sizes, 6 colors, animated fill bar) - Add Collapsible air wrapper (trigger, animated content, expansion semantics) CSS audit fixes: - Rename 65 public resolver vars to private (--_air-*) in checkbox, switch - Fix button radius privatization and warning solid-fg - Fix slider circular reference in default tokens - Add disabled-opacity tokens to button, toggle, tabs, toggle-group - Tokenize combobox chip styles (12 direct semantic refs → component tokens) - Fix tabs stack-gap public override → private resolver Bug fix: - Fix combobox scroll-on-open: replace scrollIntoView() with viewport-scoped scroll in select.svelte.ts to prevent page scroll when opening dropdown Documentation rebuild (19 → 9 normative + 5 archived): - Consolidate 15 air docs into 6 (README, ARCHITECTURE, TOKENS, VISUAL_LANGUAGE, SEMANTICS, IMPLEMENTATION_GUIDE) - Archive 5 historical docs to _archive/ - Fix config/ → system/ references across terra and air docs - Update component inventory (13 → 30 components) - Fix font documentation (add Lora serif, update 12-step scale) - Absorb SVELTE5_BINDABLE_PATTERN into terra README - Update air hub page with all new component entries Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
6 months ago |
|
|
b31bc2f055 |
.
|
6 months ago |
|
|
6748851a88 |
Add remaining air components, semantics, motion, and layout system
- Add Accordion and Checkbox air components with tokens and contracts - Add full Layout system: Box, Flex, Grid, Group, Stack, HStack, VStack, Wrap, AutoGrid, AspectRatio, Container, Section, Separator, ScrollArea, Splitter, Float - Add audio semantics facade: attention, completion, emphasis, feedback, persistence, selection - Add motion semantics system - Add dom, interaction, lib, runtime, resources directories - Add component tokens and contracts for all new layout components - Add icon CSS, audio barrel exports, tokens/motion.css - Update test pages: accordion, animations, checkbox, layout - Update existing components: button, dialog, drawer, field, input, select, switch, tabs, toast, spinner, typography - Update base/earth themes (static tokens, motion, sound) - Remove deprecated internal/context.ts, internal/style.ts, earth/motion.ts - Update terra accordion and scroll-area exports Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
6 months ago |
|
|
bb18edc6fe |
Audit and refactor air/terra system: fix layer 3 violations, rename config→system, add missing motion classes
- Fix typography components bypassing layer 3: heading, text, display, code, code-block, kbd, text-virtual-list now read font-family/font-weight from component tokens instead of directly from layer 2 semantics - Add 5 missing stateClass CSS implementations: air-motion-selection, air-motion-navigation, air-motion-notification, air-motion-completion, air-motion-destruction - Fix persistenceNode race condition in sound engine with ref-counting (multiple Spinners no longer silently fail) - Remove Promise<void> lie from playSemantic() return type - Export getAir() from air/index.ts barrel - Delete deprecated tokens/contract.css - Rename config/ -> system/ in both air and terra for semantic accuracy (~70 files updated) - Rewrite AIR_CONTINUITY.md and update AIR_ARCHITECTURE.md with accurate component inventory Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
6 months ago |
|
|
5eda0c6aef |
Expand air component system and translator integration
|
6 months ago |
|
|
b30092dd06 |
Refactor air architecture: clean dependency boundaries, enrich Behavior/Dom, fix AudioContext
- getAir() is now the single entry point — returns behavior, dom, translator, logger - behavior.play() encapsulates soundEnabled check + preset resolution - dom.resolve() resolves ResponsiveProp using current viewport/breakpoints - internal/ has no knowledge of config/ (correct dependency direction) - internal/ types stripped of Air prefix; public barrel re-exports with prefix - context.ts defines TranslatorService locally (structurally compatible with TerraTranslator) - button/text components updated to use only getAir(), no direct terra/config imports - AudioContext fix: withRunningContext() resumes on first user gesture before playing - AIR_IMPLEMENTATION_GUIDE updated: 12 semantics, correct APIs, current patterns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
6 months ago |
|
|
9a9c4d4f14 |
Add air sound/motion/behavior systems, refactor responsive, update terra config and tokens
|
6 months ago |