mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
Adds the two seeding helpers the Space-creation flow needs: - applyPresetToSpace(presetId, targetSpaceId): one-shot-copies a preset's frozen snapshot as fresh globalTags rows in the target Space. Creates tagGroups for each distinct groupName so the user's familiar grouping carries over. Not a live link — renaming the preset afterwards doesn't rename applied tags. - copyTagsBetweenSpaces(sourceSpaceId, targetSpaceId): duplicates every non-deleted tag + tagGroup from one Space into another with fresh ids. Powers the "copy tags from my current Space" option in SpaceCreateDialog so solo-Space users don't have to build a named preset before they inherit their existing taxonomy. Both helpers explicitly stamp spaceId on every written row so the write lands in the TARGET Space even while the caller's active-space context is still the SOURCE Space (SpaceCreateDialog: create Space → apply preset → activate → reload). The Dexie creating-hook normally stamps spaceId from getActiveSpaceId(); pre-populating it makes the hook's `if undefined/null` guard skip. Both run inside a single Dexie transaction so a mid-batch failure doesn't leave a half-seeded Space. Duck-typed LocalTagShape / LocalTagGroupShape local to this file — the authoritative types live in @mana/shared-stores but importing them here would create an awkward data-layer → shared-stores dependency direction. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| food | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| photos | ||
| picture | ||
| plants | ||
| presi | ||
| questions | ||
| quotes/packages/content | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||