mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-10 03:28:14 +00:00
Merge f641e3d3c0 into 3f7b9667c6
This commit is contained in:
commit
1612ee3b8f
1 changed files with 11 additions and 0 deletions
|
|
@ -294,6 +294,17 @@ export function AppExperience() {
|
|||
)
|
||||
const [isSelectionMode, setIsSelectionMode] = useState(false)
|
||||
|
||||
// Selection is scoped to the documents currently on screen. When the active
|
||||
// space changes the previous selection points at documents from another
|
||||
// space that are no longer visible, so clear it — otherwise "Delete selected"
|
||||
// would delete documents the user can't see anymore.
|
||||
const activeSpaceKey = selectedProjects.join("|")
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: reset only when the space changes, not on selection edits
|
||||
useEffect(() => {
|
||||
setSelectedDocumentIds((prev) => (prev.size === 0 ? prev : new Set()))
|
||||
setIsSelectionMode((prev) => (prev ? false : prev))
|
||||
}, [activeSpaceKey])
|
||||
|
||||
const handleToggleSelection = useCallback((documentId: string) => {
|
||||
setSelectedDocumentIds((prev) => {
|
||||
const next = new Set(prev)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue