Skip to content

v0.8.1

Latest

Choose a tag to compare

@huacnlee huacnlee released this 26 Oct 08:27
· 25 commits to main since this release

GPUI Kit v0.8.1

GPUI Kit 0.8.1 improves text selection, Markdown rendering, editor layout, scrolling, focus and accessibility. It also adds compatible customization APIs for text rendering, editor scrollbars and Diff parsing and highlighting.

To preserve Kit-owned API compatibility with v0.8.0, this patch defers the MotionTokens field additions from #3616 and the Textarea associated-type change from #2842. Behavior fixes remain included. The default backend is pinned to gpui-pre 0.3.10, and the optional GPUI Fast backend uses 0.1.12. These upstream snapshots change several GPUI APIs re-exported by Kit; see the migration notes below.

Editor and text input

  • Tab stops: code-editor tabs align to the configured tab stops during measurement, wrapping and painting. Horizontal scroll extents follow laid-out text widths. (#3622, #3604)
  • Custom scrollbars: set_scrollbar_renderer lets an application supply its editor scrollbar presentation using EditorScrollbarContext. (#3644)
  • Focused inputs ask surrounding scroll containers to reveal them, taps request the software keyboard, and accessibility semantics follow the actual editor focus. (#3625, #3623, #3585)

Markdown and text rendering

  • Selection: publish selection snapshots once per frame to avoid invalidating unrelated retained views. Double- and triple-click drags and subsequent Shift-clicks extend selections by words, lines or paragraphs, including paragraphs with hard breaks. Drags starting inside a table cell stay in that cell. (#3686, #3681, #3646)
  • Text styles: inline_code_style, list_style and blockquote_style refine the corresponding text presentation while inheriting unspecified properties from the resolved style. (#3663, #3687)
  • Image sources: Component TextView exposes image_source to resolve document images consistently for measurement and rendering. (#3694)
  • Preserve sparse Markdown table rows and release shaped text retained by dropped TextViews on the next frame. (#3673, #3628)

Diff

  • Truncated patches: DiffFile::parse_with and DiffParseOptions::truncated_hunks accept incomplete hunks without relaxing the default parser. DiffFile::is_truncated identifies affected files; unified file boundaries and empty-hunk ordering remain validated. (#3688)
  • Syntax highlighting: with_syntax_highlighter, set_syntax_highlighter and clear_syntax_highlighter let an application provide its own highlighting without resetting selection or scrolling. (#3618)

Scrolling and layout

  • Scrollable regions can scroll content beyond their maximum size. Bounce handling avoids rounding-induced overscroll and false overscroll at large offsets, and release inertia applies only to stretched edges. (#3613, #3632, #3661, #3631)
  • last_horizontal_scroll_claim exposes the last horizontal scroll step consumed by a mask. Resizable dividers read the active drag state when events arrive. (#3621, #3629)
  • on_prepaint reports bounds from the element's corner, aligning geometry callbacks with their intended coordinate origin. (#3689)

Components

  • Dialog: Dialog::centered and AlertDialog::centered center the surface vertically; exit animation matches entrance animation. Sheets and notifications avoid system bars and the software keyboard. (#3635, #3603, #3624)
  • Button: track_focus accepts an application-owned handle. Disabling a focused button preserves the focus binding so Tab can still leave it in either direction. (#3684, #3606)
  • DataTable: honor centered and right-aligned columns; expose table structure and cell labels to assistive technology through TableDelegate::cell_label. (#3617, #3667)
  • Toolbar: grow with taller content and preserve focus when blank toolbar space is clicked. (#3651, #3652)
  • HoverCard: trigger_style applies layout styling to the trigger container. (#3653)
  • ColorPicker: preserve the first hex edit after a programmatic value update and round color channels instead of truncating them. (#3641, #3640)
  • TimeField: pressing outside a segment focuses the first segment. Command applies empty-list padding only while its empty state is visible. (#3655, #3654)
  • Focus trap: stop Tab traversal at the first repeated stop. Dock restores legacy empty StackPanel layouts as empty splits. (#3642, #3610)

Shell and localization

The release also prepares gpui-shell for crates.io publication with matching quickjs-jit, quickjs-jit-runtime and quickjs-jit-stdlib 0.14.1 registry dependencies.

  • Shell Button: accessibility_label supplies an accessible name independently of the visible label. (#3665)
  • Add Brazilian Portuguese translations and preserve valid Portuguese words in spell checking. (#3638, #3664)

Upstream GPUI compatibility

The updated GPUI snapshots change public APIs re-exported at the Kit root. Internal compilation checks and Kit API checks do not preserve these upstream signatures:

  • Modifiers::secondary() and Modifiers::secondary_key() now require &App.
  • Keystroke::parse and KeyBinding::new require static strings. Dynamic strings and secondary modifiers use OS-aware parsing/loading.
  • Keystroke::unparse and KeybindingKeystroke::unparse require an OperatingSystem argument.
  • PlatformInput::ScrollWheel becomes PlatformInput::Scroll; scroll event literals gain a source field.

Use cx.platform_info().os for OS-aware parsing/formatting and pass cx to modifier helpers. Use KeyBinding::load(..., cx) for dynamic keybindings or choose explicit cmd/ctrl literals with KeyBinding::new.

Thank you to everyone who contributed code, documentation, testing, and feedback!

What's Changed

  • typos: Ignore the two release-notes contributor handles by @noosxe in #3608
  • dock: Read the legacy empty StackPanel as an empty split by @obito-t in #3610
  • input: align accessibility semantics with editor focus by @TomiXRM in #3585
  • dialog: Animate the exit to match the entrance by @YidaWeng in #3603
  • input: Measure the horizontal scroll extent from laid-out lines by @YidaWeng in #3604
  • button: preserve Tab traversal when the focused control becomes disabled by @TomiXRM in #3606
  • table: Apply Column::text_right and text_center in DataTable by @Elitelord in #3617
  • diff: Let the application supply the syntax highlighter by @bcl-dev in #3618
  • scroll: Expose the last horizontal strip scroll step a mask claimed by @yuanzhuang-svg in #3621
  • story: Add an application-owned completion menu to the Input story by @noosxe in #3607
  • scroll: Scroll content past a scrollable's maximum size by @UncertaintyDeterminesYou4ndMe in #3613
  • input: Ask for the virtual keyboard when an input is tapped by @Bombatomica64 in #3623
  • sheet, notification: Keep out from under the system bars and the keyboard by @Bombatomica64 in #3624
  • scrollable_mask: Dispatch the overscroll steps of the scroll claim test within one frame by @madcodelife in #3648
  • resizable: Read active drag state when mouse events arrive by @huacnlee in #3629
  • input: Lay out tabs to tab stops in the code editor by @claudio-azevedo in #3622
  • input: Ask scroll containers to reveal a focused input by @Bombatomica64 in #3625
  • text: Release the shaped text of dropped text views at the next frame by @TastyCZ in #3628
  • locales: Add Brazilian Portuguese (pt-BR) by @sergiobalecho95 in #3638
  • color_picker: Round hex channels instead of truncating them by @boboshan in #3640
  • scroll: Ignore rounding in the part of a packet the text did not use by @Tryanks in #3632
  • scroll: Throw the edge on release only when it is stretched by @Tryanks in #3631
  • dialog: add centered() to seat a dialog in the middle of the window by @mastro993 in #3635
  • input: Let an editor supply its own scrollbar by @boboshan in #3644
  • color_picker: Keep the first hex edit after a programmatic value by @boboshan in #3641
  • website: Fix OtpInput examples and event documentation by @SandmeyerX in #3645
  • focus_trap: End the Tab search at the first repeated stop by @boboshan in #3642
  • toolbar: Grow with content taller than the bar by @AncientPixel in #3651
  • hover_card: Apply trigger_style to the trigger container by @AncientPixel in #3653
  • command: Pad the empty list only while the empty state shows by @AncientPixel in #3654
  • toolbar: Keep focus where it was when blank toolbar space is clicked by @AncientPixel in #3652
  • scroll_bounce: Avoid false overscroll at large offsets by @superoskin in #3661
  • text: Keep a drag that starts in a table cell in that cell by @watzon in #3646
  • time_field: Focus the first segment when the field is pressed outside a segment by @ylinwind in #3655
  • typos: Preserve valid Portuguese translations by @huacnlee in #3664
  • text: Support inline code style overrides by @citizenhicks in #3663
  • table: Expose DataTable's structure and cells to assistive technology by @Elitelord in #3667
  • button: Expose accessible names in the script API by @huacnlee in #3665
  • text: Preserve sparse Markdown table rows by @lurenjia534 in #3673
  • test: Read accessibility descriptions and placeholders in element snapshots by @boboshan in #3672
  • base: Report on_prepaint bounds from the element's corner by @ogulcancelik in #3689
  • text: Publish selection snapshots once per frame by @lurenjia534 in #3686
  • text_selection: Extend double- and triple-click drags by words and lines by @zachsents in #3681
  • button: Accept a caller-owned focus handle by @costajohnt in #3684
  • text: Support list and blockquote style overrides by @citizenhicks in #3687
  • diff: Parse truncated hunks through parse options by @citizenhicks in #3688
  • text: Expose image source resolver on component TextView by @dannyward630 in #3694

New Contributors

Full Changelog: v0.8.0...v0.8.1