fix(editor): editor owns file drops on macOS 27.2
Dropping an image file on the prose editor pasted the file path instead of ingesting it (#141 follow-up, unticketed; dogfood on macOS 27.2.1). #141 was field-verified on 27.0.1, where the window-level SwiftUI dropDestination starved every deeper destination; 27.2 routes a drag to the deepest destination, and a live NSTextView registers itself for drag types, so its stock performDragOperation pasted the path and the window destination never fired — the same for a markdown file dropped on the editor. The editor text views now share a FileDropTextView base that owns the drops landing on them: URL-bearing drags route (never super) — the prose editor through the one new AppGateState.routeFileDrop (Cold Turkey guard, markdown → guest, anything else → ingestDrop), which the window destination also uses for drops landing outside the editor; the outline rows bounce; text-only drags keep the stock drop; the pasteboard probe is memoized per changeCount. A web URL refuses with the type strip, a vanished file refuses as missing. +9 tests (a real NSDraggingInfo mock drives the overrides; the router's guest/lock/ingest branches pinned), all flip-verified. Finish-audit: three reviewers; the text-drag regression and the outline rows' identical exposure fixed, two pre-existing ceilings deferred in the devlog. Rail 729/729, swiftformat 0/153, swiftlint 0.
This commit is contained in:
1 parent
64a7eaa37e
commit
46e87e678c
15 files changed
+529
-60
No files matched your search
@@ -322,7 +322,7 @@ extension ProseFoldRekeyTests {
|
||||
debounce: .seconds(3600),
|
||||
)
|
||||
let coordinator = ProseTextView.Coordinator(
|
||||
representable: ProseTextView(session: session, dropBridge: ProseDropBridge()),
|
||||
representable: ProseTextView(session: session, dropBridge: ProseDropBridge(), routeDrop: { _ in false }),
|
||||
)
|
||||
textView.delegate = coordinator // production wiring (PostEditorView)
|
||||
textView.setSelectedRange(NSRange(location: 0, length: 0))
|
||||
|
||||
Reference in new issue
Block a user