tegwick bef2725fdd Unify capture/edit form, thicker active document border, layer-hide toggles
Three UX iterations rolled into one:

1. Unified evidence form
   - New EvidenceFormBody is the single source for "citation +
     commentary" editing. Both InlineCaptureForm (creating fresh
     evidence from a selection) and the EvidenceCard edit mode render
     this body with their own save/cancel labels + badge/helper text.
   - The capture form now exposes the citation as an editable
     textarea — pre-filled with the selection text — so the user can
     refine a partial capture before saving without re-selecting.
   - Old testid prefixes are unchanged for the inline-capture flow
     (`inline-capture-quote/commentary/save/cancel`); edit-mode
     testids are now `evidence-edit-<id>-{quote,commentary,save,cancel}`.

2. Active document card
   - The blue background alone was the only "this is open" cue. Added
     a 3px #0050b3 border (matching the evidence-card thick-border
     pattern, but in the documents-are-blue palette) plus a
     `data-active` attribute.

3. PDF layer-hide diagnostics
   - New debug flags `hideCanvas`, `hideTextLayer`, `hideAnnotationLayer`,
     `hideXfaLayer` — applied as `.ce-hide-<layer>` classes on the viewer
     wrapper, each `display: none`-ing the matching PDF.js layer.
   - SessionMenu groups the toggles under a "PDF diagnostics" header
     with a new shared DebugCheckbox helper. The existing "Debug text
     layer" highlight toggle now lives in the same group.
   - Lets the user isolate stacking issues by elimination — e.g.
     "hide text layer, can I now see the canvas content underneath?".

Tests
   - citation-card-export-e2e + session-export-reimport switched from
     placeholder/role-name lookups to the inline-capture testids so
     they survive form-copy changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 23:27:08 +02:00
2026-05-24 13:20:45 +00:00
2026-05-26 15:17:33 +02:00

citation-evidence

A document-centered evidence workspace for capturing, managing, presenting, and re-opening citations. The umbrella over the six-package design described in INTENT.md and wiki/ArchitectureOverview.md.

During the MVP all code lives here under src/ (see "Repository layout" below). Sister repos hold INTENT only — code migrates outward when each subsystem stabilises.

Documentation

Where What
INTENT.md Project intent, scope, the umbrella-first decision
wiki/ PRD, Architecture, SharedContracts, DependencyMap
docs/decisions/ ADRs (architecturally significant decisions)
workplans/ Ralph-driven workplans that implement the MVP slice
history/ Time-stamped assessments and post-mortems

The canonical contracts are in wiki/SharedContracts.md; the partition boundaries are in wiki/DependencyMap.md. Both are referenced from every workplan and from each sister repo's INTENT.md.

Repository layout

src/
  shared/   # vocabulary, types, pure helpers      → becomes part of citation-engine
  engine/   # services, repositories, event bus    → becomes part of citation-engine
  anchor/   # selector creation/resolution, viewer adapter contract → becomes evidence-anchor
  source/   # ingest, fingerprint, extraction, recovery → becomes evidence-source
  binder/   # evidence-to-target binding, visual guide → becomes evidence-binder
  work/     # review UI (sidebar, viewer shell)    → becomes citation-work
  app/      # the reference workspace shell        → stays in citation-evidence

The dependency-edge rules between partitions are enforced by ESLint via eslint-plugin-boundaries (see eslint.config.js). Extraction to a sister repo is intended to be a git mv plus a package.json cut — nothing more.

Sister repos

Peers under ~/; each holds INTENT.md only during MVP:

Dev workflow

Requirements: Node 20 LTS (see .nvmrc) and pnpm 9.

pnpm install
pnpm dev        # vite dev server (once src/app/ has a real entry)
pnpm test       # vitest one-shot
pnpm test:watch
pnpm lint       # eslint with boundary rules
pnpm typecheck  # tsc --noEmit
pnpm build      # production bundle

Workplans (Ralph)

Workplans drive incremental implementation through the ralph loop. The harness lives in ~/ralph-workplan/; see workplans/README.md for the active list and ordering.

/ralph-workplan workplans/CE-WP-0001-foundations.md

The loop self-retires when every task in the file has status: done and the workplan's frontmatter status: done.

Description
document-centered evidence workspace for capturing, managing, presenting, and re-opening citations
Readme MIT-0 963 KiB
Languages
TypeScript 98.9%
CSS 0.6%
JavaScript 0.4%