managarten/apps/mana/apps/web/src/lib/modules/todo
Till JS 6d8637b837 feat(spaces): migrate todo/notes/contacts to scoped-db + add scopedGet
Three more modules now use the scope wrapper. Pattern matches the
calendar pilot:

  db.table<T>('X').toArray()            → scopedForModule<T>('mod','X').toArray()
  db.table<T>('X').orderBy('k').toArray → scopedForModule<T>(...).sortBy('k')
  db.table<T>('X').get(id)              → scopedGet<T>('X', id)

Added scopedGet() to the scope barrel — a primary-key fetch with a
post-read scope check so URL-manipulated deep links can't peek at
records from another space. Dexie's fast-path index read still happens;
the scope check is one field comparison on the single row.

Modules migrated:
- todo/queries.ts: useAllTasks, useAllBoardViews, useAllReminders,
  useAllProjects (4 queries; sortBy replaces orderBy-via-index)
- notes/queries.ts: useAllNotes (list), useNote (by id via scopedGet)
- contacts/queries.ts: useAllContacts

goals module lives in companion/goals with a different layout (not a
standard modules/*/queries.ts) — skipped this pass, will migrate in a
targeted follow-up.

Scope + visibility filters run BEFORE decrypt where possible so the
vault-locked UI path stays cheap: plaintext spaceId + visibility + deletedAt
metadata filters the decrypt workload before crypto gets invoked.

Performance note: sortBy() is an in-memory O(n) sort. Fine for a user's
task list, but if a hot path surfaces (e.g. a thousands-of-tasks view),
we add a [spaceId+order] compound index in a follow-up Dexie version.

Plan: docs/plans/spaces-foundation.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 18:26:01 +02:00
..
components fix(mobile): disable text selection on list rows to unblock long-press context menu 2026-04-17 15:08:04 +02:00
composables fix(timeblocks): type errors from recurrence migration 2026-04-07 13:22:59 +02:00
stores feat(ai-scope): wire filterByScope into list_tasks/contacts/events + note tag UI 2026-04-16 15:06:11 +02:00
utils feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
views refactor(mana/web): migrate module DetailViews + sub-views to theme tokens (P5) 2026-04-09 12:15:47 +02:00
collections.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
index.ts chore(mana/web): pre-launch module cleanup — schema collapse, dead code, lazy search 2026-04-07 22:31:08 +02:00
ListView.svelte feat(workbench): scope-aware empty state for scoped modules 2026-04-18 16:52:14 +02:00
module.config.ts fix(mana/web): commit module-registry + module.config.ts files (build-critical) 2026-04-07 19:49:58 +02:00
queries.ts feat(spaces): migrate todo/notes/contacts to scoped-db + add scopedGet 2026-04-20 18:26:01 +02:00
quick-input-adapter.ts feat(crypto): phase 7.1 — encrypt timeBlocks-coupled tasks + calendar events 2026-04-07 20:37:59 +02:00
reminder-source.ts feat(crypto): phase 7.1 — encrypt timeBlocks-coupled tasks + calendar events 2026-04-07 20:37:59 +02:00
tools.ts feat(ai-scope): wire filterByScope into list_tasks/contacts/events + note tag UI 2026-04-16 15:06:11 +02:00
types.ts fix(mana/web+packages): clear all 270 warnings to zero 2026-04-10 17:34:49 +02:00
view-grouping.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00