fix(warpui/mac) + feat(terminal): subview click cycles & circular jump-to-bottom button#80
Merged
Merged
Conversation
WarpWindow's sendEvent: override force-dispatched LeftMouseUp and LeftMouseDragged events directly to self.contentView (WarpHostView) to work around CLD-2581, where AppKit would mid-drag redirect events away from the contentView and break tab/pane drag-and-drop. That workaround also hijacked click cycles owned by native subviews. The embedded browser pane attaches a WKWebView as a subview of WarpHostView (via wry::WebViewBuilder::new_as_child). LeftMouseDown went through `default: [super sendEvent:]` and reached the WKWebView, but the subsequent LeftMouseUp was force-routed to WarpHostView, so the WKWebView never saw mouseUp. HTML buttons, anchor links, and <select> dropdowns all appeared dead -- only scrolling worked, because NSEventTypeScrollWheel was already covered by the default case. Fix: on LeftMouseDown, hit-test contentView and remember the actual target view in a new `_mouseDownTarget` ivar. On LeftMouseUp / LeftMouseDragged: - if the captured target IS the contentView (the CLD-2581 case -- GPUI's tab/pane drag origin), keep the force-dispatch path. - otherwise the click cycle belongs to a subview, so fall back to [super sendEvent:event] and let AppKit deliver to the tracking view per the documented Cocoa contract. Reset `_mouseDownTarget` on each LeftMouseUp. This restores in-page interaction in the embedded browser pane (HTML buttons, links, <select>) without regressing tab/pane drag-and-drop -- the latter still routes through the force-dispatch path because the GPUI-rendered tab/pane interactives are part of WarpHostView's own draw, so the hit-test resolves to WarpHostView itself. Refs #76. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes macOS event routing in WarpWindow so embedded native subviews (notably the WKWebView used by the browser pane) receive a complete left-click cycle (MouseDown + MouseUp) instead of having MouseUp/MouseDragged forcibly rerouted to the GPUI contentView workaround path (CLD-2581).
Changes:
- Track the view hit by
NSEventTypeLeftMouseDownin a new_mouseDownTargetivar. - For
LeftMouseDragged/LeftMouseUp, only use the CLD-2581 force-dispatch path when the original target was thecontentView; otherwise fall back to[super sendEvent:]. - Clear
_mouseDownTargetonLeftMouseUp.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Swap the rounded-square vertical-align icon for a full-circle button with a chevron-down glyph, subtle outline border, and a default surface_1 fill that brightens to surface_2 on hover. Also ignore local .codex/ state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
This PR bundles two independent changes on the same branch:
fix(warpui/mac)— restore subview click cycles inWarpWindow sendEvent(the original scope of this branch — fixes browser: in-page clicks unresponsive — HTML <select>, buttons, links all dead inside webview #76).feat(terminal)— replace the rounded-square jump-to-bottom-of-block button with a full-circle, chevron-down button with a subtle outline border.1.
fix(warpui/mac)— preserve subview click cycles inWarpWindow sendEventFixes #76 — embedded browser pane HTML clicks (buttons,
<a>,<select>dropdowns, in-page form fields) are completely dead. Original hypothesis in #76 was wrong; the real root cause is inWarpWindow'ssendEvent:override, nothitTest:.Root cause
crates/warpui/src/platform/mac/objc/window.m:388-416force-dispatchesLeftMouseUpandLeftMouseDraggeddirectly toself.contentView(WarpHostView) as a workaround for CLD-2581 — AppKit was mid-drag redirecting these events away from the contentView and breaking tab/pane drag-and-drop.LeftMouseDownfalls through todefault: [super sendEvent:], so it reaches the embedded WKWebView normally via AppKit's hit-test. But the followingLeftMouseUpis hijacked back to WarpHostView, so the WKWebView never seesmouseUp— its click cycle never completes. HTML buttons,<select>, and links all appear inert. Scrolling still works becauseNSEventTypeScrollWheelis already in thedefault:arm.Fix (1 file, +38/-5)
In
sendEvent::NSEventTypeLeftMouseDown: hit-testcontentViewand store the actual target view in a new_mouseDownTargetivar before calling[super sendEvent:event].NSEventTypeLeftMouseUp/LeftMouseDragged:_mouseDownTarget == contentView(the CLD-2581 case — GPUI's tab/pane drag origin), keep the force-dispatch path.[super sendEvent:event]so AppKit delivers to the tracking view per the documented Cocoa contract._mouseDownTargettonilon eachLeftMouseUp.RightMouseDown, key handling, and all other event paths inwindow.mare untouched.Linked Issue
Closes #76.
2.
feat(terminal)— circular chevron-down jump-to-bottom buttonRestyles the in-block jump-to-bottom button to better match the new visual language (small, distinct circular control with a clear chevron glyph rather than a rounded-square with the
vertical_align_bottomicon).Changes (
app/src/terminal/view.rs, +6/-5)bundled/svg/vertical_align_bottom.svg→bundled/svg/chevron-down.svg.20px → 16px, padding4px → 7px, corner radius4px → 15px(full circle on a 30px button).theme.surface_1()at rest,theme.surface_2()on hover/click.theme.outline()border ring.Also:
.gitignoreadds.codex/for local Codex state.Testing
cargo check -p warp-app→ clean, 8 pre-existing dead-code warnings (none fromterminal/view.rsorwindow.m)../script/run:<select>dropdowns are now interactive in the embedded browser pane.target/debug/bundle/osx/CastCodes.app) launched; visual check of the new circular chevron-down button pending.Drag-and-drop regression check (CLD-2581) — pending manual verification before mark-ready:
The browser fix is designed so drags started on the GPUI canvas itself still use the force-dispatch path (because hit-test resolves to WarpHostView). But this is framework-level surgery to a known-fragile workaround, so visual verification is required.
./script/runScreenshots / Videos
To add — before/after of an in-page button click in the embedded browser pane, a tab-drag recording showing CLD-2581 still works, and a before/after of the new circular jump-to-bottom button.
Agent Mode
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com