Skip to content

feat(studio): schema-driven inspector — full CSS surface + component root properties#71

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-schema-inspector
Jul 19, 2026
Merged

feat(studio): schema-driven inspector — full CSS surface + component root properties#71
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-schema-inspector

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #70.

Goal: the inspector exposes all valid CSS properties for a component type, and built-ins expose their own modifiable root fields — schema-driven, no hand-maintained list to drift.

  • Registry from schema_for!(Component) (same source as validate's did-you-mean): per-tag root fields with typed kinds — counter exposes from/to/decimals/separator/prefix/suffix + an easing select with the schema's exact variants. Documented exclusions (type/style/children/wrapper fields/animation/timeline/structured data arrays).
  • Bucketing by construction: known CSS properties hand-mapped to 8 sections; anything unmapped auto-lands in Advanced — an exhaustive test proves every CssStyle schema property appears in exactly one section, so a future property can never be missing from the inspector.
  • Generic control factory (existing UI kit): number slider+input with per-name ranges, bool switch, enum select, color picker, unit input for Length/Size unions, folded JSON textarea with parse-gated writes for complex values. Curated controls stay; dedup guarantees no property appears twice. Families: text-likes get Typography, containers get Layout.
  • Typed writes end-to-end: set_field_value/set_style_value (JSON Null removes the key); HTML sources get rustmotion_html::set_attribute (empty removes, preserves anim/style) + remove_inline_style, loader re-exports; everything rides the existing debounced write path — undo, Saving indicator and write_error work unchanged.
  • Documented v1 limits: enums have no "unset" option; cubic_bezier easing arm only reachable via source; complex root fields on HTML sources stay JSON-strings in attributes.

Tests: 18 new (11 registry/bucketing red-first incl. the exhaustive completeness invariant, 3 typed-edit, 4 HTML attribute round-trips incl. transpile retyping). 375 total, all green.

Verify: cargo check -p rustmotion-studio ✓ · cargo test --workspace → 375 passed ✓ · cargo fmt --check ✓ · clippy gated ≤1 ✓

…properties

The inspector's property list is now derived from the schemars JSON
Schema of the 51 components (the same source as validate's
did-you-mean) instead of a hand-curated subset:

- per-tag registry of root fields with typed kinds (number, bool,
  string, enum with exact schema variants, color heuristic, unit for
  Length/Size unions, complex) and a documented exclusion list; a
  counter now exposes from/to/decimals/separator/prefix/suffix and an
  easing select
- CSS properties bucketed into sections by construction: hand-mapped
  knowns (Typography/Layout/Sizing/Spacing/Position/Visual/Effects/
  Overflow), everything else auto-lands in Advanced — an exhaustive
  test proves every CssStyle schema property appears in exactly one
  section, so future properties cannot be missed
- generic control factory (slider+input, switch, select, color
  picker, unit input, folded JSON textarea with parse-gated writes)
  complements the curated controls without duplication; family
  visibility: text-likes get Typography, containers get Layout
- typed write path: set_field_value/set_style_value (Null removes the
  key); HTML sources get rustmotion_html::set_attribute (empty value
  removes; preserves anim/style) and remove_inline_style, re-exported
  by the loader; all writes flow through the existing debounced path
  so undo, saving state and write_error come free
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(studio): schema-driven inspector — full CSS surface + component root properties

1 participant