Conversation
`resize_handle_appearance()` is documented as being for a hand-rolled handle in an application, but the handle it draws in was hidden, generic over its drag payload and took no listener but its own `on_drag`. `resize_handle` is now a public, standalone part the way `SliderThumb` is: `ResizeHandle` implements `InteractiveElement`, `StatefulInteractiveElement` and `InteractiveElementExt`, so the drag and any other listener attach to the band itself. `gpui-component` adds a `resize_handle` that installs the divider appearance, and the hairline reads a new `resizable.border` theme color that falls back to `border`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ihavecoke
marked this pull request as draft
September 28, 2026 14:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
resize_handle_appearance()says it is there for "a hand-rolled handle in an application", but an application could not build one.resize_handlewas#[doc(hidden)], generic over its drag payload, and took no listener beyond its ownon_drag;ResizeHandleContexthas no public constructor, so the appearance could not be put on anything else either.This makes the handle a public, standalone part, the way
SliderThumbis:resize_handle(id, axis)is public ingpui-base.gpui_component::resize_handleinstalls the divider appearance, ash_resizabledoes.ResizeHandleimplementsInteractiveElement,StatefulInteractiveElementandInteractiveElementExt. The drag goes through the standardon_drag/on_drag_move, andon_hover,on_double_clickand the rest attach to the band itself. Base still owns the band, the cursor,inside(HandleEdge)and the Idle → Hovered → Pressed → Dragging progression the appearance reads.test_support(), sowindow.find(id)finds a handle.resizable.border(ThemeColor::resizable_border), falling back toborder; the Base projectionResizableTheme::handlereads it. Left unset, nothing changes on screen.Why: an application sidebar (Allsum) has a hand-written edge handle with the same three-level indicator — the same 20 / 28 / 44 px at 0.35 / 0.6 / 0.9. It needs a double click that restores the default width, a hover its hover-to-peek drawer counts as its own, and a lighter divider than
border.h_resizableitself does not fit a collapsible fixed-width sidebar (it keeps panels proportional as the container resizes, and hides a panel without a transition), so the handle is the part it can share.Public API
gpui-basepub fn resize_handle(id: impl Into<ElementId>, axis: Axis) -> ResizeHandle— no longer hidden; a band that resizes whatever it edges.pub struct ResizeHandle— now public and no longer generic.impl InteractiveElement for ResizeHandle,impl StatefulInteractiveElement for ResizeHandle,impl InteractiveElementExt for ResizeHandle— listeners attach to the band.gpui-componentpub fn resize_handle(id: impl Into<ElementId>, axis: Axis) -> ResizeHandle— the Base handle withresize_handle_appearance()installed.resizable::{HandleEdge, ResizeHandle}— re-exported.ThemeColor::resizable_border: Hsla— the divider's hairline; theme keyresizable.border, optional, falls back toborder.Breaking Changes
Only the builder that was hidden:
How to Test
cargo test -p gpui-base --lib resizable—a_callers_listeners_reach_the_bandhovers, double clicks and drags a standalone handle, and checks the container stops reading as hovered (the band occludes), the double click fires once, a drag reports moves without clicking, and the appearance still sees Idle → Hovered → Pressed → Dragging → Idle.cargo test -p gpui-component --lib -- theme:: resizable dock—test_apply_config_reads_the_resizable_bordercovers an explicitresizable.borderand the fallback; the projection test reads the new color.cargo run -- resizable/cargo run -- dock: dividers look and behave as before.Checklist
cargo runfor story tests related to the changes.🤖 Generated with Claude Code