Skip to content

feat(studio): adopt the official dioxus-primitives color picker#81

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-picker-floating-v2
Jul 19, 2026
Merged

feat(studio): adopt the official dioxus-primitives color picker#81
LeadcodeDev merged 1 commit into
mainfrom
feat/studio-picker-floating-v2

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

User decision: use the official color picker from dioxuslabs.com/components rather than a fourth in-house positioning implementation.

  • Faithful adoption of the upstream primitives (already our git dependency; the picker isn't feature-gated — default-features = false only drops router): controlled open, outside-click dismiss and global Escape from the library (restores what fix(studio): color picker expands inline — floating positioning removed #80 lost), continuous on_color_change during drags.
  • Our boundary, documented in the file header: --rm-* theme values, a single right:0 styling divergence (the inspector hugs the right edge), the feat(studio): optimistic in-memory edits (near-instant canvas) + inspector round 4 #77 live HSV mirror, and panel-wide one-picker exclusivity driving the primitive's controlled open (apply_open_change, pure + tested). Call sites unchanged.
  • Deleted: the whole fix(studio): color picker expands inline — floating positioning removed #80 inline mode, the abandoned floating-v2 stub, toggle_picker.
  • Trade-off verified and accepted: neither the pinned commit nor upstream HEAD implements viewport collision handling (checked primitives/src/popover.rs and the preview CSS at HEAD — static per-side positioning only). Vertical clipping near the window bottom remains possible; when upstream lands collision handling, a dependency bump inherits it. Contributing that fix upstream is the natural next step if it bites.

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

The color picker now faithfully wraps the upstream component from
DioxusLabs/components (already a git dependency; nothing feature-
gated): primitive Root/Trigger/Popover with the library's controlled
open, outside-dismiss and global-Escape — restoring the outside-click
dismiss lost in #80 — and continuous on_color_change during drags.
Our side keeps only: the --rm-* theme values, a one-line right:0
styling divergence (the inspector hugs the right edge), the #77 live
HSV mirror, and panel-wide exclusivity driving the primitive's
controlled open (pure apply_open_change, tested). All #80 inline-mode
code and the abandoned floating-v2 stub are deleted.

Documented trade-off: neither the pinned commit nor upstream HEAD
implements viewport collision handling (verified) — vertical clipping
near the window bottom remains possible until upstream adds it; a
dependency bump will inherit their fix when it lands.
@LeadcodeDev
LeadcodeDev merged commit 4834089 into main Jul 19, 2026
@LeadcodeDev
LeadcodeDev deleted the feat/studio-picker-floating-v2 branch July 19, 2026 12:56
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.

1 participant