Add Matter Document Review template and lawyer-friendly Review Table

✅ merged · #2 · zgbrenner/gary ← zgbrenner/gary · opened 7d ago by zgbrenner · merged 7d ago by zgbrenner · self · +538-37 across 18 files · ↗ on GitHub

From the PR description

Summary

Make uploaded matter documents easier for U.S. lawyers to understand and organize. Lightweight - reuses the existing Tabular Review / column-config plumbing rather than building a new system.

  • Rebrand: every user-visible "Tabular Review / Tabular Reviews" string becomes "Review Table / Review Tables" - sidebar, project tabs, modal breadcrumbs, page titles, empty states, owner-only-action messages, workflow-builder helper text. Internal type names and /tabular-reviews routes are unchanged.
  • New empty state: both the standalone Review Tables page and the per-matter Review Tables tab now show the lawyer-friendly empty state - title "Start a Review Table", body about organizing uploaded documents into a table with dates/types/people/summaries/issues, primary button "Create Review Table", secondary note "Review all extracted information before relying on it."
  • New built-in template: Matter Document Review (id builtin-matter-document-review) with eight default U.S. legal columns: Document Name, Document Type, Date, People / Parties, Short Summary, Key Issues, Suggested Saved Legal Task, Needs Attorney Review. Column prompts are cautious - use only the uploaded content, do not invent, "Unknown" when missing, default Needs Attorney Review to Yes when uncertain or when the document touches legal rights/privilege/deadlines/filings/settlement/sensitive data. The Suggested Saved Legal Task tags map directly to the eight Saved Legal Tasks (Contract Review, Litigation Memo, Case Chronology, Discovery Summary, Deposition Prep, Demand Letter Draft, Client Intake Summary, Privilege Review, or None).
  • Smart default: launching the create-review modal from inside a matter pre-selects Matter Document Review and pins it to the top of the tabular-template dropdown.
  • Friendly failure: if create fails, a dismissible inline banner reads "Gary could not create the Review Table. Check your AI connection and try again."
  • Persistent attorney-review reminder above every Review Table: "Draft for attorney review. Review all extracted information before relying on it. Do not treat any cell as verified fact, legal advice, or a definitive privilege call."

How the Review Table now works

  1. Open a matter and click the Review Tables tab (or pick Review Tables from the sidebar).
  2. Click Create Review Table. Inside a matter the Matter Document Review template is preselected and the matter's documents are pre-checked.
  3. Submit. Gary opens the review page; click Run to populate cells.
  4. The amber banner near the top reminds the user this is a draft for attorney review.
  5. Cells are editable, so the lawyer can correct anything Gary got wrong.

Default columns

# Name Format Notes
0 Document Name text filename or first-page title
1 Document Type tag Contract / Email / Pleading / Discovery Response / Deposition Transcript / Court Order / Memo / Invoice / Corporate Document / Other / Unknown
2 Date date primary date; "Unknown" if unclear; do not guess
3 People / Parties bulleted_list names + roles only
4 Short Summary text 1-3 sentences, plain English
5 Key Issues bulleted_list factual / procedural items for attorney attention
6 Suggested Saved Legal Task tag one of the 8 tasks, or "None"
7 Needs Attorney Review yes_no defaults to Yes when uncertain

Where Create Review Table appears

  • Standalone Review Tables page: empty-state button → opens AddNewTRModal.
  • Per-matter Review Tables tab: empty-state button and the existing toolbar + action → both open the modal with the matter's docs pre-selected and Matter Document Review pre-chosen.

Safety / attorney-review guardrails

  • Workflow prompt: "Use ONLY the uploaded document content and user-provided context. Do NOT invent dates, people, parties, document types, citations, or events. Do NOT make legal conclusions. Do NOT determine privilege definitively. Use Unknown when information is missing. This is a draft for attorney review, not legal advice."
  • Per-column prompts repeat the relevant guardrail (e.g., Date: "do not guess"; Document Type: "Use Other / Unknown if you are not confident. Do not invent a category.").
  • Needs Attorney Review explicitly "Default to Yes whenever the document touches legal rights, privilege, deadlines, court filings, settlement terms, sensitive personal data, or anything you are unsure about."
  • Amber attorney-review reminder banner on every Review Table page.
  • Cells remain editable; no extracted value is treated as verified truth.

Row-to-task linking - deferred

The Suggested Saved Legal Task column is informational only in this PR. Launching the matching Saved Legal Task from a row is documented as a follow-up; the docs say so explicitly so users aren't surprised.

Tests

  • frontend/src/app/components/workflows/matterReviewTable.test.ts (new) - 9 focused tests: workflow registration, default columns + order, Document Type tag set, Saved Legal Task tag set + presence of "None", Needs Attorney Review is yes_no and defaults to caution, workflow prompt contains "do not invent" + "Unknown" + "do not determine privilege definitively", per-column prompts instruct caution / "do not guess", no legacy "Tabular Review" / "Workflow Template" wording remains in built-in workflows, practice category matches the supported U.S. list. All 9 pass.
  • Existing builtinWorkflows.test.ts and exportDraft.test.ts still pass.

Validation

  • Backend: bun run build - clean.
  • Frontend: bun run build - TypeScript compilation succeeds (Compiled successfully in 12.8s, Finished TypeScript in 9.7s). The Next.js static prerender of /account/models fails with Error: supabaseUrl is required. - that's the expected codespace failure mode because no Supabase env vars are configured here, and is unrelated to these changes.
  • Frontend: bun run lint - same error count before and after (43). The new test file contributes no new lint issues.

Recommended next PR

  • Wire Suggested Saved Legal Task so clicking a row's tag launches the matching task in the assistant with that document pre-attached.
  • Add a small per-row Action menu in the Review Table for "Run as Privilege Review", "Add to Case Chronology", etc.
  • Quick filter / view in the project Documents tab to show only documents already in a Review Table.

Test plan

  • Sidebar shows "Review Tables" (not "Tabular Review").
  • Empty matter Review Tables tab shows the new title/body/button.
  • Clicking "Create Review Table" from an empty matter pre-selects Matter Document Review and pre-checks the matter's docs.
  • Submit → table page opens; the amber attorney-review banner is visible above the table.
  • Click Run → cells populate; "Needs Attorney Review" tends to Yes; cells are editable.
  • Force a failure (e.g., disconnect the AI key) → the dismissible "Gary could not create the Review Table..." banner appears in the project tab.
  • bun run frontend/src/app/components/workflows/matterReviewTable.test.ts reports 9/9 passes.

https://claude.ai/code/session_01LNzU9cGoR4SsYXon8H7aJZ


Generated by Claude Code

Our analysis

Rebrand Tabular Review to Review Tables and add a U.S. matter-document template — read the full analysis →

Think the analysis missed something the PR description covers?

Commits in this PR (1)

SHA Subject Author Date
06f80d85 feat: add Matter Document Review template and lawyer-friendly Review Table Claude 2026-05-19 ↗ GitHub
commit body
Lightweight improvements to make uploaded matter documents easier to
understand at a glance.

- Rebrand the user-visible "Tabular Review / Tabular Reviews" copy to
  "Review Table / Review Tables" across the sidebar, project tabs,
  modal headers, breadcrumbs, page titles, owner-only-action messages,
  and the workflow-builder helper text. Internal type names and routes
  are unchanged.
- Rewrite both empty states to match the lawyer-friendly direction:
  title "Start a Review Table", body about Gary organizing uploaded
  documents into a table with dates, document types, people,
  summaries, and follow-up issues, primary button "Create Review
  Table", and a secondary note "Review all extracted information
  before relying on it."
- Add a built-in tabular workflow "Matter Document Review" with eight
  default U.S. legal review columns: Document Name, Document Type,
  Date, People / Parties, Short Summary, Key Issues, Suggested Saved
  Legal Task, and Needs Attorney Review. Column prompts are cautious:
  use only the uploaded content, do not invent, write "Unknown" when
  missing, default "Needs Attorney Review" to Yes when uncertain or
  when the document touches legal rights / privilege / deadlines /
  filings / settlement / sensitive data. The Suggested Saved Legal
  Task column tags map to the eight built-in Saved Legal Tasks.
- Pre-select Matter Document Review when launching the create-review
  modal from inside a matter, and pin it to the top of the tabular
  template dropdown.
- Surface a plain-English failure on create ("Gary could not create
  the Review Table. Check your AI connection and try again.")
  via a dismissible inline banner in the project Review Tables tab.
- Add a persistent attorney-review reminder banner above every Review
  Table: "Draft for attorney review. Review all extracted information
  before relying on it. Do not treat any cell as verified fact, legal
  advice, or a definitive privilege call."
- Document the Review Table flow in the U.S. lawyer setup guide and
  add a terminology-map entry for Matter Document Review.
- Add focused tests covering the new workflow's columns, tags,
  cautious prompts, and the absence of legacy "Tabular Review" /
  "Workflow Template" copy in built-in workflows.

Row-to-Saved-Legal-Task launching from a row is intentionally deferred
to a follow-up PR; the Suggested Saved Legal Task column is purely
informational today and is documented as such in the setup guide.

Capture this PR into my fork

Download a Markdown prompt that tells Claude how to port every commit in this PR into your working tree. Run it via claude -p < capture-pull-2.md from inside the repo you want the changes in.

⬇ Download capture-pull-2.md