Skip to content

Dependencies: gpui-base 0.8.1 on gpui-fast 0.1.12, with the workarounds it closes removed - #1011

Merged
Tryanks merged 4 commits into
mainfrom
gpui-base-0.8.1
Oct 29, 2026
Merged

Tryanks merged 4 commits into
mainfrom
gpui-base-0.8.1

Conversation

@Tryanks

@Tryanks Tryanks commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Summary

gpui-base, gpui-kit and gpui-webview go to 0.8.1. That moves gpui-fast from 0.1.10 to 0.1.12 and gpui-pre to 0.3.10. Tcode follows the API changes, removes the workarounds upstream has now fixed, and adopts upstream's new multi-click selection rule.

 Dependencies
-  gpui-base / gpui-kit / gpui-webview 0.8.0, gpui-fast 0.1.10, gpui-pre(-reqwest-client) 0.3.9
+  gpui-base / gpui-kit / gpui-webview 0.8.1, gpui-fast(-*) 0.1.12, gpui-pre(-reqwest-client) 0.3.10

 API migration (behaviour unchanged)
-  ScrollWheelEvent / PlatformInput::ScrollWheel / on_scroll_wheel
+  ScrollEvent / PlatformInput::Scroll / on_scroll; touch pans (two-finger and in tests) are ScrollSource::Touch
-  KeyBinding::new("secondary-…")        # compiles, but panics at startup on gpui-fast 0.1.12
+  shortcut::secondary("secondary-…", …, cx)   # KeyBinding::load, OS resolved at run time
-  Kbd::format(key)                       # cfg!(target_os = "macos")
+  Kbd::format(key, cx.platform_info().os)
+  gpui-ios / gpui-android: Platform::platform_info (Ios / Android, Native); WindowInsets::corner_radii = 0

 Workarounds removed (upstream fixed)
-  page_viewport: ScrollBounce.scroll_wheel(false)        # #933; gpui-kit#3631 #3632
-  sidebar provider_mark: empty slot while marks are off  # gpui-fast#68 (fixed in 0.1.9)
-  chat timeline row: .id(("timeline-row", identity))    # gpui-fast#68

 Adopted (gpui-kit#3681)
+  transcript selection: a drag after a double/triple click, and a shift-click after it, extend by word/line

Transcript selection (markdown/selection.rs):

 mouse down, click_count > 1
   select_unit(word | line)
+  hold_unit()                       # held until release
 drag(point)
-  set(anchor, point)
+  if unit held: before the unit → (unit.end, start of the word/line at point)
+                after the unit  → (unit.start, end of the word/line at point)
+                inside          → the unit itself
 press(point, shift)
+  shift with a unit held → extend the same way; any plain press drops the unit

What changes for users

  • Browser on a Mac: secondary shortcuts (⌘K palette, ⌘1–9, ⌘Z, image-viewer zoom) now bind Command, and the hints show ⌘. GPUI's Modifiers::secondary is now OS-aware (zed#65970). Editing keys inside inputs still use gpui-base's compile-time bindings (Ctrl). Native builds are unchanged, iOS included (secondary = Control, plus Tcode's own Cmd editing bindings).
  • Page viewports (chat timeline, settings, sidebar, panels) use gpui-base's own wheel and trackpad edge bounce again.
  • Changes that come with the upgrade:
    • Elastic edges no longer overscroll falsely from rounding or at large offsets.
    • A focused button that becomes disabled keeps Tab traversal.
    • Clicking blank space on a Toolbar no longer takes focus.
    • A focus trap's Tab search stops at the first repeated stop.
    • Resizable dividers read the drag state when each event arrives.
    • A focused input asks its scroll container to reveal it.
    • gpui-fast measures text that reaches prepaint unmeasured instead of panicking, and Windows draws frames on demand.

Checked and left as they are

  • The iOS input workarounds: character_index_for_point, the mark left open on blur, the length query and the selection setter. Upstream code is unchanged.
  • The iOS Cmd editing bindings.
  • web/keyboard.rs and the input's mouse-up keyboard request on wasm.
  • Transcript selection stays Tcode's own: gpui-base's window selection still reaches the whole window and ends only on a bubble-phase release.
  • The on_prepaint origin change (gpui-kit#3689) doesn't affect Tcode: its sites read only the size, or sit on unpadded elements.
  • Dialog::centered, the Sheet/notification insets, DataTable and Diff live in gpui-component, which Tcode doesn't use.

Not done

  • ScrollSource::Touch could tell the edge-back and sidebar swipe gestures apart from trackpad scrolls. That needs checking on a device.
  • The iOS host could report real corner_radii, which needs a Swift host change.

Evidence

Before: on gpui-fast 0.1.12, KeyBinding::new("secondary-k", …) fails to parse (Keystroke::parse no longer resolves secondary), so the bindings in shortcut::init and run_shell panic at startup. Clippy also fails on gpui-mobile-touch (PlatformInput::ScrollWheel no longer exists), and the iOS crate fails on the missing platform_info and corner_radii.

After:

cargo fmt --all --check                                         ok
cargo clippy --workspace --all-targets --locked -D warnings     ok
cargo nextest run --workspace --locked                          1358 passed, 13 skipped
cargo check -p tcode-ios --target aarch64-apple-ios-sim  (-D warnings)        ok
cargo check -p tcode-web --target wasm32-unknown-unknown (-D warnings)        ok
cargo check -p gpui-android --target aarch64-linux-android (-D warnings)      ok
cargo test -p gpui-ios --lib                                    7 passed
cargo machete                                                   no unused dependencies

New test: a_drag_or_shift_click_from_a_double_click_extends_by_words.

double-click "beta" → drag to "delta" → "beta gamma delta"   (before: still "beta")
                    → drag to "alpha" → "alpha beta"
                    → back into "beta" → "beta"
shift-click "gamma" after it          → "beta gamma"
plain click, then shift-click         → plain character range "pha beta ga"

It failed before the change (left: "beta", right: "beta gamma delta") and passes after.

Existing regression tests that cover the removed workarounds still pass without them:

No test failed, was removed or was rewritten. Test event literals only gained source: Touch where the test simulates a finger, the default Pointer for wheel and trackpad.

Desktop app launched on a throwaway TCODE_DATA_DIR: it starts without a panic and the sidebar hint shows ⌘K. Synthetic keystrokes couldn't be delivered to the app in this environment, so a throwaway test (not committed) checked shortcut::secondary("secondary-k") on macOS instead: it binds cmd-k, ⌘K dispatches the action and Ctrl-K does not.

Not run locally:

  • tcode-android (no NDK on this machine; gpui-android itself checks)
  • the Linux headless --features web clippy (needs the browser bundle)
  • Windows and Linux runners
  • device checks for page bounce, and on iPad and in a browser on a Mac

Merge Danger

Door: two-way

A dependency bump plus local refactors. A revert restores 0.8.0 exactly; nothing persisted or on the wire changes.

Blast Radius: input-wide

Scroll bounce on every page viewport, every secondary shortcut and its hint (browser on a Mac only), and transcript multi-click selection. gpui-fast's list scroll-anchoring rewrite and Taffy 0.15 reach every list and layout; the chat suite passes, but long-transcript scrolling deserves a manual pass.

…t 0.1.12

gpui-base 0.8.1 pins gpui-pre 0.3.10 and gpui-fast 0.1.12, so the
reqwest-client snapshot follows to 0.3.10 and every crate's gpui-fast
minimum states 0.1.12.

GPUI renamed `ScrollWheelEvent` to `ScrollEvent` and added the input's
source; the mobile two-finger pan is a touch scroll, and so are the finger
pans the selection tests simulate.

`KeyBinding::new` no longer reads `secondary-`: it panics at startup.
`shortcut::secondary` loads those bindings for the host OS, which GPUI now
reports at run time, so a browser on a Mac binds Command as a native Mac
build does. `Kbd::format` reads the same OS, so a hint names the key its
binding takes.
…fast closed

Page viewports go back to gpui-base's own wheel bounce. #933 turned it off
because a release while moving threw the edge and f32 rounding of the delta
the content used read as reaching it; gpui-base 0.8.1 throws the edge only
when it is stretched and ignores that rounding. The test #933 added, a drag
right after a flick, holds with the default.

gpui-fast fixed a reparented retained child left unmeasured (#68) in 0.1.9,
and since 0.1.11 measures text that reaches prepaint unmeasured instead of
panicking. The sidebar's empty provider-mark slot and the chat row's
content-keyed id existed only for #68: the mark is absent while marks are
off, and rows carry no id; the images inside them are keyed by their
message. The provider-mark toggle test (#452) and the Work Log collapse
test (#898) still pass.
… by its unit

gpui-base 0.8.1 extends a double- or triple-click drag, and a shift-click
after it, by words or lines, and keeps the clicked unit selected whichever
way they go (#3681). A transcript owns its selection, so it now holds the
unit the same way: until the button is released a drag moves the far end to
the edge of the word or line under the pointer, and a shift-click does so
until a plain click starts afresh. A long press, a touch handle and Select
Entry make their own selection and hold no unit.
gpui-fast 0.1.12 asks every platform for the host OS, which decides what
`secondary-` binds and how a keystroke is written: the iOS backend reports
iOS and the Android one Android, both native, so `secondary` stays Control
there as before. Window insets gained the display's corner radii; neither
host reports them, so they are zero, which GPUI reads as square or unknown.
The palette shortcut no longer imports `KeyBinding` for the macOS-only Quit.
@Tryanks
Tryanks merged commit bc2de47 into main Oct 29, 2026
25 of 26 checks passed
@Tryanks
Tryanks deleted the gpui-base-0.8.1 branch October 29, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant