Review Tables: Matter Document Review template and row-to-task launch, end to end

Two merged PRs together make document triage actionable in zgbrenner/gary. The first renames Tabular Review to Review Tables and adds an eight-column U.S. legal intake template; the second wires the Suggested Saved Legal Task column to open the assistant directly from a row.

workflowdiscovery

06f80d8 handles the rename and the template. User-visible "Tabular Review" strings become "Review Table" across the sidebar, tabs, modals, and empty states; internal type names and routes are left alone. The Matter Document Review template defines eight columns: Document Name, Type, Date, People/Parties, Short Summary, Key Issues, Suggested Saved Legal Task, and Needs Attorney Review. Column prompts are conservative by design - use only the uploaded document, write "Unknown" when a value is missing, never make a definitive privilege call, default the attorney-review flag to Yes whenever the document touches rights, deadlines, filings, or sensitive data. The test file matterReviewTable.test.ts (264 lines) covers workflow registration, column order, tag sets, and the absence of legacy wording.

b01092b closes the loop. The Suggested Saved Legal Task column is no longer informational only. Clicking the cell opens a detail panel; if the value matches one of the eight built-in task names (after normalization for whitespace, case, and tag-pill brackets), a Run Suggested Task button appears. The confirmation modal previews the prompt before anything opens. On confirm, Gary creates a chat in the review's matter (or standalone), stores a newChatDraft carrying the prompt text, task workflow, and document attachment, then navigates to the assistant. The draft seeds the chat input; nothing auto-sends. Raw internal IDs do not appear in the prompt text.

suggestedTask.ts (151 lines) holds the name-to-id mapping and normalization, with a 261-line test file asserting each ID resolves to a real built-in workflow. The context plumbing uses a useRef to capture the draft on mount and clears it immediately so it cannot bleed into a later chat session.

So what The two-step flow (extract to table, then launch task from a row) is a coherent triage pattern. The cautious column-prompt design and the staged-draft approach (prefill without auto-send) are both worth examining for any product that connects AI extraction to AI action. The rename itself is Gary-specific; the template structure and the row-launch mechanism are the parts with broader applicability.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

4 commits from zgbrenner/gary, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
42ef29ea Merge pull request #2 from foolish-bandit/claude/gary-us-simplification-AjDDT Zack Brenner 2026-05-19 ↗ GitHub
Add Matter Document Review template and lawyer-friendly Review Table
a23d4303 Merge pull request #5 from foolish-bandit/claude/gary-us-simplification-AjDDT Zack Brenner 2026-05-19 ↗ GitHub
Run a Saved Legal Task from a Review Table row
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.
b01092b7 feat: run a Saved Legal Task from a Review Table row Claude 2026-05-20 ↗ GitHub
commit body
Make the "Suggested Saved Legal Task" column actionable. When Gary
suggests a recognized task for a document, a lawyer can launch that
task in the assistant prefilled with the row's context.

- suggestedTask.ts: maps the eight recognized task names to built-in
  Saved Legal Task ids. Matching tolerates whitespace, case, tag
  brackets, and trailing punctuation but is never fuzzy - an
  unrecognized value resolves to null rather than guessing. Also
  builds the row-context prompt (task name, matter, document name,
  extracted fields, and attorney-review safety language).
- RunSuggestedTaskModal.tsx: a simple "Run Saved Legal Task?"
  confirmation with a prompt preview and Open in Assistant / Cancel.
- TRSidePanel: shows a "Run Suggested Task" action - only on the
  Suggested Saved Legal Task column's cell, and only when the value
  resolves to a recognized task and the cell has finished generating.
- TabularReviewView: resolves the row's suggested task, builds the
  row-context prompt from the row's other cells, and on confirm
  creates a chat, prefills an assistant draft, and opens it.
- Prefill, not auto-run: a new newChatDraft channel on
  ChatHistoryContext carries a draft (content + workflow + attached
  document) that ChatInput seeds its initial state from. The lawyer
  reviews and sends manually - nothing is auto-submitted. ChatView
  renders an empty-with-draft chat instead of the loading skeleton.
- The row's document is attached via the existing chat file
  mechanism; the document_id rides in the attachment, never in the
  visible prompt text. No raw internal ids appear in the prompt.
- Safety: the prompt instructs Gary to treat the row as draft and
  unverified, use the uploaded document, not invent facts / dates /
  legal authorities / deadlines / parties, and flag uncertainty.
- Docs: add "Running a Saved Legal Task from a Review Table" to the
  U.S. lawyer guide; add a terminology-map entry.
- Tests: suggestedTask.test.ts covers the eight-task mapping (and
  that each id is a real assistant built-in), match tolerance, the
  no-fuzzy-match guarantee, blank/Unknown/None handling, the prompt's
  attorney-review language, Unknown fallbacks, and the absence of raw
  internal ids and legacy terminology.

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-534.md from inside the repo you want the changes in.

⬇ Download capture-thread-534.md