QA Promotion: Fewer Duplicate Network Calls, Form Fixes, and Developer Tooling
Executive summary
This release promotes a batch of frontend improvements to QA. The headline theme is eliminating duplicate and redundant API calls across Batches, Mail, and shared data grids so screens load more efficiently. It also bundles several form and grid bug fixes (organization, document, and mail forms) and adds in-house developer tooling that has no effect on the running product.
Why this was needed
Several screens were firing the same backend requests more than once — partly due to React Strict Mode remounting components in development and partly from manual refetch calls layered on top of automatic cache refreshes. Separately, a few forms had rough edges: empty values showing as blanks instead of 'N/A', a search box that responded too aggressively, file-name editing that re-selected text on every keystroke, and the organization form's 'None' option clashing with the underlying select control.
Client / user impact
- Batches, Mail, and grid-backed screens make fewer redundant calls to the backend, reducing flicker and load on the API.
- The mail create/edit form deduplicates its sender/recipient lookups, so typing in those pickers no longer triggers repeat searches.
- Grid detail drawers now show a clear 'N/A' for empty fields instead of blanks.
- Cleaner organization, document, and mail-document form behavior (selectable 'None', file-input reset, smoother filename editing).
- No customer-visible change from the developer-tooling additions.
Technical scope
Batch promotion of dev into qa. Notable changes grounded in the diff:
- Duplicate-call reduction: added
networkMode: "offlineFirst"touseGetSubClientsByClientIdanduseGetAllBatchesGridto survive Strict Mode remounts; removed manualrefetch()calls fromBatchContents(create/delete/bulk-delete/assign) andBatchForm;useGetSubClientsByClientIdnow stays disabled until a client id exists. - MailForm (PR #432-related): introduced request-level caching and in-flight dedup (
responseCacheRef/pendingCacheRef,fetchWithCache) for the organization/department/contact AsyncPaginate loaders. enabledhardening: standardized many queries (tags, labels, upload centers, entity types, file conventions, users, mail statuses) toenabled: options?.enabled !== false;useGetMailsGridenable logic tidied.- Form/grid fixes:
data-grid-drawernow rendersN/Afor empty/array/object values;DataGridgains a configurablesearchDebounceMs(default 300ms);EditableFileNameselects the name only on initial focus viarequestAnimationFrame;AddDocumentModalresets the file input via ref;CreateOrganizationModaluses a__nonesentinel for its 'None' select option andundefineddefaults (PR #435). - New endpoint wiring: added
getDocumentTypeByMailIdservice +/v1/document_types/mail/{mail_id}route +useGetDocumentTypeByMailId; fixed query-string building ingetAllUsersByClientIds. - Resolution Center: Activity Log tab commented out on document and mail detail pages; dead imports removed.
- Developer tooling (no runtime impact): added
code-inspector-plugin(dev-only, Turbopack + webpack) innext.config.tswithai_docs/locator-integration.md; setreactStrictMode: false; upgraded Claude GitHub Action workflows to@v1.
Risk & mitigation
Low to moderate, contained to QA. Disabling React Strict Mode and switching queries to offlineFirst changes data-fetch timing, so stale-data and double-mount edge cases should be watched. The standardized enabled !== false pattern slightly changes behavior when enabled is explicitly undefined (now treated as enabled). Two minor hygiene items remain in the diff: a leftover console.log("Options", ...) in Mail.queries.ts, and CreateOrganizationModal changed a textarea prop from minRows={3} to min={3} (likely a no-op on a textarea). Mitigation: verify the affected forms and grids in QA and clean up the stray log before production promotion.
QA validation focus
- Batches: create, delete, bulk-delete, and assign users, then confirm the grid still refreshes correctly with no duplicate network requests (check the network tab).
- Mail create/edit: type in sender/recipient organization, department, and contact pickers and confirm results are deduplicated and pagination still works.
- Grid detail drawer: open rows with empty/array/object fields and confirm 'N/A' shows correctly.
- Search boxes: confirm the ~300ms debounce feels right and filters correctly.
- Filename editing: enter edit mode and confirm only the name (not the extension) is selected once, and subsequent typing behaves normally.
- Organization form: confirm 'None' is selectable for client, subclient, and parent organization and submits cleanly.
- Add-document (mail) modal: upload, reset, and re-open; confirm the file input clears.
- Document type by mail id: confirm the new
/v1/document_types/mail/{mail_id}lookup returns data where used.