Admin Hub Edit Folder pre-fill fix and reliable "+N" array pop-ups across grids
Executive summary
This release reaches QA and bundles two front-end improvements: the Admin Hub "Edit Folder" dialog now loads complete folder details (assigned users, departments, labels, status) so the form opens correctly pre-filled, and the "+N" pop-up that lists extra tag/array values now works consistently across the Mail, Inbox, and Document grids without accidentally opening the row side-panel when it is closed. The batch also includes code-formatting cleanup with no behaviour change.
Why this was needed
Two recurring usability gaps were addressed. The Edit Folder modal previously relied only on the limited folder data carried by the grid row, so assigned users, departments and other details were sometimes missing or stale when the dialog opened. Separately, when a user closed the small "+N" pop-up listing additional array values in a data grid, the click could fall through to the row underneath and unexpectedly open the detail drawer.
Client / user impact
Administrators editing a folder now see the dialog reliably populated with the folder's current users, departments, labels and active status, reducing the risk of accidental changes. Across the Mail, Inbox, Document and batch grids, users can open the "+N" pop-up to view the full list of values and close it cleanly, without the side drawer popping open by mistake.
Technical scope
- Edit Folder details fetch (PR #404):
EditFolderModal.tsxnow callsuseGetFoldersList({ folder_id, include_departments, include_users, enable_pagination: false })and uses the returned record (falling back to the row prop) to seed the form and the assigned/available department lists. - Folder query plumbing: added a
folder_idoption touseGetFoldersList(Folders.queries.ts) and passed it through to the API query infolders.services.ts. - "+N" array pop-up fix (PR #403): introduced a global
window.__dsmSuppressRowClickflag set when theArrayBadgesdialog or its overlay closes (array-badges.tsx,ui/dialog.tsx), and honoured in the grid rowonClickguard (data-grid.tsx) to suppress the click-through that opened the drawer. - Wired the array pop-up into more grid columns: Mail grid, Inbox grid, batch Mail/Document tab columns.
- Large diff in
DocumentGrid.tsxand parts ofEditFolderModal.tsxis predominantly Prettier/quote-style reformatting, not logic change.
Risk & mitigation
Low to moderate. The row-click suppression uses a shared window-level flag plus a 0/200ms timeout and a capture-phase one-time click handler; mistimed events could in theory swallow a legitimate row click immediately after closing the pop-up. The Edit Folder change adds an extra folders API call gated on folder_id and modal open, with a fallback to existing data. The heavy reformatting in DocumentGrid.tsx enlarges the diff but should not change behaviour. Mitigation: focused QA on grid row interactions and folder editing.
QA validation focus
- Open a folder in Admin Hub > Folders and confirm name, description, status, labels, assigned users and assigned/available departments are all correctly pre-filled.
- Verify saving folder details, users and departments still works and refreshes the list.
- In Mail, Inbox, Document and batch grids, click a "+N" badge to open the value pop-up; close it (via the close button and by clicking the overlay) and confirm the row drawer does NOT open.
- Immediately after closing the pop-up, click a different row and confirm the drawer opens normally (no over-suppression).
- Regression-check Document grid rendering, sorting and filtering given the large refactor of
DocumentGrid.tsx.