W2 of the oak task list. A pure menu model (nesting, disabled items,
separators, checked state, wrap-around keyboard navigation arithmetic) feeds
two views: a MenuBar with drop-down popups and a right-click ContextMenu,
both built on anchored+deferred with keyboard navigation (up/down/enter/
escape), hover-opened submenus, check marks, shortcut labels and request
events. The Modal framework provides the mask, title bar, content slot and
button row with escape/enter defaults; message_box (info/warning/error),
progress_dialog (driven by ProgressContent) and file_dialog (native gpui
fallback - the fork has no prompt_for_paths platform API) are built on it.
A menus_dialogs example demonstrates everything. 79 tests pass.
Adds a parameter-panel example (cargo run -p gpui_widgets --example controls)
that demonstrates every form control: float/rational/angle sliders with
keying diamonds, a spinbox, a combo box, checkboxes, a radio group, a color
picker and a curve editor, printing each edit as a request event. Marks all
W1 checklist items done in docs/zh/oak-app-rewrite.md. 65 tests pass.
CurveEditor edits a normalized x->y keyframe curve: cubic bezier segments
with per-point in/out control handles. Points are dragged with x clamped to
keep the list sorted; handles drag as offsets; double-click inserts a new
point at the cursor. Every gesture emits CurveEditorEvent requests while the
widget keeps a local working copy for fluid dragging. Pure geometry
(bezier evaluation, sampling via binary search, polyline approximation, hit
tests) is unit-tested; interaction tests cover point dragging and adding.
65 tests pass.
ColorPicker is a swatch button that opens a popup picker built from
anchored+deferred: an SV square (layered linear gradients over the hue) and
a 48-segment hue strip, both click- and drag-editable, plus RGBA spinboxes
reusing the SpinBox control. Pure HsvColor math (hue wrapping, saturation/
value extremes, u8 conversion) is unit-tested; an interaction test verifies
clicking the SV square emits ColorChanged. The eyedropper is a placeholder.
55 tests pass.
ComboBox renders a field showing the selection and a drop-down menu built
entirely with gpui's anchored + deferred elements (no platform primitives).
Menu dismissal is mouse-up-out based so an option click is never swallowed
by a capture-phase close that would redraw the menu away; the field toggles
from the open state recorded at mouse-down. Arrow keys cycle the selection
with wrap-around, escape closes. 48 tests pass.
Completes the basic form controls of W1: a SpinBox reusing SliderModel for
range/step/clamping with an editable_text field (enter/blur commits,
escape reverts, invalid input rejected) and up/down buttons; a CheckBox with
optional tri-state and request-only Toggled events; a RadioGroup that emits
Selected requests. All three follow the request-only contract: the host
applies changes and updates the widget's display state. 45 tests pass.
Implements W1's slider: a pure SliderModel state machine (float, integer,
rational and angle kinds with clamping, step snapping, fine adjustment and
drag math) plus the Slider view with vertical-drag scrubbing (shift for
fine), double-click direct entry backed by editable_text (enter commits,
escape cancels, click-away commits, invalid text rejected), wheel stepping,
middle-click reset and arrow-key navigation. Every edit is emitted as a
SliderEvent request; keyable controls expose a Keying diamond. 37 unit and
interaction tests pass.
New workspace crate implementing W1 of the oak task list. This first
slice lands the pure numeric core (ValueKind / SliderValue /
RationalValue / ValueFormatter with round-trip tests) and the keying
diamond button (KeyingState / KeyingRequest) that keyable controls
embed. 12 unit tests pass.
* Add text spacing and transform style plumbing
* Apply byte-stable transforms and spacing-aware truncation
* Add platform letter spacing support
* Fix scheduler clippy warning
* Refresh dependency lockfile
* Fix CI for text spacing changes
* Add text transform preview example
* temportalflux/elements-input: (117 commits)
remove legacy input example now that gpui_elements::editable_text exists
remove stop_propagation on_mouse_up to avoid unintended consequence of input always highlighting/selecting while mousing over
add gpui_elements root documentation so its not weird that the docs page is empty
add an extremely basic example for editable_text which only shows a subset of what is documented in the module
fix caret getting stuck as visible without focus when the text field pauses blinking while it is without focus
stop propagation of mouse events when clicking on editable text, so that users which consume click events on wrapping elements do not receive events when they are used to focus/update the editable text state
add simpler api for configuring the caret blink interval via element
add external api for access to caret by routing it through keyed element data
fixup typos
refactor text position queries by factoring out common logic
first pass at simplifying text position queries
rework caret implementaiton to increase clarity and reduce code duplication
reorganize element implementation to be more readable
assign default editable text colors as consts
reduce complexity of mouse click handler and cut/copy handlers
reduce bounds_for_range to be more readable
remove EditableTextState::storage() in favor of direct access to the member
resolve clippy errors from using Range in reverse. Add CaretSelection to represent a bidirectional inclusive range
collapse styling of conditions
reorganize blocks in editable text element
...