Tabular column management: hide, reprocess per-column, delete with confirm

nwhitehouse added the column-level actions that become necessary once a tabular review has more than a handful of columns: per-column reprocess, delete with a confirmation modal that names the column and counts cells, and per-device localStorage-backed column visibility. Three commits, with two of them relocating the manage-columns UI after user feedback.

discoverycontract-review

POST /tabular-review/:reviewId/reprocess-column wipes the target column's cells back to pending and creates a new tabular_jobs run via the existing worker pool. The worker's "skip done cells" filter naturally picks up the freshly wiped rows without any new worker logic. The endpoint returns 409 if a job is already in flight on the review, which prevents the worker pool from racing against cells being wiped mid-run.

DELETE /tabular-review/:reviewId/columns/:columnIndex removes the column from columns_config and deletes its tabular_cells rows. Hard delete, no undo. The response includes the updated columns_config so the frontend can rerender without a follow-up fetch. Both endpoints reuse ensureReviewAccess and the existing document-filter helpers.

On the frontend, hidden column state lives in localStorage keyed by (review, device). This is the right default for an ephemeral view setting - no server round-trip, resets cleanly if the user switches devices. The ColumnVisibilityMenu component (sliders icon, Show all / Hide all bulk actions, per-column eye toggle + format pill + trash icon) landed in the table header in the first commit, then moved to the main toolbar in the second after user feedback that the header was the wrong place. Two-commit thrash, but the final position makes sense and matches the workflow-toolbar pattern elsewhere in the UI.

One dependency: this feature can't land without the bug-007 job/worker infrastructure first. The reprocess endpoint creates a job via createGenerateJob(); without the worker pool running, the wiped cells just sit there.

So what Worth importing if your fork has tabular review with more than a few columns. The reprocess-column endpoint reuses an existing job pool cleanly - that's the part that's genuinely hard to design from scratch. The localStorage visibility pattern is a good default. Import after the bug-007 job machinery is already in place, and note that the popover z-index issue surfaced here is fixed in the feat-023 cluster.

View this fork on GitHub →

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

Commits in this thread

3 commits from nwhitehouse/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
bbfdda82 [feat-021] Tabular column management: hide, reprocess, delete-with-confirm Nick Whitehouse 2026-05-07 ↗ GitHub
commit body
Adds the actions a real user needs once a review crosses ~5 columns:

Backend:
- POST /tabular-review/:reviewId/reprocess-column { columnIndex }
  Wipes the column's cells back to status='pending', then creates a
  tabular_jobs run via the existing bug-007 worker pool. The worker's
  existing "skip done cells" filter naturally re-processes them. Refuses
  with 409 if a job is already in flight on this review (workers would
  race against the wipe).
- DELETE /tabular-review/:reviewId/columns/:columnIndex
  Drops the column from columns_config and deletes its tabular_cells
  rows. Returns the canonical updated columns_config.
- Both endpoints reuse the existing ensureReviewAccess + filter
  helpers - no new auth surface.

Frontend:
- TREditColumnMenu picks up onHide + onReprocess props. New "Hide
  column" and "Reprocess" quick-action buttons in the edit panel
  header. New "Reprocess this column after save" checkbox next to
  the Save button (Save & reprocess label when checked).
- TabularReviewView tracks hiddenColumnIndices in localStorage keyed
  by review id (per-(review, device)). visibleColumns is the filtered
  set passed to TRTable. Toolbar grows a compact "N hidden - Show all"
  button that restores in one click.
- Delete now opens an inline confirmation modal that names the column
  and counts cells about to be deleted, instead of being instant.
- Reprocess kicks off the existing pollJob loop so the run-button shows
  N/total live, same UX as a full generate.

API helpers added: reprocessTabularColumn, deleteTabularColumn.

No schema changes. tsc clean both sides; all 16 backend tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
00c3af8d [feat-021] Manage Columns popover next to + Add column Nick Whitehouse 2026-05-07 ↗ GitHub
commit body
User feedback on the per-column ⋯ menu: clunky for managing many
columns at once. Adds a centralised manager that mirrors what
work___ does - a sliders-icon button next to + Add column that opens
a popover with:

- "N of M shown" header
- Show all / Hide all bulk actions
- Per-column row: eye toggle (show/hide), name, format pill (TEXT,
  DATE, YES_NO etc.), trash icon (opens the existing confirm-delete
  modal)
- Hidden columns render line-through + EyeOff icon for clarity

The per-column ⋯ menu's Hide / Reprocess / Save & reprocess affordances
stay - they're still useful for one-off actions. The new menu is the
"manage everything at once" surface.

Component: ColumnVisibilityMenu.tsx. Renders inside TRTable next to the
+ button. Visibility state is owned by TabularReviewView (localStorage-
backed); the new menu is a controlled view over props.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5a03ee69 [feat-021] Move manage-columns menu into the toolbar (left of Add Documents) Nick Whitehouse 2026-05-07 ↗ GitHub
commit body
The sliders icon was inside the table header next to the + Add column
control - the user pointed out it's the wrong place. Moved into the main
toolbar, sitting just before the "+ Add Documents" / "+ Add Columns"
group, matching the layout pattern from work___.

- Removed ColumnVisibilityMenu render + its 5 props from TRTable.
- Removed the import from TRTable.
- Added the import + render in TabularReviewView's toolbar, with the
  same handlers wired (handleToggleColumnVisibility, handleShowAllColumns,
  handleHideAllColumns, handleDeleteColumn).
- TRTable's column-header row goes back to its original layout (just
  the + Add column button) - no behavioural change there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

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-152.md from inside the repo you want the changes in.

⬇ Download capture-thread-152.md