Document Status Filtering, Header Add-Document Action, and Data Grid Pagination Improvements
Executive summary
This QA release bundles several Documents-area UX improvements cherry-picked together: documents can now be filtered by status and sub-status (instead of always showing only "Completed"), the "Add Document" action moves to the page header on the Documents and Batch Documents screens, the data grid gains a "Go" jump-to-page button and a refreshed floating pagination bar, inbox rows open the mail in a new tab on click, and buttons gain a built-in loading/spinner state.
Why this was needed
On the Batch Documents page the document list was hard-coded to a single "Completed" status, so users could not review documents in other workflow states or sub-states. The "Add Document" control was buried inside the grid toolbar, pagination on long lists was keyboard-only with no confirm button, and clicking an inbox row opened a side drawer rather than the mail itself. Bulk actions also gave no visual feedback while saving.
Client / user impact
- Users can switch documents between status and sub-status tabs, with the selection synced to the URL so views are shareable and survive refresh.
- "Add Document" is now consistently available from the page header on both the Documents and Batch Documents pages, and a successful upload refreshes the grid automatically.
- Long document/inbox lists get a "Go" button (with validation) next to the page input and a cleaner floating pagination bar.
- Clicking an inbox row opens that mail in a new browser tab and marks it as read, instead of opening the drawer.
- Action buttons (e.g. bulk status update) now show a spinner and are disabled while the request is in flight.
Technical scope
Cherry-pick consolidating several feature commits onto a temporary QA branch (no single feature PR number). Grounded in the diff:
- DocumentStatusFilter.tsx: heavy refactor — memoized status list, signature-guarded
setAvailableStatus, hardened URL/state initialization with first-child auto-select, and a new optionalrenderContent({ status, statusId, documentTypeId })render-prop; removes duplicate rendering. - batches/documents/page.tsx: derives
effectiveStatusIdfrom the document store (selectedStatus/selectedSubStatus), passes it to system/customuseGetPaginatedDocumentTypesqueries (replacing the fixedcompletedStatusId), resets selected document type when status changes, and wraps content inDocumentStatusFilterwithrenderContent. - documents/page.tsx & batches/documents/page.tsx: add
AddDocumentModaltoPageHeaderactions. - AddDocumentModal.tsx: invalidates
["documentsGrid"]queries on upload when noonDocumentAddedcallback is supplied. - DocumentGrid.tsx: removes the inline Add Document button, switches to full-height flex layout, sets
fullHeighton the grid. - data-grid.tsx: adds
openDrawerOnRowClickprop (gates drawer open and drawer render), extractsattemptJumpToPage+ adds a disabled-aware "Go" button, and restyles the floating/inline pagination layout. - InboxGrid.tsx: row click opens
/mails/{id}in a new tab viawindow.open, marks unread mail as read, withopenDrawerOnRowClick={false}. - button.tsx: adds
loading,loader,loaderPlacementprops with spinner andaria-busy/aria-disabled/disabledhandling; used inBulkUpdateStatusModal. - badge.tsx / array-badges.tsx / columns.tsx:
defaultbadge now uses secondary tokens, severaloutline/defaultusages switch tosecondary, and overdue/unread badge colors soften tobg-primary/20. - page-sidebar.tsx: collapse/expand icons swapped to
Menu/ChevronLeft. Also a non-product.claude/settings.local.jsonpermission tweak.
Risk & mitigation
Moderate, concentrated in shared components. data-grid.tsx, button.tsx, and badge.tsx are reused across many screens, so the styling and row-click/drawer behavior changes can have side effects beyond Documents. The DocumentStatusFilter effects were rewritten with new dependency arrays and guards; subtle status/sub-status selection or infinite-loop regressions are the main concern. Mitigation: the changes preserve existing prop defaults (openDrawerOnRowClick defaults to true, loading defaults to false), and this is staged on a QA branch for verification before promotion.
QA validation focus
- On Batch Documents, switch between status and sub-status tabs and confirm the grid and document-type counts update; verify the selected document type resets when status changes.
- Reload and share a filtered URL and confirm the same status/sub-status is restored.
- Add a document from the header on both Documents and Batch Documents pages and confirm the grid refreshes without a manual reload.
- In the inbox, click a row and confirm the mail opens in a new tab, is marked read, and no drawer appears.
- Use the pagination "Go" button with valid and invalid page numbers; confirm it is disabled when empty/invalid or only one page exists.
- Trigger a bulk status update and confirm the button shows a spinner and is disabled while saving.
- Spot-check grids/inbox elsewhere for any unintended badge color or row-click/drawer regressions from the shared-component changes.