Scope the selection to the current view
A selection made in one workspace survived switching workspace or tab, so the selection bar and its batch actions (copy, delete) kept acting on items that were no longer visible. Switching workspace, switching tab, or closing search now clears the selection.
This commit is contained in:
@@ -59,7 +59,8 @@ clicking an item copies it back to the clipboard.
|
|||||||
bar offers Copy (single item), Copy as List, Copy as Lines and Delete;
|
bar offers Copy (single item), Copy as List, Copy as Lines and Delete;
|
||||||
right-click = context menu acting on the whole selection (Copy, Copy as List,
|
right-click = context menu acting on the whole selection (Copy, Copy as List,
|
||||||
Copy as Lines, Done, Edit, Open, Merge, Move To, Delete). Esc clears the
|
Copy as Lines, Done, Edit, Open, Merge, Move To, Delete). Esc clears the
|
||||||
selection before it hides the panel. Drop target for images/files.
|
selection before it hides the panel. Selection is scoped to the current view:
|
||||||
|
switching workspace, switching tab, or closing search clears it. Drop target for images/files.
|
||||||
- `Sources/Prompt/PanelController.swift` — owns the floating `NSPanel`
|
- `Sources/Prompt/PanelController.swift` — owns the floating `NSPanel`
|
||||||
(`.nonactivatingPanel`, `.floating`, right-edge docked, frame autosaved as
|
(`.nonactivatingPanel`, `.floating`, right-edge docked, frame autosaved as
|
||||||
`PromptPanel`), and the Cmd+V paste monitor. Editing a note is an in-panel
|
`PromptPanel`), and the Cmd+V paste monitor. Editing a note is an in-panel
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ struct PanelView: View {
|
|||||||
accessibilityGranted = AXIsProcessTrusted()
|
accessibilityGranted = AXIsProcessTrusted()
|
||||||
}
|
}
|
||||||
.onAppear { composerFocused = true }
|
.onAppear { composerFocused = true }
|
||||||
|
// Selection is scoped to the current view: switching workspace, tab,
|
||||||
|
// or leaving search clears it. Otherwise a selection made in one
|
||||||
|
// workspace kept acting (copy, delete) on items you can no longer see.
|
||||||
|
.onChange(of: store.activeSectionID) { clearSelection() }
|
||||||
|
.onChange(of: tab) { clearSelection() }
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Header
|
// MARK: - Header
|
||||||
@@ -144,6 +149,7 @@ struct PanelView: View {
|
|||||||
search = ""
|
search = ""
|
||||||
showSearch = false
|
showSearch = false
|
||||||
focusedField = nil
|
focusedField = nil
|
||||||
|
clearSelection()
|
||||||
composerFocused = true
|
composerFocused = true
|
||||||
}
|
}
|
||||||
if !search.isEmpty {
|
if !search.isEmpty {
|
||||||
@@ -852,6 +858,7 @@ struct PanelView: View {
|
|||||||
} else {
|
} else {
|
||||||
search = ""
|
search = ""
|
||||||
focusedField = nil
|
focusedField = nil
|
||||||
|
clearSelection()
|
||||||
composerFocused = true
|
composerFocused = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user