Phase 5: campaign management & worldbuilding
- New entities (note/npc/quest/calendar): schemas, Dexie v4 tables, repos, hooks; campaign cascade-delete now covers them all - Dashboard hub: campaign stats, navigation cards, party overview, recent rolls; opening a campaign lands here - Notes/Wiki: tags, [[wiki-links]] with click-to-open/create, backlinks panel, full-text search, autosave - NPC manager (role/location/faction/status) and Quest tracker (status + objectives checklist + reward) - In-world Calendar: integer day counter + events (no real Date -> no timezone bug) - Fix: calendarRepo.get is read-only (creating-on-read crashed inside liveQuery) 8 new unit tests (wikilinks + extended cascade), worldbuilding e2e. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import type { Campaign } from '@/lib/schemas/campaign';
|
||||
import type { Character } from '@/lib/schemas/character';
|
||||
import type { Encounter } from '@/lib/schemas/encounter';
|
||||
import type { DiceRoll } from '@/lib/schemas/dice';
|
||||
import type { Note, Npc, Quest, Calendar } from '@/lib/schemas/world';
|
||||
import { characterDefaults } from '@/lib/schemas/character';
|
||||
|
||||
/**
|
||||
@@ -18,6 +19,10 @@ export class TtrpgDatabase extends Dexie {
|
||||
characters!: EntityTable<Character, 'id'>;
|
||||
encounters!: EntityTable<Encounter, 'id'>;
|
||||
diceRolls!: EntityTable<DiceRoll, 'id'>;
|
||||
notes!: EntityTable<Note, 'id'>;
|
||||
npcs!: EntityTable<Npc, 'id'>;
|
||||
quests!: EntityTable<Quest, 'id'>;
|
||||
calendars!: EntityTable<Calendar, 'campaignId'>;
|
||||
|
||||
constructor() {
|
||||
super('ttrpg-manager');
|
||||
@@ -49,6 +54,14 @@ export class TtrpgDatabase extends Dexie {
|
||||
if (e.log === undefined) e.log = [];
|
||||
});
|
||||
});
|
||||
|
||||
// v4 — Phase 5 worldbuilding: notes, NPCs, quests, calendar.
|
||||
this.version(4).stores({
|
||||
notes: 'id, campaignId',
|
||||
npcs: 'id, campaignId',
|
||||
quests: 'id, campaignId, status',
|
||||
calendars: 'campaignId',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user