fix: restrict inbox to captured artifacts

This commit is contained in:
2026-06-05 01:35:27 +08:00
parent 58a74acbf6
commit 2e86229350
9 changed files with 34 additions and 30 deletions
+5 -2
View File
@@ -169,10 +169,13 @@ func (r *Repository) ListRoots(includeDeleted bool) ([]Node, error) {
return scanNodes(rows)
}
// ListInboxRoots returns active root nodes that are not assigned to a specific section.
// ListInboxRoots returns active root capture artifacts explicitly marked for inbox.
func (r *Repository) ListInboxRoots(includeDeleted bool) ([]Node, error) {
q := `SELECT ` + nodeColumns + ` FROM nodes
WHERE parent_id IS NULL AND COALESCE(section, '') IN ('', 'inbox')`
WHERE parent_id IS NULL
AND id IN (
SELECT node_id FROM node_meta WHERE key = 'capture.inbox' AND value = 'true'
)`
if !includeDeleted {
q += " AND deleted_at IS NULL"
}