Skip to content

v1.2.12 — Reference Management library (cross-board)

Choose a tag to compare

@crisng95 crisng95 released this 19 May 14:59
· 65 commits to main since this release

Feature

Cross-board Reference library

Save image variants once, spawn nodes from them in any board. Backed by a new server-side `Reference` table — distinct from the auto-managed Asset cache, with user-curated metadata (label, pin, tags, source provenance).

Save: ★ overlay button on every image / storyboard variant tile + a Save button on character / visual_asset bodies. Click snapshots `(media_id, url, ai_brief, aspect_ratio, kind, label, source_board_id, source_node_short_id)` to the library.

Spawn:

  • Click a card in the right-side Library panel → spawns a `visual_asset` node at canvas center.
  • Drag a card onto the canvas → spawns at the cursor's flow position via a custom `application/x-flowboard-reference` MIME on the drag payload.

Cross-board reuse works out of the box — the underlying Asset table is already globally scoped, `/media/{id}` is board-agnostic, and Flow accepts ref media_ids across projects. The library adds the curation layer + UI.

Panel UX:

  • Vertical scrollable list on the right edge of the canvas, collapsible via a ★ tab.
  • Per-card: 64×64 thumbnail, label (2-line clamp), shortId pill, hover-revealed actions (pin / rename-in-place / inline 2-step delete confirm).
  • Search input filters case-insensitive on label + aiBrief.
  • Empty state hints "Save a variant from any image node to start your library."
  • Delete uses an inline 2-step confirm (click 1 arms the button red + "Confirm?", click 2 within 3s commits, timeout reverts) — no more native window.confirm modal.

Internal

  • Backend (`agent/flowboard/db/models.py`, new `agent/flowboard/routes/references.py`): `Reference` SQLModel with unique constraint on media_id. 4 REST endpoints: POST (idempotent on media_id), GET (?q for label/ai_brief substring, ?pinned_first, ?limit), PATCH (label/pinned/position/tags), DELETE (returns 204; never touches storage/media/{id} — that's owned by Asset).
  • Frontend store (`frontend/src/store/references.ts`): Zustand `useReferencesStore` with load/save/remove/rename/togglePin/setQuery/togglePanel actions. `panelOpen` persists to localStorage key `flowboard.references.panel.v1`.
  • Component (`frontend/src/components/ReferencesPanel.tsx`): right sidebar + draggable cards with the custom MIME payload.
  • Integration: `addReferenceNode` action on the board store, canvas drop handler in `Board.tsx`, ★ overlay button on `ImageTile`, ★ Save button on character / visual_asset bodies. Storyboard tiles special-case the kind to `"storyboard_shot"`.

Plan: `.omc/plans/reference-management.md` (7 decisions locked, file:line cites throughout).

Tests

9 new backend tests covering CRUD, idempotent save, default-label synthesis, sort order, query filter, mutation, and the "delete doesn't touch storage" invariant. Frontend type-check clean. pytest 380 → 389.