color_picker: add ColorPickerState::set_open and is_open (#2645)
## Summary `ColorPickerState.open` is private with no setter, so a picker can only be opened by clicking its own trigger button. Callers that want to drive it from elsewhere have no supported way to do so. My use case: a terminal theme editor that renders a preview of coloured output and lets you click any run of text to edit the colour that painted it. The click knows which palette slot it needs, but cannot open that slot's picker. The workaround is to select the slot and make the user click the swatch a second time. ## Changes Adds `set_open`/`is_open` to `ColorPickerState`, alongside the existing `set_value`/`value` pair: ```rust picker.update(cx, |state, cx| state.set_open(true, cx)); ``` `set_open` returns early when the state is unchanged, so it will not spuriously notify. 17 lines added, no existing behaviour changed, no public API removed or altered. ## Testing Typechecked against a real consumer rather than in isolation: pinned my application to this branch and built it, exercising both `set_open(true)` and `set_open(false)` from mouse handlers. I could not get `cargo check` to run on this repo standalone — `pathfinder_simd` fails with `cannot find function simd_fmin` on my toolchain (Rust nightly 1.97, macOS aarch64), which reproduces on an unmodified checkout and so looks unrelated to this change. ## AI disclosure Per CLAUDE.md's request to mark AI-generated portions: this patch was written with Claude Code. The diff is small and I have reviewed it.
C
cdbkk committed
e9df1921bb209fe2dceaa47234b2a2bf9a8cb1f8
Parent: 88a854c
Committed by GitHub <noreply@github.com>
on 8/4/2026, 5:45:10 AM