Citation chips and keyword chips in the tabular cell side-panel
nwhitehouse extended the tabular cell detail view with two chip types: citation chips that jump the doc viewer to the cited page, and keyword chips that drive the doc-search input. Four commits landed over a day, with three of them fixing issues found from running the feature on real data.
The extraction prompt gains a keywords field: an array of 3-5 short phrases a reviewer would type into a doc-search box, explicitly prompted to prefer verbatim or near-verbatim terms from the document and skip generic words like "provision" or "agreement". The worker sanitizes the output through sanitiseKeywords (trim, dedupe case-insensitively, drop strings under 2 characters, cap at 5, max 60 chars each) before storing. No migration needed - the field piggybacks on the existing tabular_cells.content jsonb column.
The missed-plumbing bug came quickly: parseCellContent in routes/tabular.ts had a hard-coded 3-field shape (summary, flag, reasoning) that silently dropped keywords from the GET response. The worker stored them correctly; they never reached the frontend. The fix updates parseCellContent and adds a sanitiseKeywordsForResponse function - deliberately duplicated from the worker-side sanitiser rather than imported, with a comment noting to keep them in sync by hand.
Citation chip labels were initially rendered as "Page 1 · p1" for every citation, useless when all citations are on the same page. The updated chipLabel() tries a section reference match first (Section 2.06, § 4.1), then falls back to the first ~40 characters of the quote in curly quotes, and only uses "Page N" when the quote is empty.
The fourth commit addresses an LLM compliance failure on the "Parties" column: the model described three parties in prose without emitting any [[page:N||quote:...]] markers. The prompt was tightened with a concrete worked example - "ACME CORP [[page:1||quote:ACME CORP]] and BETA INC [[page:1||quote:BETA INC]]" - and an explicit ban on prose page references like "(Page 5)". As a frontend safety net, extractProsePageRefs was added to synthesize quoteless ParsedCitation objects from "Page N" / "p. N" / "pp. N" patterns in cell text, preserving the page-jump affordance for legacy cells and under-citing model responses.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?