QA Build (7 Oct 2025): Mail Sharing Attachments, Cleaner Mail & Document Screens, and a Codebase Hardening Pass
Executive summary
This QA build bundles several merged changes (PRs #495, #496, #467, #498, #499, #497). The headline user-facing addition is file attachment support when sharing mail externally by email. It also tidies up the mail and document detail screens, fixes data-grid filter/search resets when switching status, and includes a large internal type-safety and dead-code cleanup that improves stability without changing behavior.
Why this was needed
Two needs drove this build. First, users sharing mail outside the system by email could not include file attachments — the capability existed only as disabled, commented-out code. Second, the codebase had accumulated loose typing (any), disabled lint rules, dead pages, and unfinished UI (e.g. a non-functional inline "Edit Details / Save Changes" control on the mail detail screen). Cleaning these up reduces the chance of silent runtime errors and removes confusing half-built controls before they reach users.
Client / user impact
- Users can now attach files when sharing mail externally via email, with file-type icons, attachment badges, and a remove control.
- The data grid more reliably clears filters and search text when the status changes, so stale filters no longer hide results.
- The mail detail screen no longer shows a non-working inline "Edit Details / Save Changes" control, and the organization switcher now shows subclient and client name for clearer context.
- Most changes are internal hardening; end users should see steadier behavior and fewer edge-case errors rather than new screens.
Technical scope
- Mail sharing attachments (PR #499 / feat-mail-details-bonus): activated the previously commented-out attachment block in
ShareViaMailDialog.tsx, wiring in Paperclip/Image/File icons, attachment badges, and remove (X) actions. - Mail & document detail cleanup: removed the unfinished inline edit/save UI from
batches/mails/[id]/page.tsx; deleted the legacy 938-line(dashboard)/mails/page.tsxgrid and droppedMailContextProviderfrom the mails layout; converted the document viewer's idle-preload fromany-typedrequestIdleCallbackshims to typed fallbacks. - Add Mail / Address Manager refactor: exported typed option models (
ContactOption,DepartmentOption,OrganizationOption,SenderOrRecipientDetails) fromMailForm, added safe option normalization inAddMailsModal, rebuiltAddressManagerwith typed address records, and threaded anisEditingprop throughMailOverview. - Data grid filter reset (PR #497): added a
resetOnStatusChangeprop (clearFilters/clearSearch) todata-grid.tsxand stabilized grid search-reset handling. - Comments system (PR #498): tooltip for deleted users, hardened mention handling, and removed
anyacrossCommentsDrawer,ThreadView,MessageBubble, and mention utilities. - Type-safety / lint pass (PRs #496, #467): removed
anyandeslint-disableheaders across auth, dashboard, admin hub, column filters, export modal, and rich-text editor; swapped<img>fornext/imageinFilePreview; deleted deadsrc/actions/auth-action.ts. - Docs/config (PR #495): added coding rules to
AGENTS.md(no hard-coded values, mandatorypnpm lint, ban onany), addedCLAUDE.md/GEMINI.mdsymlinks, and movedBROWSER_NOTIFICATIONS.mdintoai_docs/.
Risk & mitigation
Moderate breadth, low-to-moderate risk. The change touches ~100 files (2,574 additions / 4,344 deletions), but the bulk is type tightening and dead-code removal rather than new logic. Main risks: (1) deleting the standalone /mails grid page and the mail context could break any lingering links or shared state that depended on them; (2) the new resetOnStatusChange grid behavior could over-clear or under-clear filters in unexpected views; (3) the newly enabled attachment flow is brand-new functionality and needs end-to-end validation. Mitigation: this reached the QA branch (not Production) specifically so these paths can be exercised before promotion.
QA validation focus
- Mail external share: open Share via Email, add and remove attachments, verify icons/badges render and the email sends successfully with attachments.
- Data grids: switch status filters on mail/batch/document grids and confirm filters and search clear correctly and results refresh.
- Mail detail screen: confirm the old inline "Edit Details / Save Changes" control is gone and the overview/resolution tabs still work.
- Add Mail / Address Manager: create a mail, select organizations/departments/contacts as sender and recipient, and confirm options load and save without errors.
- Comments: verify mentions still resolve, deleted-user comments show a tooltip, and threads render.
- Regression sweep: smoke-test login/auth, dashboard notifications, document viewer/file preview, and the organization switcher (subclient + client name display).