mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 06:49:40 +02:00
Resolves the name collision flagged in the Spaces RFC: four tables owned the term "spaceId" before the multi-tenancy Spaces foundation landed in v28 (conversations, documents, spaceMembers, memoSpaces — chat's context-folder reference, context's parent context-space, and memoro's membership/join tables). After v28, the scope wrapper started filtering on a field that meant something different in these tables, which would have hidden their records from the UI. Dexie v31 migration: - Renames the index from spaceId → contextSpaceId on all four tables. - upgrade() copies each existing `spaceId` value to `contextSpaceId` (when it's a real context-space reference and not already the v28 `_personal:<userId>` sentinel), then resets `spaceId` to the personal-space sentinel so the scope wrapper picks the row up on the active-space boot pass. Type changes: - LocalConversation, Conversation: spaceId → contextSpaceId - LocalDocument: spaceId → contextSpaceId - LocalSpaceMember, LocalMemoSpace (memoro): spaceId → contextSpaceId Code updates: - chat/queries.ts: toConversation + filterBySpace renamed to filterByContextSpace (exports updated in chat/index.ts). - chat/stores/conversations.svelte.ts: create() param + write site. - context/queries.ts: toDocument + useSpaceDocuments signature. - context/collections.ts: seed data. - context/ListView.svelte + route pages: form data. - dashboard/widgets/ContextDocsWidget.svelte: read site. Table names stay: `spaceMembers` and `memoSpaces` still carry their old names because they belong to the memoro module's context-space concept and table renames also require sync-routing updates. A dedicated cleanup can rebrand those once memoro's data model is revisited. 0 errors across 7148 files. Plan: docs/plans/spaces-foundation.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| services | ||
| stores | ||
| views | ||
| collections.ts | ||
| index.ts | ||
| ListView.svelte | ||
| module.config.ts | ||
| queries.ts | ||
| tools.ts | ||
| types.ts | ||