feat(workspace): deleted folders go to the trash as a whole, after a confirmation

A deleted personal folder is kept in trashed_folders with its subfolders;
its notes are trashed and tied to it. The trash lists the folder as one
entry with its note count; restoring brings back the folder tree (empty
subfolders too) and all notes, deleting for good, emptying the trash and
the notes trash delay remove it with its notes. Folders in shared folders
keep the old way.

Deleting a folder now asks first, in a small popover at the click
(ConfirmPopover, documented in ui-patterns).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sandrodachandClaude Opus 5.5 committed 2026-11-02 19:36:22 +01:00
1 parent 9dcfa6c27e
commit b26b07cfea
18 files changed
+564 -25

No files matched your search

+8
View File
@@ -832,6 +832,14 @@ export const api = {
await request(`/api/v1/documents/${id}/permanent`, { method: 'DELETE' });
},
async restoreFolder(trashId: string): Promise<void> {
await request(`/api/v1/folders/trash/${trashId}/restore`, { method: 'POST' });
},
async purgeFolder(trashId: string): Promise<void> {
await request(`/api/v1/folders/trash/${trashId}`, { method: 'DELETE' });
},
async emptyTrash(): Promise<{ deleted: number }> {
return request<{ deleted: number }>('/api/v1/documents/trash', { method: 'DELETE' });
},
+4
View File
@@ -415,13 +415,17 @@ export interface TrashedTask {
canEdit: boolean;
}
// A note in the trash, or a deleted folder (kind "folder": id of the trashed folder, title its name,
// folderPath where it was, noteCount the notes it holds)
export interface TrashedDocument {
id: string;
kind?: 'note' | 'folder';
title: string;
icon: string;
folderPath: string;
deletedAt: string;
isOwner: boolean;
noteCount?: number;
}
export interface Document {