feat(studio): schema-driven inspector — full CSS surface + component root properties#71
Merged
Merged
Conversation
…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
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
schema_for!(Component)(same source as validate's did-you-mean): per-tag root fields with typed kinds —counterexposesfrom/to/decimals/separator/prefix/suffix+ aneasingselect with the schema's exact variants. Documented exclusions (type/style/children/wrapper fields/animation/timeline/structured data arrays).CssStyleschema property appears in exactly one section, so a future property can never be missing from the inspector.set_field_value/set_style_value(JSONNullremoves the key); HTML sources getrustmotion_html::set_attribute(empty removes, preservesanim/style) +remove_inline_style, loader re-exports; everything rides the existing debounced write path — undo, Saving indicator and write_error work unchanged.cubic_beziereasing 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 ✓