.maestro/playbooks/2026-03-15-Branch-Memory/2026-03-15-Branch-Parity/BRANCH-PARITY-02-Viewer-Branch-Display.md
The React viewer at http://localhost:37777 displays observation cards with type, project, title, subtitle, facts, narrative, and metadata — but no branch information. The database already stores branch and commit_sha on every observation (migrations 24-25), and the PaginationHelper query that feeds the viewer intentionally omits these columns. This phase adds branch visibility to observation cards so users can see which git branch produced each observation, completing the visual layer of branch-memory.
Add branch and commit_sha to the viewer's TypeScript type system:
src/ui/viewer/types.ts: Add branch?: string | null and commit_sha?: string | null to the Observation interface (currently has 15 fields ending with created_at_epoch at line ~16) Update PaginationHelper.getObservations() in src/services/worker/PaginationHelper.ts to include branch metadata:
'id, memory_session_id, project, type, title, subtitle, narrative, text, facts, concepts, files_read, files_modified, prompt_number, created_at, created_at_epoch', branch, commit_sha to this stringpaginate<Observation>() and the Observation type update from the previous task handles the restbranch and commit_sha to the Observation interface in src/services/worker-types.ts which PaginationHelper imports from Update ObservationCard.tsx in src/ui/viewer/components/ObservationCard.tsx to display branch metadata:
card-header-left div)observation.branch is truthy (many pre-migration observations will have null branch)card-project spanvar(--color-text-muted) with a subtle background.card-branch class:
card-project (~11px)var(--color-surface-hover))Build the viewer and verify the changes render correctly:
package.json (likely build-viewer or part of build-and-sync)plugin/ui/viewer.html (single-file HTML with embedded CSS/JS)Run tests and verify the full build:
npm test to ensure no regressionsnpm run build-and-sync for full production build