feat: expose trash in gui

This commit is contained in:
2026-06-05 01:05:57 +08:00
parent 035f877280
commit cc83cd3476
16 changed files with 266 additions and 6 deletions
+13
View File
@@ -186,6 +186,19 @@ func (r *Repository) ListInboxRoots(includeDeleted bool) ([]Node, error) {
return scanNodes(rows)
}
// ListDeleted returns soft-deleted nodes, newest deleted first.
func (r *Repository) ListDeleted() ([]Node, error) {
rows, err := r.db.Query(
`SELECT ` + nodeColumns + ` FROM nodes
WHERE deleted_at IS NOT NULL
ORDER BY deleted_at DESC, updated_at DESC, title`)
if err != nil {
return nil, err
}
defer rows.Close()
return scanNodes(rows)
}
// CountChildren returns the number of non-deleted children for a parent,
// optionally filtered by one or more types.
func (r *Repository) CountChildren(parentID string, types ...string) (int, error) {