feat: add pane hover copy-location control - #3145
Conversation
|
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 (15)
🚧 Files skipped from review as they are similar to previous changes (15)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds pane copy controls with hover tracking, copies pane identifiers on click, and carries custom clipboard feedback through clipboard events and delivery. ChangesPane copy control and clipboard feedback
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This change adds a localized hover control for copying pane identifiers and showing feedback, with no actionable merge-blocking risk remaining after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Pointer
participant MouseHandling
participant AppState
participant ClipboardQueue
participant ForegroundClient
Pointer->>MouseHandling: Hover or click pane copy control
MouseHandling->>AppState: Update pane_hover and copy-button press state
MouseHandling->>ClipboardQueue: Queue pane identifier and feedback
ClipboardQueue->>ForegroundClient: Deliver ClipboardWrite event
ForegroundClient-->>AppState: Show custom or default clipboard feedback
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
🧹 Nitpick comments (2)
src/app/state.rs (1)
1470-1470: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd doc comments for the new state fields.
request_clipboard_writehas a doc comment, butrequest_clipboard_feedbackdoes not.pane_hoveruses an anonymous tuple(PaneId, bool)with no comment to explain the bool. A short comment on each field (for example, "message queued for the next successful clipboard delivery" and "hovered pane id and whether the copy button itself is hovered") would help future readers avoid re-deriving the meaning from call sites.Also applies to: 1500-1500
src/server/headless.rs (1)
2331-2339: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAdd a positive-path test for custom clipboard feedback delivery.
Existing tests cover the default message, the no-foreground-client case, the failed-send case, and the dropped-then-default case. None of them set
request_clipboard_feedbackto a custom message and then verify that message (not the "copied to clipboard" fallback) reachescopy_feedbackafter a successful foreground delivery. Add a test that sets a custom message, connects a working foreground client, sendsAppEvent::ClipboardWrite, and assertscopy_feedback.messageequals the custom message.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9fca056b-8e83-4cb7-b222-c869ae72fb7d
📒 Files selected for processing (11)
src/app/actions.rssrc/app/api.rssrc/app/input/clipboard.rssrc/app/input/mod.rssrc/app/input/mouse.rssrc/app/mod.rssrc/app/runtime.rssrc/app/state.rssrc/server/headless.rssrc/ui.rssrc/ui/panes.rs
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Greptile SummaryThe PR adds a hover-activated pane control that copies the pane’s public location while consuming the corresponding mouse interaction. It also completes the prior clipboard-feedback fix by carrying feedback alongside clipboard content through asynchronous delivery.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/app/input/mouse.rs | Adds pane-copy hit testing, hover tracking, press consumption, and public-ID clipboard requests. |
| src/app/input/clipboard.rs | Dispatches clipboard content and optional feedback together in one event, resolving the previously reported association issue. |
| src/events.rs | Extends the internal clipboard event with event-local feedback. |
| src/app/api.rs | Consumes clipboard feedback directly from the corresponding event in the monolithic path. |
| src/server/headless.rs | Preserves event-associated feedback while forwarding clipboard content to the foreground client. |
| src/ui/panes.rs | Renders the copy-location control for the eligible hovered pane. |
Sequence Diagram
sequenceDiagram
participant U as User
participant I as Mouse input
participant S as AppState
participant E as Clipboard event queue
participant H as Host or foreground client
U->>I: Click pane copy control
I->>S: Resolve pane public ID
S->>E: ClipboardWrite(content, feedback)
E->>H: Deliver clipboard content
E->>S: Show event-associated feedback
S-->>U: copied wN:pN
Reviews (2): Last reviewed commit: "fix: dispatch uncaptured copy clicks and..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/app/state.rs (1)
2040-2117: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winConsider validating
pane_hoverandpane_copy_pressesinassert_invariants_for_test.
assert_invariants_for_testvalidates that other transient UI state (selection,drag,context_menu,right_click_passthrough) references only live panes. It does not do the same for the newpane_hoverfield. If a future change fails to clearpane_hoveron pane closure, this invariant check would not catch a dangling pane reference in tests.Add a check that, when
pane_hoverisSome((pane_id, _)),pane_idis a live pane, following the same pattern as the otherassert_live_panecalls.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a12db0d-31dd-42e4-a004-8a6796877561
📒 Files selected for processing (6)
src/app/input/mod.rssrc/app/input/mouse.rssrc/app/mod.rssrc/app/runtime.rssrc/app/state.rssrc/server/headless.rs
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
0250200 to
5152b77
Compare
|
please dont open pull requests for features that are not given a green light from maintainers. |
Summary
Hovering a pane shows a small
⧉control at the top right of its border. Clicking it copies the pane's public id (for examplew2:p5, the same target stringherdr agent readand the rest of the CLI/API accept) to the clipboard and shows acopied w2:p5toast. Typing a pane target today means reading it out of the UI by hand; this makes it one click.Behavior details:
mouse_capture = falseforwarding) and in both the monolithic and headless server paths.Test plan
cargo fmt --check,cargo clippy --all-targets --locked -- -D warnings: clean.cargo nextest run --no-fail-fast: 3356 passed; the only 3 failures are environment-specific on this machine (two live_handoff, one api_ping done-status) and fail identically on unpatched master.Generated with Claude Code