Mail & Vendor: Permission-Aware Batch Actions, Notification Dropdown Polish, and Vendor File-List Fixes
Executive summary
This QA release rolls up ten frontend fixes and small enhancements across the Mail and Vendor apps. The headline changes hide batch editing and assignment controls from users who lack the edit_batch permission, make batch-assignment notes optional, polish the notification dropdown, and fix several Vendor "View Files" issues (search, pagination, horizontal scroll) plus the file-details Back button.
Why this was needed
Users without batch-edit rights were still shown Edit Batch, Assign User, and bulk Update Client/Subclient controls, which is misleading and risks failed actions. Batch assignment always stamped a hardcoded "Assigned from the UI" note. In the Vendor View Files modal, client-side filtering was hiding valid backend search results, the file list lacked pagination, and the table would not scroll horizontally. The file-details Back button also broke when the page was opened in a new browser tab (no history to return to).
Client / user impact
- Batch action menus, drawers, and bulk toolbars now only surface Edit/Assign/Update controls to users who hold
edit_batchpermission. - Batch assignment no longer records a misleading default note; notes are saved only when the user enters one.
- Vendor users can search the View Files modal and reliably see matching results, page through large file lists, and scroll the table horizontally.
- The file-details Back button works whether the page was reached in-app or opened in a new tab.
- Notification dropdown is clearer (permission-denied messaging, always-available "View all notifications" link) and more usable on mobile; full task IDs in the Vendor tasks table can be copied on hover.
Technical scope
Frontend-only dev -> qa batch (15 files, +268/-140) across apps/mail and apps/vendor. Notable changes:
- Mail permissions:
BatchActions.tsx,BatchContents.tsx,columns.tsx, anddrawer-actions/batch-actions.tsgate Edit Batch / Assign User / bulk Update Client/Subclient behind a newhasEditBatchPermissionflag (visible()predicates + conditional render). - Mail batch notes:
batches.services.tsandbatch.mutation.tsadd an optionalnotesparam toassignUsertoBatch; the hardcoded "Assigned from the UI" note is removed and notes are sent only when non-empty. - Mail notifications:
notification-dropdown.tsxandnotifications/page.tsxadd a permission-denied message viauseNotificationPermission, replace the unread-page auto-fetch loop with a guarded effect, always render the "View all notifications" link, fix hover text disappearing, and reflow stats to a mobile-first layout. - Mail forms:
select.constants.tsandMailForm.tsxadd flex-wrap / truncation to AsyncPaginate multi-select pills anditems-startto form grids;AddBatchModal.tsxdisables Submit until Priority is selected. - Vendor View Files (
ViewFilesModal.tsx): adds page/pageSize/total state and reusesPaginationToolbar; removes redundant client-side filtering so backend search results show; resets page on filter change; setsmin-w-[1000px]andoverflow-autoto restore horizontal scroll. - Vendor file details (
files/[mailId]/page.tsx): breadcrumb uses Next.jsLink;handleBackfalls back to/whenwindow.history.length <= 2(new-tab case). - Vendor tasks (
TasksTab.tsx): newCopyableTaskIdshows the full UUID with copy-on-hover instead of a truncated id.
Risk & mitigation
Low-to-moderate. Risks are localized to the touched surfaces: incorrect permission checks could over- or under-hide batch controls, and ViewFilesModal now relies entirely on the backend WebSocket for search/pagination, so a backend pagination/search gap would surface here. Mitigation: changes are scoped, additive, and stopped at QA before Production; verify permission gating against both permissioned and non-permissioned users and confirm View Files paging returns correct totals.
QA validation focus
- Mail: as a user WITHOUT
edit_batch, confirm Edit Batch, Assign User, and bulk Update Client/Subclient are hidden in grid dropdown, drawer, and bulk toolbar; as a user WITH it, confirm they appear. - Mail: assign a user to a batch with and without notes; confirm no "Assigned from the UI" default and notes save only when entered.
- Mail: notification dropdown - deny browser notifications and check the message; confirm no infinite fetch when all read, the "View all notifications" link always shows, hover text stays visible, and mobile stats layout.
- Mail: AddBatchModal Submit stays disabled until Priority is chosen; multi-select pills wrap and truncate long values.
- Vendor: in View Files, search by filename/batch/mail status and confirm results show; page through multiple pages and verify totals; confirm horizontal scroll works.
- Vendor: open File Details in a new tab and confirm Back goes to Upload Centers; in-app, Back returns to the previous page.
- Vendor: tasks table shows full task ID and copies on hover.