commit 474281d5b90ceef59e14876f11e87605d5e789b3
parent 4ddaf159f80766a977db14ac5628084c32639808
Author: Michael Camilleri <[email protected]>
Date: Thu, 12 Mar 2026 18:54:57 +0900
Remove unnecessary code where context menu is handled by AppKit
Diffstat
| M | ListlessMac/Views/TaskRowView.swift | | | 15 | +++++++-------- |
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/ListlessMac/Views/TaskRowView.swift b/ListlessMac/Views/TaskRowView.swift
@@ -193,25 +193,24 @@ struct TaskRowView: View {
}
}
+ // These context menu actions only run in navigation mode — when a row is
+ // being edited, the NSTextField field editor is first responder and its
+ // native context menu handles Cut/Copy/Paste for text directly.
+
private func cutToPasteboard() {
copyToPasteboard()
onDelete(task)
}
private func copyToPasteboard() {
- let text = isCurrentlyEditing ? editingTitle : task.title
- guard !text.isEmpty else { return }
+ guard !task.title.isEmpty else { return }
let pasteboard = NSPasteboard.general
pasteboard.clearContents()
- pasteboard.setString(text, forType: .string)
+ pasteboard.setString(task.title, forType: .string)
}
private func pasteFromPasteboard() {
guard let string = NSPasteboard.general.string(forType: .string) else { return }
- if isCurrentlyEditing {
- editingTitle = string
- } else {
- onPaste(string)
- }
+ onPaste(string)
}
}