Repository navigation
Conversation
…manaflow-ai#3729) textDropDestinationKindUnderPoint could not find the GhosttyNSView when PaneDropTargetView captured the hit-test fallback, causing canDropAsText to be false and routing all drops to the file preview panel. Add a pane target fallback: a live hostedView on the PaneDropTargetView proves a terminal is present.
|
@mrosnerr is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe change refines how file drop destinations are classified in ChangesFile Drop Terminal Target Detection
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 13 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (13 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Greptile SummaryThis PR fixes Finder file drops landing in the file-preview panel instead of pasting shell-escaped paths into the terminal. The root cause was that
Confidence Score: 3/5The change correctly fixes the routing decision for the common case, but the actual text-insertion step depends on Bonsplit's PaneDropTargetView.performDragOperation accepting file-URL payloads and there is no recovery path if it returns false. The routing logic in textDropDestinationKindUnderPoint is patched correctly and the fix is small and targeted. However, the actual drop execution path when the new fallback fires unconditionally delegates to PaneDropTargetView.fileDropPerformDragOperation and returns its result with no fallthrough. If that Bonsplit method returns false for Finder file-URL payloads, the drop silently fails with no recovery. Sources/FileDropOverlayViewHitTesting.swift — specifically the performDragOperation text-route branch in FileDropOverlayView.swift where a false return from PaneDropTargetView.fileDropPerformDragOperation terminates the drop with no recovery. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Finder file drag dropped] --> B{shouldRouteFileDropToTextDestination?}
B --> C{terminalUnderPoint != nil?}
C -- Yes --> D[return .terminal]
C -- No --> E{NEW: paneDropTargetUnderPoint as PaneDropTargetView with hostedView != nil?}
E -- Yes --> D
E -- No --> F[return nil - canDropAsText = false]
D --> G[Text route taken]
F --> H[Preview route - bug path]
G --> I{paneDropTargetForTextDrop finds PaneDropTargetView?}
I -- Yes --> J[PaneDropTargetView.fileDropPerformDragOperation]
J -- true --> K[Text drop handled]
J -- false --> L[Silent failure - no fallthrough]
I -- No --> M[performFileDropAsText]
M -- found --> N[insert urls into terminal]
M -- nil --> O[Returns false]
Reviews (1): Last reviewed commit: "fix: file drop on terminal routes to tex..." | Re-trigger Greptile |
|
Superseded by #3755 which rerouted all terminal file drops through the SSH-aware upload planner and updated the overlay/pane drop hit-testing — covers the same hit-test gap this PR addressed. |
Summary
textDropDestinationKindUnderPointfailed to detect terminals whenPaneDropTargetViewcaptured the hit-test beforeGhosttyNSView,causing
canDropAsTextto be false and routing all Finder file dropsto the file preview panel instead of inserting shell-escaped paths.
terminalUnderPointmisses, checkwhether a
PaneDropTargetViewwith a livehostedViewexists at thedrop point — if so, a terminal is present and text routing applies.
Local testing
All verified manually on a tagged Debug build:
Fixes #3729
Summary by cubic
Fixes a regression where dropping a file onto the terminal opened the preview viewer instead of inserting a shell-escaped path. Adds a pane-target fallback in hit testing so terminals are detected even when
PaneDropTargetViewcaptures the hit test.terminalUnderPointmisses, treat aPaneDropTargetViewwith a non-nilhostedViewas a terminal for text drops.Written for commit 2d6082a. Summary will update on new commits.
Summary by CodeRabbit