All updates
QAFrontend

Mail: faster large document splits, secure document previews, and multi-file uploads (QA)

PR #1036pixbox-supportJun 1, 2026 · 07:50 UTC
QAJun 1, 2026

Executive summary

A batch promotion of the Mail frontend dev branch into qa, bundling three user-facing improvements plus one CI cleanup. Document-upload page splitting is faster and smoother for large PDFs, document and upload previews now load reliably through securely signed Filestack links, and users can upload and review multiple documents in a single flow.

Why this was needed

Several pain points had accumulated on the Mail document workflow: splitting a large PDF into many ranges caused the editor to lag and the scrollbar to jump because each range rendered its own PDF thumbnails. Separately, document and upload previews could fail with a "proper credentials were not provided" message because preview links were sometimes built without the required signed policy/signature, and switching between documents could briefly show the previous file. The upload flow also only handled a single document at a time.

Client / user impact

Internal and client users splitting large mail batches into document ranges get a responsive, stable editor instead of a janky, jumping list. Document previews (in the document detail pages, the upload screen, and the resolution center) now render dependably and stay in sync with the selected document. Users can also upload several documents at once and page through them in the preview, reducing repetitive uploads.

Technical scope

Frontend-only changes in apps/mail:

  • Large-range editor (PR #1034, closes #1033): above 10 ranges, switch from the thumbnail card grid to a virtualized, canvas-free row editor (DocumentSegmentRowList + DocumentSegmentRow) with fixed-height rows so scroll position stays stable; previews open on demand in a shared RangePreviewDialog modal (at most one range's pages rendered at a time). Range generation batched into single store updates; range-edit logic shared via useSegmentRangeDraft.
  • PDF worker: centralized setupPdfWorker using a bundler-native new URL(...) asset reference to fix the Turbopack "fake worker" main-thread fallback.
  • Signed previews (PR #1031, #1035): preview URLs built via buildSignedCdnUrl(handle, policy, signature); unsigned fallbacks removed and a new getDocumentViewerUrl helper used on the document detail pages and resolution DocumentPreviewPanel. Surfaces credential-loading and error states.
  • Multi-document uploads (PR #1035): FilePreview gains prev/next navigation for multiple files; supporting changes in document.services.ts, document-utils.ts, and add-document/add-batch modals.
  • Preview sync fix: detail pages clear route-scoped state on documentId change so a prior document's preview cannot linger.
  • Chore: removed legacy .github/workflows/claude.yml CI workflow.

Risk & mitigation

Moderate. The document-upload rendering path was substantially refactored (a net layout switch at the 10-range threshold) and preview links changed from unsigned to signed, so a credential or threshold regression could affect previews or the splitting UI. Mitigations: the card grid is preserved at <=10 ranges (no regression for the common case), only one range renders at a time via the modal, and credential failures now surface explicit error/loading states rather than a broken iframe. The CI workflow removal has no runtime impact.

QA validation focus

  • Split a large PDF into more than 10 ranges: confirm the compact row list scrolls smoothly with no scrollbar jumping, and that automatic, custom, and duplicate range generation work.
  • With 10 or fewer ranges, confirm the thumbnail card grid still renders as before.
  • Open the per-range preview modal and verify it shows the correct start/end pages and releases when closed.
  • Open document previews on the document detail pages, the upload screen, and the resolution center: confirm they load (no "proper credentials were not provided" error) and refresh correctly when switching documents.
  • Upload multiple documents in one flow and page through them with the prev/next navigation.
  • Verify edit/save payload and saved range shape are unchanged.