Skip to content

feat(citations): wire CitationBrowser into the editor (P4.8) - #61

Merged
franciszver merged 3 commits into
mainfrom
feat/p4-wire-citations
Jul 24, 2026
Merged

feat(citations): wire CitationBrowser into the editor (P4.8)#61
franciszver merged 3 commits into
mainfrom
feat/p4-wire-citations

Conversation

@franciszver

Copy link
Copy Markdown
Owner

Closes #60

Summary

Activates the citation feature that was fully built but never mounted — CitationBrowser (699 lines, data/service/fixtures all present and tested) had no UI entry point, so the live demo lacked citations despite the README advertising them.

Wired it in by mirroring the working ClauseBrowser integration:

  • uiSlice: showCitationBrowser + setShowCitationBrowser.
  • Editor.tsx: a "Citations" toolbar button (next to "Clauses").
  • App.tsx: mounts CitationBrowser in a modal shell; insert flows through setPendingInsertion → TipTap insertContent (identical path to clauses; verified).

Citation content comes from the same getDataClient() demo layer as clauses (DEMO_CITATIONS fixtures), so it works in the live demo immediately.

Review-driven fix

The cold-review gate caught a UX trap: the modal could only be closed by inserting a citation. Fixed — backdrop-click-to-close, an explicit X button (aria-label="Close citation browser"), and Escape-to-close, with a red-first test covering close-without-insert.

README

  • Softened the citation bullet to "format and insert" (the CRUD CitationManager "capture" view remains unmounted — noted as a follow-up).
  • Corrected stale test counts everywhere: 781 tests (541 frontend + 240 server) across 57 files.

Red-first / tests

b3a88f3 (red: not wired) → 1db486c (green: wired) → 694c5cd (dismissability fix, red→green). Frontend 541 passed, server 240, npm run build clean.

Gates

/simplify + /security-review + /code-review via fresh cold reviewer — one HIGH finding (dismissability) fixed before this PR; re-verified clean.

Follow-up (not this PR): mount the standalone CitationManager CRUD view for citation "capture"; optionally recapture demo slot 5 with the now-live citation browser.

Assisted-by: Claude Code (Fable orchestrator + Sonnet implementer/reviewer)

franciszver and others added 3 commits July 24, 2026 12:05
Assisted-by: Claude Code (Sonnet)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
)

Assisted-by: Claude Code (Sonnet)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…utton) (#60)

Assisted-by: Claude Code (Sonnet)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@franciszver
franciszver merged commit eb697e8 into main Jul 24, 2026
2 checks passed
@franciszver
franciszver deleted the feat/p4-wire-citations branch July 24, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P4.8: Wire in CitationBrowser (insert Bluebook citations in the editor) + README test count

1 participant