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
@@ -127,8 +127,11 @@ struct OutlineRowTextView: NSViewRepresentable {
|
||||
}
|
||||
}
|
||||
|
||||
/// The row NSTextView: structural key interception.
|
||||
final class RowTextView: NSTextView {
|
||||
/// The row NSTextView: structural key interception. `FileDropTextView`
|
||||
/// base (27.2 routing): a file drag landing on a row bounces instead of
|
||||
/// pasting the path — images don't ingest into outlines (#141); text
|
||||
/// drags keep the stock drop.
|
||||
final class RowTextView: FileDropTextView {
|
||||
weak var bridge: OutlineRowTextView.Coordinator?
|
||||
|
||||
override func keyDown(with event: NSEvent) {
|
||||
|
||||
Reference in new issue
Block a user