Repository navigation
fix: keep tab and sidebar clicks when the terminal reports a stray drag - #2736
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughMouse handling now tracks Chrome gestures by input source. Matching-source checks control pane forwarding, reordering, and release cleanup. Tests cover stray reports and concurrent gestures. The changelog records the native fullscreen tab-bar fix. ChangesChrome Mouse Input
Estimated code review effort: 4 (Complex) | ~45 minutes Mergeability Score: 🟡 Moderate · up to The change preserves tab and sidebar clicks and delays tab drags until a valid drop target exists, but unrelated input can still alter or complete an active reorder, creating incorrect tab or workspace movement; merge should wait for that behavior to be fixed or explicitly accepted. Sequence Diagram(s)sequenceDiagram
participant InputSource
participant InputRouter
participant AppState
participant MouseHandler
participant Pane
InputSource->>InputRouter: mouse event with source_id
InputRouter->>AppState: handle_mouse(source_id, mouse)
AppState->>MouseHandler: process source-aware gesture
MouseHandler->>Pane: forward only when no matching Chrome gesture is pending
InputSource->>AppState: release input source
AppState->>MouseHandler: clear source-owned Chrome state
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f1975b41-f746-4149-ba8e-501db4e6a126
📒 Files selected for processing (2)
docs/next/CHANGELOG.mdsrc/app/input/mouse.rs
df2890d to
b7fdfbd
Compare
Greptile SummaryThe PR preserves tab and sidebar clicks when Ghostty emits a stray motion report and completes the prior multi-client gesture-isolation fixes.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/app/input/mouse.rs | Implements per-source chrome presses, source-owned reorders, foreign-source isolation, and regression tests for the previously reported concurrency failures. |
| src/app/input/terminal.rs | Clears only the released input source’s pending chrome gesture during focus loss or teardown. |
| src/app/state.rs | Extends reorder state with source ownership and replaces singleton chrome presses with per-source maps. |
| src/app/input/mod.rs | Propagates the originating input source ID into mouse-state handling. |
| src/app/mod.rs | Initializes the new per-source chrome press collections. |
| docs/next/CHANGELOG.md | Documents restored tab-click behavior under Ghostty native fullscreen. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Mouse down from source] --> B{Chrome target?}
B -->|Tab or workspace| C[Store press by source ID]
B -->|Pane| D[Forward pane mouse report]
C --> E[Motion report]
E --> F{Valid drop target and threshold met?}
F -->|No| G[Retain pending click]
F -->|Yes| H[Create source-owned reorder]
G --> I[Mouse up from same source]
H --> I
I --> J{Owned reorder active?}
J -->|Yes| K[Commit reorder]
J -->|No| L[Complete tab or workspace click]
M[Event from another source] --> N[Preserve owner gesture]
N --> D
Reviews (4): Last reviewed commit: "fix: preserve concurrent chrome presses" | Re-trigger Greptile
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/app/input/mouse.rs (1)
686-746: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftPreserve input-source ownership for the full chrome reorder gesture.
A tab or workspace reorder loses its
source_idafter drag creation. Another source can then update or release that reorder.
src/app/input/mouse.rs#L686-L746: store the initiatingsource_idin active tab and workspace reorder state. Ignore nonmatching drag and release events.src/app/input/terminal.rs#L361-L372: clear an active chrome reorder when its owning source releases.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c011c1fe-692d-4981-8f2c-2722ce40526d
📒 Files selected for processing (4)
src/app/input/mod.rssrc/app/input/mouse.rssrc/app/input/terminal.rssrc/app/state.rs
This works around a Ghostty bug that causes herdr tabs to be unclickable in fullscreen mode. Ghostty on macOS in native fullscreen emits one motion report after a fresh press in the strip where the menu bar reveals, with the row shifted to near the bottom of the grid. The cause is upstream: macOS delivers one mouse event whose y is nearly a window height away from the real pointer, and Ghostty reports it as it arrives (iTerm2 and Terminal.app report the same clicks correctly). Herdr treated the stray report as a real drag and lost the click two ways: it opened a tab reorder with no drop target, making the release a no-op, and it handed the release to the pane under the bogus coordinates. Now, a press on the tab bar or sidebar owns the gesture until release, and a tab drag only starts once the pointer is over a real drop target. refs herdrdev#796
83a6250 to
d36ca39
Compare
|
Thanks for the assist! I had not considered multiple concurrent clients. |
This works around a Ghostty bug that causes herdr tabs to be unclickable in fullscreen mode.
Ghostty on macOS in native fullscreen emits one motion report after a fresh press in the strip where the menu bar reveals, with the row shifted to near the bottom of the grid. The cause is upstream: macOS delivers one mouse event whose y is nearly a window height away from the real pointer, and Ghostty reports it as it arrives (iTerm2 and Terminal.app report the same clicks correctly).
Herdr treated the stray report as a real drag and lost the click two ways: it opened a tab reorder with no drop target, making the release a no-op, and it handed the release to the pane under the bogus coordinates.
Now, a press on the tab bar or sidebar owns the gesture until release, and a tab drag only starts once the pointer is over a real drop target.
refs #796