feat(plot): Chunk #5 story whiteboard, timeline & plot beats

Story whiteboard built on React Flow v11: free-form canvas of typed
nodes (character, world, chapter, note, image, group) with draggable
leads-to/contrasts/causes edges, cross-link selectors (chapter/entity),
linked-node badges, and an "Add beats to board" import from the plot.

Plot beats feature set:
- Status/locking (draft/revised/locked) with a progress bar
- Beat templates (three-act, save-the-cat, seven-point, custom)
- Timeline route with search/chapter/character filters
- Entity cross-links (entityIds) on beats and board nodes
- getBoard added to the StorageAdapter contract (local + server) and
  REST endpoints; loadBoard now restores persisted board state

Storage & server:
- PlotBeat type (status, entityIds) across core types, Dexie schema,
  and server mapping/routes/migration (002_plot_beats.sql)
- SQLite-safe column names (beat_order, entity_ids)
- Server seed data for plot beats

UI: accent Button variant, Badge variants, plot/timeline/whiteboard
stylesheets. Tests: templates module, plot-beat store round-trip,
board getBoard. typecheck, lint, test, and build all green.
This commit is contained in:
Schwitzz
2026-10-26 19:00:07 -05:00
parent 301e842c5c
commit 45f5c505c9
28 changed files with 3488 additions and 52 deletions
+9
View File
@@ -13,6 +13,7 @@ import type {
NewProject,
Project,
ProjectMeta,
PlotBeat,
AISession,
} from "./types.js";
@@ -53,6 +54,14 @@ export interface StorageAdapter {
*/
searchEntities(projectId: string, q: string): Promise<Entity[]>;
saveBoard(b: Board): Promise<void>;
/** Load the story board for a project (by id `b.id`, scoped to `projectId`). */
getBoard(projectId: string): Promise<Board | null>;
/** Plot beats — the atomic units of story structure (CHUNK #5). */
listPlotBeats(projectId: string): Promise<PlotBeat[]>;
savePlotBeat(b: PlotBeat): Promise<void>;
deletePlotBeat(projectId: string, id: string): Promise<void>;
saveAISession(s: AISession): Promise<void>;
// live updates