PR: #529: feat(record): Document permalink page — PDF viewer + fact rail + hover-bar + notes [Story-2117] by @ankitmaheshwari-com
View PR →

Files changed

38 file(s), +2448 / -12 lines

Path Role + -
design/v1/colors_and_type.cssStyles+1-0
messages/en.jsonConfig+66-1
messages/hi.jsonConfig+66-1
package.jsonConfig+2-0
pnpm-lock.yamlConfig+191-0
src/app/[locale]/(workspace)/matters/[matterId]/record/doc/[documentId]/page.tsxApp route+56-0
src/app/globals.cssApp route+3-0
src/components/documents/register/register-document-row.tsxComponent+16-2
src/components/documents/register/register-table.tsxComponent+4-0
src/components/documents/register/register-view.tsxComponent+5-1
src/components/documents/register/saved-views-register.tsxComponent+14-1
src/components/documents/viewer/agent-note-card.tsxComponent+46-0
src/components/documents/viewer/citation-landing-pill.tsxComponent+44-0
src/components/documents/viewer/document-badges.tsxComponent+104-0
src/components/documents/viewer/document-control-bar.stories.tsxComponent+48-0
src/components/documents/viewer/document-fact-rail.stories.tsxComponent+63-0
src/components/documents/viewer/document-fact-rail.tsxComponent+162-0
src/components/documents/viewer/document-fact-row.tsxComponent+88-0
src/components/documents/viewer/document-margin-note.tsxComponent+33-0
src/components/documents/viewer/document-note-composer.tsxComponent+56-0
src/components/documents/viewer/document-note-item.tsxComponent+46-0
src/components/documents/viewer/document-notes.stories.tsxComponent+46-0
src/components/documents/viewer/document-page-canvas.tsxComponent+60-0
src/components/documents/viewer/document-pdf-viewer.tsxComponent+78-0
src/components/documents/viewer/document-processing-stages.tsxComponent+63-0
src/components/documents/viewer/document-text-pane.tsxComponent+49-0
src/components/documents/viewer/document-viewer-header.tsxComponent+98-0
src/components/documents/viewer/document-viewer-toolbar.tsxComponent+126-0
src/components/documents/viewer/document-viewer.stories.tsxComponent+122-0
src/components/documents/viewer/document-viewer.tsxComponent+179-0
src/components/documents/viewer/live-document-viewer-page.tsxComponent+113-0
src/components/documents/viewer/live-presentation.tsComponent+84-0
src/components/documents/viewer/types.tsComponent+107-0
src/components/documents/viewer/viewer-fixtures.tsxComponent+183-0
src/components/matter-detail/ccb/mira-control-bar.tsxComponent+10-0
src/components/shared/primary-button.tsxComponent+2-2
src/components/shared/secondary-button.tsxComponent+2-2
src/lib/surface-registry/route-registry.tsLibrary+12-2

Story-2117: Document permalink page — PDF viewer + card rail + paragraph hover-bar + notes

The document permalink — /matters/[matterId]/record/doc/[documentId] — is the document's three lives in one page: the Original PDF (dominant ~60% viewer), the extracted Text, and the "What matters here" rail of card facts pinned to their pages. The founder-approved Claude Design (pramaan-desk discussions/document-viewer/document-view.dc.html + PNGs) was lifted, not redesigned. Built Storybook-first, then wired to the one live data path that exists today (the presigned PDF), with honest typed seams for the contracts that don't (key facts, per-block bboxes, notes presentation).

What landed — Storybook (the merge-gate core)

A presentational component set under src/components/documents/viewer/, each token-clean, i18n'd (DocumentViewer namespace, en + hi) and motion-correct.

What landed — the live route

Honest seams (typed, non-blocking — per the story)

The card key-facts (CE-7) and per-block page/bbox + extracted-text (CE-17 / pages.json) have no mirrored contract yet, and the notes substrate's presentation fields (author display, paragraph anchor) are not merged. So live, the rail carries no facts, the viewer no Text tab or bbox highlight, and no notes — it degrades to the honest processing/empty state (live-presentation.ts, seams documented inline). The full designed experience — fact-click jump + highlight, hover-bar, composer, Keep/Dismiss — is proven in Storybook against fixtures and lights up when those contracts land. No pnpm codegen was run.

Verification

Live-data boundary: the PDF path is real end-to-end (presign → react-pdf). The rail's facts/text/highlight/notes are the documented seams above — the empty first-run state is the honest truth until CE-7 / CE-17 / the notes substrate land. The staging run to confirm on stg.app.pramaan.io is the component-boundary → system-boundary check: navigate from a real Record row to a real document's permalink and confirm the presigned PDF renders.