feat: optimistic metadata store updates for navigation menu items (#18710)

## Summary

- **Optimistic metadata store updates**: Replace `refetchQueries` with
direct `addToDraft`/`applyChanges` calls in create, update, and delete
navigation menu item mutation hooks for instant UI feedback. Client-side
UUID generation enables optimistic creates before the server responds.
- **SSE event enrichment with `targetRecordIdentifier`**: Introduce
`NavigationMenuItemRecordIdentifierService` to resolve record display
info (label, image) and enrich SSE metadata events at emission time, so
the sidebar shows record names immediately without a page refresh.
- **Centralized role permission resolution**: Add
`resolveRolePermissionConfigFromAuthContext` to `PermissionsService`,
removing duplicated role resolution logic from individual services.
- **Mutation fragments include `targetRecordIdentifier`**: Switch
create/update/delete mutations from `NavigationMenuItemFields` to
`NavigationMenuItemQueryFields` so the mutation response includes
`targetRecordIdentifier`, preventing a brief gap where RECORD favorites
are invisible in the sidebar.
- **Folder UI fixes**: Remove transparent border on
`StyledFolderContainer` that caused a 1px size inconsistency between
folder and non-folder items in Favorites. Make the folder kebab menu
hover-only instead of always visible.
This commit is contained in:
Charles Bochet
2026-03-17 23:18:07 +01:00
committed by GitHub
parent 058414fae5
commit a82739cdb1
27 changed files with 1496 additions and 1416 deletions
@@ -25,7 +25,7 @@ export const fromCreateNavigationMenuItemInputToFlatNavigationMenuItemToCreate =
AllFlatEntityMaps,
'flatObjectMetadataMaps' | 'flatViewMaps'
>): FlatNavigationMenuItem => {
const id = uuidv4();
const id = createNavigationMenuItemInput.id ?? uuidv4();
const now = new Date().toISOString();
let position = createNavigationMenuItemInput.position;