Repository navigation
GPUI Kit v0.12.0
GPUI Kit 0.12.0 is a minor release. It moves to gpui-pre 0.3.15 and GPUI Fast 0.1.20, lets GPUI Fast builds skip upstream GPUI and wasm builds use stable Rust, switches WebView to upstream Wry, and brings a large set of editor APIs (line decorations, spacer rows, gutter layout, hit testing), spell checking in inputs, a new LiveRegion and broad screen reader work across menus, dialogs, charts and the sidebar. The feature split, the Wry switch and new fields on PopupMenuItem variants are breaking, so this is a minor release.
Breaking Changes
- Upstream GPUI is a feature:
gpui-preis now a default feature ofgpui-kit,gpui-base,gpui-component,gpui-kit-assets,gpui-fpsandgpui-shell, so a GPUI Fast build with default features off no longer compiles upstream GPUI. Apps that turn off the defaults withoutgpui-fastmust ask for it. (#4164)- gpui-kit = { version = "0.11", default-features = false } + gpui-kit = { version = "0.12", default-features = false, features = ["gpui-pre"] }
- Web threads are a feature: the new default
web-threadsfeature carries Web Worker threads on wasm. With it off,gpui-kitbuilds forwasm32-unknown-unknownon stable Rust; wasm apps that already turn off the defaults and want threads must add it. Native targets are unaffected. (#4185) - WebView uses upstream Wry:
gpui-webviewmoves fromlb-wryto Wry 0.57.3. Apps that pass Wry types through it must depend on the samewry, and the fork-onlybuild_async/build_as_child_asyncare gone. (#4104)- wry = { version = "0.53.3", package = "lb-wry" } + wry = "0.57.3"
- PopupMenuItem variants gain fields:
PopupMenuItem::ElementItemhasaccessibility_labelandPopupMenuItem::Itemhasdanger. Code that builds or matches them without..must add the field; builders such asPopupMenuItem::elementare unaffected. (#4152, #4228)PopupMenuItem::ElementItem { icon: None, + accessibility_label: None, disabled: false, ... } - Input mode extras:
<InputMode as InputModeKind>::ExtrasisTextareaExtrasinstead of(). (#4137)
New APIs
- Editor line decorations:
LineDecorationwith a row background and a gutter icon, supplied per frame by aLineDecorationProviderthroughcreate_line_decorations_collection;row_boundsfor a row's painted bounds. (#4091, #4120) - Editor layout:
gutter_sideputs the gutter on the right,gutter_orderorders itsGutterColumns, spacer rows from aSpacerProviderline up paired paragraphs, andDisplayMap::versiontells a cache when display rows moved. (#4099, #4117, #4118, #4100) - Editor hit testing:
hit_testtells whether a point is over text or a gutter column,context_menu_hittells a custom context menu where it was opened, anddefault_context_menuappends the built-in items; aShowHoveraction opens the hover popover at the caret. (#4128, #4135, #4218) - Spell checking:
InputandTextareatake aSpellCheckerthat underlines misspelled words and offers corrections and Learn Spelling in the context menu. (#4156) - Input:
ReplaceNextandReplaceAllactions for the search panel, text decorations on a single-lineInput, andInputBaseState::is_composing. (#4122, #4137, #4222) - LiveRegion: a new component that announces status changes to screen readers, politely or
assertive. (#4094) - Settings:
SettingSectiongroups sidebar pages under a heading, and a publicSettingsStateselects a page or searches from outside. (#4146, #4145) - Speech:
SystemRecognizer::expected_phrasesfavors names and terms, andsupported_localeslists the languages the machine can recognize. (#4143, #4144) - Menus and tabs:
PopupMenuItem::dangerfor destructive items,TabBar::context_menubuilt for the tab right-clicked, submenus inTreerow menus, and Shift+F10 to open a context menu. (#4228, #4138, #4134, #4133) - Components:
Popover::boundarykeeps a popover inside a pane;ValueMappinggivesSlidernon-linear scales;Kbd::labelfor hints that are not one keystroke;Switch::label_side;ButtonCustomVariant::hover_foreground;MessageScrollerState::with_uniform_item_height;DiffFile::source_lines;FocusableforTreeStateandSizableforCommand. (#4151, #4158, #4124, #4225, #4226, #4182, #4139, #4149, #4148) - Theme:
ThemeRegistryreports which file each theme came from and which files did not load, and why. (#4147)
Accessibility
- Name a
PopupMenuand number its items, name dialogs by their title and mark the topmost modal, name a chart withaccessibility_label, name sidebar groups and exposeSidebarMenuas a tree, expose diff source lines as their value. (#4154, #4186, #4159, #4187, #4101, #4121) - Mark disabled menu, accordion and breadcrumb items disabled;
accessibility_labelon menu element items and on shell components; arrow-key roving focus inRadioGroup; keyboard day selection inCalendar; limit input accessibility text to the caret's surroundings in large documents. (#4178, #4195, #4193, #4152, #4184, #4165, #4171, #4174, #4110)
Editor and text input
- Keep fold candidates while typing beside a foldable node; hide a fold's last line unless it closes a bracket; parse highlighter injections within the parse budget and past it when styles reach them. (#4103, #4097, #4200, #4189)
- Wrap decorated text at the width its weight and style draw; compact, scrollable hover popovers that open only HTTP(S) links; notify the view when IME marked text clears; forward padding clicks to the input's focus. (#4155, #4131, #4230, #4223)
Markdown and text rendering
- Share a paragraph's cached highlights with its inline flow; keep a word on its line when it fits once kerned; join CJK soft breaks without a space; color the hovered link with the theme's link hover color. (#4093, #4114, #4123, #4160)
Components
- Dialog: focus the first control on open, and give focus back on close only when nothing else has taken it. (#4180, #4191)
- Menu: leave focus where it was for an empty context menu and hand the right-click to the enclosing menu; draw item icons at their given size; truncate long labels with an ellipsis. (#4105, #4113, #4150, #4231)
- DataTable: round a bordered header's top corners; compute visible columns once per frame and stop allocating cell ids per frame. (#4115, #4204, #4203)
- Dock: accept a dropped tab on a one-panel group's title row and on the empty part of a tab strip. (#4198, #4214)
- Chart: draw a
CandlestickChart's candles in one layer and lay its x scale out once per hovered frame. (#4207, #4206, #4205) - Diff: pin the top file's header while its content scrolls. (#4142)
- Form, Calendar, ButtonGroup, Resizable, Theme: long field text wraps; today is read on each render; a disabled group disables every child; a handle press keeps focus;
Hsla::to_hexrounds clamped channels; the UI font is probed after init. (#4108, #4170, #4188, #4227, #4224, #4157) - Title bar, window border, Root: window control backgrounds stay inside rounded corners; the frame shadow is cast only around the frame; the Inspector picks content below idle overlay layers. (#4153, #4175, #4177)
- WebView: clip the native view to GPUI Fast's surface clip, and give the page X11 keyboard focus on click. (#4176, #4183)
Docs and tooling
- Getting Started reaches a running window first; guides on context menu builders, tooltip wrapping and Action examples; zh-CN Notification examples synced; site analytics. (#4211, #4172, #4173, #4162, #4192, #4190)
Dependencies
- gpui-pre 0.3.15 with AccessKit 0.25.2 and GPUI Fast 0.1.20; resvg/usvg 0.49,
windows0.62,itertools0.14 andnotify9.0 aligned with gpui-pre. (#4238, #4140, #4107, #4209, #4208, #4210)
Contributors
Thank you to everyone who contributed to this release
@lurenjia534, @glani, @ketansingrole, @forzen-dev, @madcodelife, @since2006, @ambyte, @superoskin, @huacnlee, @IsraelAraujo70, @eliw00d, @mizorewww, @danylokravchenko, @sahabji0P, @neiii, @hexadecimal233, @sassman, @luan, @withamoliver, @MSedgeMC, @wangdiandao, @NairoDorian, @kongweiguang.
What's Changed
- text: Share a paragraph's cached highlights with its inline flow by @lurenjia534 in #4093
- editor: Add row backgrounds with line decorations by @glani in #4091
- base: Build test-support's image without default formats by @ketansingrole in #4095
- highlighter: Hide a fold's last line unless it closes a bracket by @forzen-dev in #4097
- story: Let the multi-month
Calendardemo scroll in a narrow docs embed by @madcodelife in #4102 - editor: Keep fold candidates when typing beside a foldable node by @madcodelife in #4103
- sidebar: Expose
SidebarMenuand its submenus as an accessibility tree by @madcodelife in #4101 - menu: Leave focus where it was when a context menu is empty by @since2006 in #4105
- component: Bump Windows resvg to 0.46 to match gpui-pre by @forzen-dev in #4107
- form: Let a horizontal field's content and description shrink so long text wraps by @forzen-dev in #4108
- input: Limit accessibility text to the caret's surroundings in large documents by @ambyte in #4110
- editor: Name a fold test's byte offset
next_statementand wordextract_fold_ranges_in_rowsdocs in rows by @madcodelife in #4109 - webview: Switch from lb-wry to upstream Wry 0.57.3 by @superoskin in #4104
- menu: Hand a right-click to the enclosing menu when the inner one is empty by @huacnlee in #4113
- text: Keep a word on its line when it fits once kerned in an inline flow by @huacnlee in #4114
- table: Round the header's top corners in a bordered DataTable by @huacnlee in #4115
- editor: Let the gutter sit on the right of the text by @glani in #4099
- live_region: Add LiveRegion to announce status changes to screen readers by @ketansingrole in #4094
- editor: Add a version to the display map by @glani in #4100
- editor: Let the gutter's columns be put in a chosen order by @glani in #4117
- editor: Add spacer rows to the display map by @glani in #4118
- editor: Add gutter icons to line decorations by @glani in #4120
- diff: Expose a source line's text as its accessibility value by @IsraelAraujo70 in #4121
- input: Add ReplaceNext and ReplaceAll actions to the search panel by @eliw00d in #4122
- markdown: Join a soft break between CJK characters without a space by @mizorewww in #4123
- kbd: Add
Kbd::labelto show a hint that is not one keystroke by @mizorewww in #4124 - editor: Add hit_test to tell what a point in the editor is over by @glani in #4128
- fix(input): keep editor hover popovers compact and scrollable by @danylokravchenko in #4131
- editor: Tell a custom context menu where it was opened by @glani in #4135
- feat(gpui-pre): upgrade the accesskit version by @danylokravchenko in #4140
- settings: Add SettingSection to group the sidebar's pages by @mizorewww in #4146
- speech: Add SystemRecognizer::expected_phrases to favor names and terms by @mizorewww in #4143
- menu: Draw an item's icon at the size it was given by @mizorewww in #4150
- title_bar: Keep window control backgrounds inside rounded window corners by @lurenjia534 in #4153
- docs: Dispatch the Action examples' button clicks outside
cx.listenerby @madcodelife in #4162 - chart: Add accessibility_label to name a chart for screen readers by @huacnlee in #4159
- theme: Probe the UI font after init's update, not inside it by @huacnlee in #4157
- text: Color the link under the pointer with the theme's link hover color by @huacnlee in #4160
- menu: Name a PopupMenu and number its items for screen readers by @lurenjia534 in #4154
- input: Wrap decorated text at the width its font weight and style draw by @sahabji0P in #4155
- tree: Implement Focusable for TreeState by @mizorewww in #4149
- command: Implement Sizable for Command to size its search field by @mizorewww in #4148
- theme: ThemeRegistry says which file each theme came from and which did not load by @mizorewww in #4147
- settings: Add SettingsState to select a page and search from outside by @mizorewww in #4145
- speech: Add SystemRecognizer::supported_locales to list its languages by @mizorewww in #4144
- menu: Open a context menu from the keyboard with Shift+F10 by @mizorewww in #4133
- input: Let a single-line Input carry text decorations, as a Textarea does by @neiii in #4137
- tab: Add a context menu to the tabs of a TabBar by @mizorewww in #4138
- diff: Add DiffFile::source_lines to read the text of a file's lines by @mizorewww in #4139
- input: Underline misspelled words and offer corrections by @mizorewww in #4156
- slider: Add a value mapping for non-linear scales by @hexadecimal233 in #4158
- base: Add arrow-key roving focus to RadioGroup by @huacnlee in #4165
- menu: Add PopupMenuItem::accessibility_label to name an element item by @mizorewww in #4152
- popover: Add Popover::boundary to keep a popover inside a pane by @mizorewww in #4151
- diff: Pin the top file's header while its content scrolls by @sassman in #4142
- input: Test that
set_valueclears the undo and redo history by @sahabji0P in #4127 - test-support: Report focus for elements under hidden ancestors by @huacnlee in #4167
- calendar: Read today on each render instead of once at creation by @huacnlee in #4170
- calendar: Support choosing days from the keyboard by @huacnlee in #4171
- calendar: Call
today()inkeyboard_dayby @madcodelife in #4174 - docs: Say when a context menu's builder runs and how to track the menu's open state by @madcodelife in #4172
- docs: Explain how long tooltip content wraps by @madcodelife in #4173
- window_border: Cast the frame shadow only around the frame by @luan in #4175
- kit: Add a default gpui-pre feature so GPUI Fast builds skip upstream GPUI by @huacnlee in #4164
- webview: Clip the native view to GPUI Fast's surface clip by @huacnlee in #4176
- root: Let the Inspector pick content below idle overlay layers by @huacnlee in #4177
- menu: Mark disabled items disabled for assistive technology by @huacnlee in #4178
- tree: Let a row's context menu hold submenus by @mizorewww in #4134
- message_scroller: Add
with_uniform_item_heightto size unrendered rows by @huacnlee in #4182 - webview: Give the page the X11 keyboard focus on click by @huacnlee in #4183
- website: Add NsMetry page analytics by @huacnlee in #4190
- kit: Add a default
web-threadsfeature so wasm builds can use stable Rust by @huacnlee in #4185 - dialog: Name dialogs by their title and mark the topmost one modal by @huacnlee in #4186
- button_group: Disable every child of a disabled group by @huacnlee in #4188
- dialog: Focus the first control when a dialog opens by @huacnlee in #4180
- highlighter: Parse injections past the budget when styles reaches them by @huacnlee in #4189
- sidebar: Name each group's menus with the group label by @huacnlee in #4187
- dialog: Give the closing focus back only when nothing else has taken it by @withamoliver in #4191
- shell: Expose accessibility_label on components whose builders take one by @huacnlee in #4184
- accordion: Mark disabled triggers disabled for assistive technology by @MSedgeMC in #4195
- docs: Sync zh-CN Notification examples with the English guide by @MSedgeMC in #4192
- breadcrumb: Mark disabled items disabled for assistive technology by @MSedgeMC in #4193
- table: Avoid allocating cell ElementId and resize-handle group strings per frame by @wangdiandao in #4203
- label, chart, shell: Avoid throwaway copies when preparing labels, price ranges and style values by @lurenjia534 in #4205
- dock: Accept a dropped tab on a one-panel group's title row by @huacnlee in #4198
- highlighter: Hold the synchronous injections query to the parse budget by @huacnlee in #4200
- chore: Bump itertools to 0.14 to match gpui-pre and story by @NairoDorian in #4208
- chore: Bump workspace windows to 0.62 to match gpui-pre by @NairoDorian in #4209
- chore: Bump notify to 9.0.0 by @NairoDorian in #4210
- docs: Get to a running window first in Getting Started by @madcodelife in #4211
- editor: Add ShowHover action to open the hover popover at the caret by @huacnlee in #4218
- dock: Accept a dropped tab on the empty part of a tab strip by @huacnlee in #4214
- chart: Draw a CandlestickChart's candles in one layer by @lurenjia534 in #4207
- input: notify view when unmark_text clears marked range by @kongweiguang in #4230
- menu: truncate overflowing PopupMenuItem labels with ellipsis by @kongweiguang in #4231
- table: Compute visible columns once per frame instead of nesting a VirtualList in every row by @wangdiandao in #4204
- switch: expose Switch::label_side(Side) builder method by @kongweiguang in #4225
- resizable: preserve focus on handle press and apply initial drag move by @kongweiguang in #4227
- button: add ButtonCustomVariant::hover_foreground() by @kongweiguang in #4226
- theme: round clamped RGB/alpha channels in Hsla::to_hex by @kongweiguang in #4224
- input: expose InputBaseState::is_composing() by @kongweiguang in #4222
- input: forward padding clicks to inner InputState focus by @kongweiguang in #4223
- chart: Lay a CandlestickChart's x scale out once per hovered frame by @lurenjia534 in #4206
- menu: add PopupMenuItem::danger() for destructive actions by @kongweiguang in #4228
- chore: Bump v0.12.0 by @huacnlee in #4238
New Contributors
- @forzen-dev made their first contribution in #4097
- @ambyte made their first contribution in #4110
- @IsraelAraujo70 made their first contribution in #4121
- @eliw00d made their first contribution in #4122
- @danylokravchenko made their first contribution in #4131
- @sahabji0P made their first contribution in #4155
- @neiii made their first contribution in #4137
- @hexadecimal233 made their first contribution in #4158
- @withamoliver made their first contribution in #4191
- @MSedgeMC made their first contribution in #4195
- @NairoDorian made their first contribution in #4208
- @kongweiguang made their first contribution in #4230
Full Changelog: v0.11.0...v0.12.0