Commit Graph
33651 Commits
Author SHA1 Message Date
Mike-Solar d72d2e8210 feat(gpui_widgets): add menu bar, context menu and modal dialog framework
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.
2026-08-09 05:33:29 +08:00
Mike-Solar 4a92ab13d8 feat(gpui_widgets): add controls demo example and mark W1 complete
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.
2026-08-09 05:24:10 +08:00
Mike-Solar b2ed7a66e4 feat(gpui_widgets): add curve editor with bezier handle dragging
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.
2026-08-09 05:22:30 +08:00
Mike-Solar 25b3167162 feat(gpui_widgets): add color swatch + HSV color picker popup
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.
2026-08-09 05:11:32 +08:00
Mike-Solar 23b1f610a2 feat(gpui_widgets): add combo box with anchored+deferred popup menu
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.
2026-08-09 05:02:04 +08:00
Mike-Solar b65ccf1417 feat(gpui_widgets): add spinbox, checkbox and radio group controls
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.
2026-08-09 04:54:31 +08:00
Mike-Solar 6e0b541660 feat(gpui_widgets): add slider family with drag/double-click/wheel/reset gestures
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.
2026-08-09 04:48:57 +08:00
Mike-Solar df7c3d274f feat(gpui_widgets): scaffold form-controls crate with value core and keying diamond
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.
2026-08-09 04:20:48 +08:00
Mike-Solar ad7c965c5a feat(gpui): add dock, effect stack, node graph, and timeline widgets
Implements four workspace widget modules with accompanying learn examples:

- dock: dockable panel layout system (tabs, splits, drag-to-dock) with
  serde-based persistence via PanelRegistry / DockLayoutState
- effect_stack: linear effect-stack inspector widget
- node_graph: node-graph editor (nodes, ports, wires, pan/zoom canvas)
- timeline: video-editing timeline (tracks, clips, ruler, playhead)

Timeline snapping prefers the earlier frame when two snap points are
equally close, with SnapKind priority breaking same-frame ties.
2026-08-09 03:31:06 +08:00
Max Carter 祁明思 6043651563 Add letter spacing and text transforms to GPUI (#111)
* 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
2026-08-07 21:48:02 -07:00
Brendon Felix 568271c01c feat(macos): support haptic feedback (#71)
* Support haptic feedback on macOS

* add tests for haptic feedback
2026-08-04 14:52:28 -07:00
Leonard Seibold 33ed975bf2 Add tooling for automatic upstream sync (#83) 2026-07-30 14:21:30 -07:00
443eb9#C c1faa21ced Fixed gpui_windows not compiling with wgpu feature (#90) 2026-07-27 23:17:27 -07:00
Dustin Yost 2542e1154a add App::emit such that events can be emitted without acquiring a Context (#94) 2026-07-27 23:16:59 -07:00
Dustin Yost 1fe82dbcd7 implement start_window_move on win32 platform (#102) 2026-07-27 23:05:44 -07:00
Miles Wirht 6c799b8e99 removed all of the git sources (#91) 2026-07-13 21:25:00 -04:00
𝑷𝒉𝒊𝒍𝒐𝒄𝒂𝒍𝒚𝒔𝒕 5484fbaf88 Merge PR #86: Add EditableText 'text_input' and 'text_area' elements
* 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
  ...
2026-07-12 19:43:14 -04:00
temportalflux 309d319880 remove legacy input example now that gpui_elements::editable_text exists 2026-07-12 17:44:06 -04:00
temportalflux cb26ad76dc remove stop_propagation on_mouse_up to avoid unintended consequence of input always highlighting/selecting while mousing over 2026-07-11 13:16:17 -04:00
temportalflux 7c0de7f924 add gpui_elements root documentation so its not weird that the docs page is empty 2026-07-11 13:00:54 -04:00
temportalflux 32cca07bb4 add an extremely basic example for editable_text which only shows a subset of what is documented in the module 2026-07-11 13:00:54 -04:00
temportalflux 5bfb5ef58b fix caret getting stuck as visible without focus when the text field pauses blinking while it is without focus 2026-07-11 09:31:07 -04:00
temportalflux 09be9ed98e 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 2026-07-11 09:31:07 -04:00
temportalflux d5b3191738 add simpler api for configuring the caret blink interval via element 2026-07-11 09:31:07 -04:00
temportalflux d6d35ab410 add external api for access to caret by routing it through keyed element data 2026-07-11 09:31:07 -04:00
temportalflux 8f99657171 fixup typos 2026-07-11 09:31:07 -04:00
temportalflux 25f922283a refactor text position queries by factoring out common logic 2026-07-11 09:31:07 -04:00
temportalflux 50b01e0532 first pass at simplifying text position queries 2026-07-11 09:31:07 -04:00
temportalflux 760a79c3ca rework caret implementaiton to increase clarity and reduce code duplication 2026-07-11 09:31:07 -04:00
temportalflux bd7bbdd0e6 reorganize element implementation to be more readable 2026-07-11 09:31:07 -04:00
temportalflux 151d2c32aa assign default editable text colors as consts 2026-07-11 09:31:07 -04:00
temportalflux 252683a830 reduce complexity of mouse click handler and cut/copy handlers 2026-07-11 09:31:07 -04:00
temportalflux db856ae57a reduce bounds_for_range to be more readable 2026-07-11 09:31:07 -04:00
temportalflux 3a7d11a808 remove EditableTextState::storage() in favor of direct access to the member 2026-07-11 09:31:07 -04:00
temportalflux 0daa97cd47 resolve clippy errors from using Range in reverse. Add CaretSelection to represent a bidirectional inclusive range 2026-07-11 09:31:07 -04:00
temportalflux 8c0d58c86b collapse styling of conditions 2026-07-11 09:31:07 -04:00
temportalflux bbf2679380 reorganize blocks in editable text element 2026-07-11 09:31:07 -04:00
temportalflux 787d747deb migrate EditableTextActionElement::register_action and bindings to an internal macro 2026-07-11 09:31:07 -04:00
temportalflux 2cc4f237d6 rework element api to expose EditableTextState as a viable entity for users to create via use_keyed_state 2026-07-11 09:31:07 -04:00
temportalflux cc055b7f7d add very basic text sanitation for no-multiline fields 2026-07-11 09:31:07 -04:00
temportalflux 44e65e544f rework focus handle semantics to only use Window::set_focus_handle during prepaint instead of requiring changes to Interactivity 2026-07-11 09:31:07 -04:00
temportalflux 812d5aa91a add on_text_changed callback binding to allow the caller to be notified on every change to the text 2026-07-11 09:31:07 -04:00
temportalflux 6beeecb5a8 add module-level documentation with examples 2026-07-11 09:31:07 -04:00
temportalflux 1502a54b34 add action default_bindings documentation table 2026-07-11 09:31:07 -04:00
temportalflux 579b8d06f1 collapse UnicodeTextStorage api to only expose methods operating on the direction/boundary enums 2026-07-11 09:31:07 -04:00
temportalflux 18c80084d2 fill out more documentation 2026-07-11 09:31:07 -04:00
temportalflux cf6f785661 replace async-io timer with background executor timer 2026-07-11 09:31:07 -04:00
temportalflux e0458531dd add editable text documentation 2026-07-11 09:31:07 -04:00
temportalflux e91181535a rename actions to be more clear 2026-07-11 09:31:07 -04:00
temportalflux 8156acd872 apply paint order to editable text elements (text, ime, selection, caret) 2026-07-11 09:31:07 -04:00