Skip to content

feat(studio): structured object editors + robust popover viewport clamping#79

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

feat(studio): structured object editors + robust popover viewport clamping#79
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-round5

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #78 — user iteration round 5.

  1. Popover geometry, third time's a proof: positioning is now a pure tested function — below-the-anchor leftward by preference, flip above when the bottom clips, then a hard both-axes clamp where the margin wins last (top-edge clipping, the reported bug, is now impossible by construction; 4 geometry tests incl. tiny-viewport pinning). Applied as position:fixed from measured anchor + content + logical viewport, escaping every panel scroll container; a one-frame hidden state avoids mis-positioned flashes.
  2. No more raw JSON objects: Complex fields with known schema properties unfold into indented sub-rows through the same control factory (GenericRow gains a custom_commit callback so typed sub-values flow into the parent object) — stat.trend = value input + direction select (schema variants) + color picker. Pure sub-key mutation (null prunes; emptied object removes the field), whole-object typed writes riding the optimistic+debounce+undo pipeline, recursion capped at 2 (map-like objects keep the JSON fallback). Number arrays (sparkline_data, dashed) become per-entry number rows with add/remove.

Deliberate calls documented: ColorRows/NumberList factorization rejected (second occurrence, different shells); object sub-rows skip the default marker in v1 (the effective object already carries serde defaults); popover repositions per-open, not on window resize while open.

Tests: 9 new (4 popover geometry, 5 red-first registry/mutation incl. typed round-trip of a mutated stat). 406 total, all green.

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

- popover positioning becomes a pure tested function: prefer below the
  anchor opening leftward, flip above when clipping the bottom, then
  hard-clamp both axes to the viewport with the margin winning last —
  the top edge can no longer clip (the reported bug); applied as
  position:fixed from measured anchor/content/viewport so no panel
  scroll container can clip it, with a one-frame hidden state while
  measuring
- Complex object fields with known schema properties unfold into
  indented structured sub-rows through the same control factory
  (GenericRow gains a custom_commit callback: typed values flow to
  the parent object instead of the write path) — stat.trend becomes
  value input + direction select + color picker; sub-key mutations
  are pure (null prunes, emptied object removes the field) and the
  whole typed object rides the optimistic+debounced pipeline; depth
  capped at 2, map-like objects stay JSON areas
- number arrays (sparkline_data, dashed) become per-entry number
  rows with add/remove, writing the whole typed array; ColorRows/
  NumberList factorization deliberately rejected (second occurrence,
  shells differ — documented)
@LeadcodeDev
LeadcodeDev merged commit 46a17ab into main Jul 19, 2026
@LeadcodeDev
LeadcodeDev deleted the feat/studio-round5 branch July 19, 2026 12:31
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): structured object editors + robust popover viewport clamping

1 participant