@wildo-ai/saas-frontend-lib 1.1.13 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts +1 -0
  2. package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts.map +1 -1
  3. package/dist/esm/components/ai-elements/meta/agent-wrappers.js.map +1 -1
  4. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts +38 -0
  5. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -0
  6. package/dist/esm/components/compliance/EmbeddedSigningFrame.js +106 -0
  7. package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -0
  8. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  9. package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
  10. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  11. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
  12. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +22 -0
  13. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
  14. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
  15. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
  16. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
  17. package/dist/esm/components/flows-actors/agent-config.labels.d.ts.map +1 -1
  18. package/dist/esm/components/flows-actors/agent-config.labels.js +2 -0
  19. package/dist/esm/components/flows-actors/agent-config.labels.js.map +1 -1
  20. package/dist/esm/components/flows-actors/approval.d.ts +7 -1
  21. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  22. package/dist/esm/components/flows-actors/approval.js +22 -5
  23. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  24. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  25. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
  26. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  27. package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
  28. package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
  29. package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
  30. package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
  31. package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
  32. package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
  33. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
  34. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
  35. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
  36. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
  37. package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
  38. package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
  39. package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
  40. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  41. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
  42. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  43. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
  44. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  45. package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
  46. package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
  47. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  48. package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
  49. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  50. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
  51. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
  52. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
  53. package/dist/esm/components/sections/surface.d.ts +12 -0
  54. package/dist/esm/components/sections/surface.d.ts.map +1 -1
  55. package/dist/esm/components/sections/surface.js +14 -0
  56. package/dist/esm/components/sections/surface.js.map +1 -1
  57. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
  58. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
  59. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
  60. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
  61. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
  62. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
  63. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  64. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
  65. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
  66. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
  67. package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
  68. package/dist/esm/core/branding/useBrandPresentation.js +17 -6
  69. package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
  70. package/dist/esm/core/events/events.frontend.schemas.d.ts +40 -0
  71. package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
  72. package/dist/esm/core/events/events.frontend.schemas.js +24 -1
  73. package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
  74. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
  75. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
  76. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
  77. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  78. package/dist/esm/core/i18n/I18nContext.js +8 -2
  79. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  80. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
  81. package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
  82. package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
  83. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
  84. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
  85. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +102 -5
  86. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
  87. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
  88. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
  89. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
  90. package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
  91. package/dist/esm/core/navigation/NavigationContext.js +60 -17
  92. package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
  93. package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
  94. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  95. package/dist/esm/core/navigation/launcher-resolution.js +31 -0
  96. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  97. package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
  98. package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
  99. package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
  100. package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
  101. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  102. package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
  103. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  104. package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts +6 -1
  105. package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts.map +1 -1
  106. package/dist/esm/core/resources/resource-read-cache.frontend.service.js +11 -1
  107. package/dist/esm/core/resources/resource-read-cache.frontend.service.js.map +1 -1
  108. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
  109. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
  110. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
  111. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
  112. package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
  113. package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
  114. package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
  115. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  116. package/dist/esm/core/runtime/AppRouter.js +18 -1
  117. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  118. package/dist/esm/core/runtime/ApplicationMainContext.d.ts +1 -1
  119. package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
  120. package/dist/esm/core/runtime/ApplicationMainContext.js +12 -3
  121. package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
  122. package/dist/esm/core/security/UserOrgsContext.d.ts +6 -1
  123. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  124. package/dist/esm/core/security/UserOrgsContext.js +87 -10
  125. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  126. package/dist/esm/core/security/consent-gate.frontend.utils.d.ts +17 -5
  127. package/dist/esm/core/security/consent-gate.frontend.utils.d.ts.map +1 -1
  128. package/dist/esm/core/security/consent-gate.frontend.utils.js +16 -7
  129. package/dist/esm/core/security/consent-gate.frontend.utils.js.map +1 -1
  130. package/dist/esm/core/security/useConsentGateBehavior.js +1 -1
  131. package/dist/esm/core/security/useConsentGateBehavior.js.map +1 -1
  132. package/dist/esm/core/security/useGrantedConsentPurposes.js +1 -1
  133. package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -1
  134. package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
  135. package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
  136. package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
  137. package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
  138. package/dist/esm/index.d.ts +1 -0
  139. package/dist/esm/index.d.ts.map +1 -1
  140. package/dist/esm/index.js +1 -0
  141. package/dist/esm/index.js.map +1 -1
  142. package/dist/tsconfig.build.tsbuildinfo +1 -1
  143. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationContext.js","sourceRoot":"","sources":["../../../../src/core/navigation/NavigationContext.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AAEH,OAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAqB,MAAM,uBAAuB,CAAC;AAC1H,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,cAAc,GAQf,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAIL,gBAAgB,EAChB,cAAc,EAEd,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACp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AEP,MAAM,YAAY,GAA0B,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACzD,KAAK;QACL,YAAY,EAAE,oBAAoB;QAClC,YAAY,EAAE,oBAAoB;QAClC,aAAa,EAAE,qBAAqB;QACpC,WAAW,EAAE,mBAAmB;QAChC,aAAa,EAAE,qBAAqB;QACpC,yBAAyB;QACzB,sBAAsB,EAAE,8BAA8B;QACtD,WAAW;QACX,cAAc;QACd,YAAY,EAAE,oBAAoB;QAClC,cAAc;QACd,iBAAiB;QACjB,gBAAgB;QAChB,mBAAmB;QACnB,uBAAuB,EAAE,+BAA+B;KACzD,CAAC,EAAE;QACF,KAAK;QACL,oBAAoB;QACpB,oBAAoB;QACpB,qBAAqB;QACrB,mBAAmB;QACnB,qBAAqB;QACrB,yBAAyB;QACzB,8BAA8B;QAC9B,oBAAoB;QACpB,WAAW;QACX,cAAc;QACd,gBAAgB;QAChB,+BAA+B;KAChC,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC5C,QAAQ,GACkB,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["/**\n * NavigationContext\n * \n * Manages the navigation state for all zones (primary, secondary, companion) + overlay.\n * Each zone maintains its own navigation stack.\n * \n * v3 state model: { zones: Record<NavigationZoneName, NavigationZoneState>, overlay: NavigationStackEntry[] }\n * — Dialog, sheet, and drawer appearances share a single overlay stack.\n * — Former THIRD zone is now COMPANION.\n * \n * This context subscribes to navigation events and manages state accordingly.\n * Components that need to render zone content subscribe to this context.\n */\n\nimport React, { createContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport { useLocation, useNavigate } from 'react-router';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { flushHeldNavigationCommit } from './navigation-commit';\nimport { type FrontendEvent_AppScopeChanged, type FrontendEvent_PrimaryScopeChanged, type FrontendEvent_NavigationZoneChanged } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { ResourcePrimaryScope, NavigationZoneName, NavigationTransition, type ResourceType } from '@wildo-ai/saas-models';\nimport { zoneMutationTargetIndex } from './zone-visible-entry';\nimport { NavigationUtils } from './navigation.utils';\nimport {\n FrontendEvents,\n FrontendEvent_NavigationPush,\n FrontendEvent_NavigationReplace,\n FrontendEvent_NavigationPop,\n FrontendEvent_NavigationClose,\n FrontendEvent_NavigationClearZone,\n FrontendEvent_NavigationOrganizationFollowed,\n FrontendEvent_NavigationUrlPathUpdated,\n} from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport {\n NavigationState,\n NavigationZoneState,\n NavigationStackEntry,\n NavigationSource,\n NavigationZone,\n NavigationContent,\n NavigationContentType,\n NAVIGATION_STRUCTURAL_ZONES,\n} from './navigation.schemas';\nimport { reconcileCollapsedZones } from './zone-collapse-migration';\nimport { navigationContentOrganizationId } from './zone-entry-organization';\nimport type { CollapsibleZoneSituation } from './zone-collapse-migration';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { resolveRecordOwnRouteChainFromIdentifiers } from '~wildo-frontend-lib/core/resources/record-own-route.frontend.utils';\nimport { frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { ScopeChangeInitiator } from '~wildo-frontend-lib/core/scope/scope.frontend.schemas';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\nconst logDebug: (message: string, context?: Record<string, unknown>) => void = logger.debugByType('NavigationContext');\nlogger.setDebugTypeLogging('NavigationContext', false);\n\n// ================================\n// Context Type\n// ================================\n\nexport interface NavigationContextType {\n state: NavigationState;\n \n getZoneState: (zone: NavigationZone) => NavigationZoneState;\n getZoneDepth: (zone: NavigationZone) => number;\n getTopContent: (zone: NavigationZone) => NavigationContent | undefined;\n getTopEntry: (zone: NavigationZone) => NavigationStackEntry | undefined;\n isZoneVisible: (zone: NavigationZone) => boolean;\n \n resourceRelationshipDepth: number;\n isNavigationItemActive: (urlPath: string) => boolean;\n\n /**\n * Currently focused zone (D11 — focus tracking).\n * Updated when a zone receives interaction (click within data-content-area).\n * Used by the resolver for SPLIT target selection heuristics.\n */\n focusedZone: NavigationZoneName;\n setFocusedZone: (zone: NavigationZoneName) => void;\n\n /**\n * Make one entry the visible tab of a `NavigationZoneContentModel.TABBED` zone.\n *\n * Writes `NavigationZoneState.activeTabId`, which was declared and documented from the beginning\n * and never written by anything — the reason a TABBED zone rendered as an ordinary single stack\n * (#411). Every entry in a tabbed zone stays mounted, so switching is a visibility change and no\n * content is refetched.\n *\n * A no-op for an entry that is not in the zone's stack: a stale tab id from a closed tab must not\n * blank the zone.\n */\n setActiveTab: (zone: NavigationZoneName, entryId: string) => void;\n\n /**\n * The adjacent zone currently given the WHOLE content area, or `null` for the ordinary split.\n *\n * ## What it is for\n *\n * A list-and-detail layout opens a record at two thirds of the width, which is right for reading\n * beside the list it came from and wrong for the moment a reader wants the record alone — a long\n * diff, a wide table, a document. Emphasis is that moment: the emphasized zone takes the full\n * content area and the other structural zones fold away, WITHOUT any of them leaving the\n * navigation state. Nothing is pushed, popped or re-routed; the URL is untouched; restoring is the\n * inverse of the same gesture (the control, or Escape).\n *\n * ## Why it is NAVIGATION state and not a panel size\n *\n * The resizable split already lets a reader drag the divider, bounded by the zone's declared\n * `minWidth` / `maxWidth`, and those bounds are deliberate — a pane should not be dragged into\n * nothing (#952). Emphasis is not a wider drag: it is a different MODE the reader enters and leaves\n * deliberately, and it must survive re-renders of the content areas and be observable by whatever\n * renders the pane's chrome. That is what the navigation context is for. It is transient — never\n * serialised to the URL and never persisted — because a link to a record should open the split the\n * layout declares, not the mode one reader happened to be in.\n *\n * Only `SECONDARY` and `COMPANION` may be emphasized: PRIMARY already has the whole area whenever\n * nothing is beside it. The content areas re-derive the effective emphasis on every render (an\n * emphasized zone that empties or collapses responsively yields the area back), so a stale value\n * here never hides the page.\n */\n emphasizedZone: NavigationZoneName | null;\n setEmphasizedZone: (zone: NavigationZoneName | null) => void;\n\n /**\n * The measured width, in pixels, of the CONTENT AREA the structural zones share — `undefined`\n * until the first layout pass.\n *\n * Published here because it is MEASURED in one place (the content areas, which own the container)\n * and NEEDED in another (the policy resolver, which decides whether a SPLIT can open at all). The\n * window's breakpoint cannot answer that: the content area is narrower by the sidebar, narrower\n * again when a pane is already open, and whatever an embedded shell gives it. Transient and never\n * serialised, like `emphasizedZone` beside it — a layout decision is re-derived from the space\n * that exists now, never restored from a space that existed once.\n */\n contentAreaWidth: number | undefined;\n setContentAreaWidth: (width: number | undefined) => void;\n\n /**\n * Enforce \"a collapsed zone holds nothing\" for every collapsible zone in ONE state update — see\n * `zone-collapse-migration.ts`. Applied against the latest state rather than the last render's, so\n * two zones collapsing or returning together are one decision, and entries move as objects so no\n * field is lost on the way. A no-op (no re-render) when nothing has to move.\n */\n reconcileCollapsedZones: (situations: CollapsibleZoneSituation[]) => void;\n}\n\nexport const NavigationContext: React.Context<NavigationContextType | undefined> = createContext<NavigationContextType | undefined>(undefined);\n\n// ================================\n// Provider\n// ================================\n\ninterface NavigationProviderProps {\n children: React.ReactNode;\n}\n\nexport function NavigationProvider({ children }: NavigationProviderProps): React.ReactElement {\n const [state, setState] = useState<NavigationState>(NavigationUtils.createInitialNavigationState());\n const [focusedZone, setFocusedZone] = useState<NavigationZoneName>(NavigationZoneName.PRIMARY);\n const [emphasizedZone, setEmphasizedZone] = useState<NavigationZoneName | null>(null);\n const [contentAreaWidth, setContentAreaWidth] = useState<number | undefined>(undefined);\n const { on, emit } = useEventBus();\n const location = useLocation(); // Get current location for isActive computation\n const routerNavigate = useNavigate();\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n\n // Keep a ref to the latest navigation state so event handlers\n // always see up-to-date stack entries without re-subscribing.\n const stateRef = useRef(state);\n useEffect(() => {\n stateRef.current = state;\n }, [state]);\n\n // ================================\n // State Update Helpers\n // ================================\n\n const pushEntry = useCallback((zone: NavigationZoneName, entry: NavigationStackEntry) => {\n logDebug('pushEntry', { zone, entryId: entry.id, contentType: entry.content.contentType, urlPath: entry.urlPath, source: entry.navigationSource });\n setState(prev => ({\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...prev.zones[zone],\n stack: [...prev.zones[zone].stack, entry],\n isVisible: true,\n /*\n * A pushed entry in a TABBED zone becomes the active tab. `activeTabId` is only ever written\n * for a tabbed zone, so its presence is the reducer's signal, as in `zoneMutationTargetIndex`.\n * Until 2026-09-25 a push left it alone: once a reader had clicked any tab, every record\n * they opened afterwards landed as a tab that was not shown — the tab bar grew and the\n * screen did not change. Absent, the renderer already shows the top, which is the new entry.\n */\n activeTabId: prev.zones[zone].activeTabId !== undefined ? entry.id : undefined,\n },\n },\n }));\n }, []);\n\n /**\n * Replace what the zone is SHOWING.\n *\n * In a `SINGLE` zone that is the top of the stack. In a `TABBED` zone it is the ACTIVE TAB, which\n * is not the same entry — and until 2026-09-25 this always replaced the top, so with three tabs\n * open and tab 0 on screen a REPLACE silently overwrote tab 2 and the visible tab did not change.\n * The enum's own contract says \"`replace` replaces the ACTIVE TAB's content\".\n *\n * The reducer does not read the layout, so it does not ask for the content model — it reads\n * `activeTabId`, which is written for a TABBED zone and for nothing else. Absent, the visible entry\n * is the top of the stack, which is the SINGLE contract exactly.\n */\n const replaceEntry = useCallback((zone: NavigationZoneName, entry: NavigationStackEntry) => {\n logDebug('replaceEntry', { zone, entryId: entry.id, contentType: entry.content.contentType, urlPath: entry.urlPath, source: entry.navigationSource });\n setState(prev => {\n const zoneState = prev.zones[zone];\n logDebug('replaceEntry: previous stack depth', { zone, previousStackDepth: zoneState.stack.length });\n if (zoneState.stack.length === 0) {\n return { ...prev, zones: { ...prev.zones, [zone]: { ...zoneState, stack: [entry], isVisible: true } } };\n }\n const visibleIndex = zoneMutationTargetIndex(zoneState.stack, zoneState.activeTabId);\n const replacedTheActiveTab = zoneState.activeTabId !== undefined\n && zoneState.stack[visibleIndex]?.id === zoneState.activeTabId;\n const newStack = zoneState.stack.map((existing, index) => (index === visibleIndex ? entry : existing));\n return {\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...zoneState,\n stack: newStack,\n isVisible: true,\n // The replacement becomes the active tab; otherwise the zone shows an entry that is gone.\n activeTabId: replacedTheActiveTab ? entry.id : zoneState.activeTabId,\n },\n },\n };\n });\n }, []);\n\n const popEntry = useCallback((zone: NavigationZoneName, toEntryId?: string) => {\n setState(prev => {\n const zoneState = prev.zones[zone];\n if (zoneState.stack.length === 0) return prev;\n \n let newStack: NavigationStackEntry[];\n let nextActiveTabId = zoneState.activeTabId;\n if (toEntryId) {\n const targetIndex = zoneState.stack.findIndex(e => e.id === toEntryId);\n newStack = targetIndex >= 0\n ? zoneState.stack.slice(0, targetIndex + 1)\n : zoneState.stack.slice(0, -1);\n nextActiveTabId = zoneState.activeTabId !== undefined\n ? newStack[newStack.length - 1]?.id\n : zoneState.activeTabId;\n } else if (zoneState.activeTabId !== undefined) {\n /*\n * ─── In a TABBED zone, back leaves the ACTIVE tab ───────────────────────────────────────\n *\n * `NavigationTransition.PUSH` documents this as \"back navigation pops the stack OR switches\n * to the previous tab\", and until 2026-09-25 it always sliced the LAST entry — so with tab 0\n * on screen, back removed tab 2 and the reader saw nothing change. Removing the active tab\n * and showing its neighbour is what \"switches to the previous tab\" means.\n */\n const activeIndex = zoneMutationTargetIndex(zoneState.stack, zoneState.activeTabId);\n if (zoneState.stack[activeIndex]?.id !== zoneState.activeTabId) {\n newStack = zoneState.stack.slice(0, -1);\n } else {\n newStack = zoneState.stack.filter((_, index) => index !== activeIndex);\n nextActiveTabId = newStack[Math.max(0, activeIndex - 1)]?.id;\n }\n } else {\n newStack = zoneState.stack.slice(0, -1);\n }\n \n return {\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...zoneState,\n stack: newStack,\n activeTabId: newStack.length > 0 ? nextActiveTabId : undefined,\n isVisible: newStack.length > 0 || zone === NavigationZoneName.PRIMARY,\n },\n },\n };\n });\n }, []);\n\n const clearZoneEntries = useCallback((zone: NavigationZoneName, preservePersistent = false) => {\n logDebug('clearZoneEntries called', { zone });\n setState(prev => {\n logDebug('clearZoneEntries: previous stack depth', { zone, previousStackDepth: prev.zones[zone].stack.length });\n /*\n * A fresh start asks to keep a PERSISTENT pane — see `emitFreshStartNavigationCleanup`. Read\n * here because this is the only layer that can see the zone's top entry; the emitter has no\n * state. The whole stack below a persistent top is dropped: what persists is the reference the\n * reader is keeping open, not the history of how they got to it.\n */\n const persistentTop = prev.zones[zone].stack[prev.zones[zone].stack.length - 1];\n if (preservePersistent && persistentTop?.persistent) {\n logDebug('clearZoneEntries: PERSISTENT top kept across the fresh start', { zone });\n return prev.zones[zone].stack.length === 1\n ? prev\n : { ...prev, zones: { ...prev.zones, [zone]: { ...prev.zones[zone], stack: [persistentTop] } } };\n }\n return {\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...prev.zones[zone],\n stack: [],\n isVisible: zone === NavigationZoneName.PRIMARY,\n },\n },\n };\n });\n }, []);\n\n /**\n * Remove every entry, from every zone and the overlay, whose content addresses an organization other than\n * `organizationId` (#2276). Run when the session follows the route into that organization: see the\n * `PRIMARY_SCOPE_CHANGED` handler below. Entries addressing no organization (an engine page, the settings hub) stay.\n *\n * A TABBED zone whose active tab is removed shows the last remaining entry, as a POP does.\n */\n const dropEntriesAddressingAnotherOrganization = useCallback((organizationId: string) => {\n const addressesAnother = (entry: NavigationStackEntry): boolean => {\n const entryOrganizationId = navigationContentOrganizationId(entry.content);\n return entryOrganizationId !== null && entryOrganizationId !== organizationId;\n };\n setState(prev => {\n let changed = false;\n const zones = { ...prev.zones };\n for (const zone of NAVIGATION_STRUCTURAL_ZONES) {\n const zoneState = prev.zones[zone];\n const stack = zoneState.stack.filter(entry => !addressesAnother(entry));\n if (stack.length === zoneState.stack.length) continue;\n changed = true;\n logDebug('dropEntriesAddressingAnotherOrganization', { zone, dropped: zoneState.stack.length - stack.length, organizationId });\n const activeTabKept = zoneState.activeTabId === undefined || stack.some(entry => entry.id === zoneState.activeTabId);\n zones[zone] = {\n ...zoneState,\n stack,\n activeTabId: stack.length === 0 ? undefined : activeTabKept ? zoneState.activeTabId : stack[stack.length - 1].id,\n isVisible: stack.length > 0 || zone === NavigationZoneName.PRIMARY,\n };\n }\n const overlay = prev.overlay.filter(entry => !addressesAnother(entry));\n if (overlay.length !== prev.overlay.length) changed = true;\n return changed ? { ...prev, zones, overlay } : prev;\n });\n }, []);\n\n // ================================\n // Overlay Stack Helpers\n // ================================\n\n const pushOverlay = useCallback((entry: NavigationStackEntry) => {\n logDebug('pushOverlay', { entryId: entry.id, contentType: entry.content.contentType, appearance: entry.appearance });\n setState(prev => ({\n ...prev,\n overlay: [...prev.overlay, entry],\n }));\n }, []);\n\n const popOverlay = useCallback((entryId?: string) => {\n setState(prev => {\n if (prev.overlay.length === 0) return prev;\n if (entryId) {\n return { ...prev, overlay: prev.overlay.filter(e => e.id !== entryId) };\n }\n return { ...prev, overlay: prev.overlay.slice(0, -1) };\n });\n }, []);\n\n const clearOverlay = useCallback(() => {\n logDebug('clearOverlay called');\n setState(prev => {\n if (prev.overlay.length === 0) return prev;\n return { ...prev, overlay: [] };\n });\n }, []);\n\n // ================================\n // Event Handlers\n // ================================\n\n /**\n * Subscribes a handler that CHANGES the zone state. Before it applies anything, a navigation commit a shell layout is\n * still holding (a view transition between the screens, `navigation-commit.ts`) lands first — so a later change of\n * any origin (a clean break, a dismiss, a back, the router reconciling a URL) is never undone by an earlier commit\n * landing after it. Every zone-state handler below subscribes through this, which is what makes the order hold\n * whichever emitter the change came from.\n */\n const onZoneStateEvent: typeof on = useCallback((event, handler) => on(event, (payload) => {\n flushHeldNavigationCommit();\n handler(payload);\n }), [on]);\n\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_PUSH, (payload: FrontendEvent_NavigationPush) => {\n logDebug('NAVIGATION_PUSH received', { zone: payload.zone, contentType: payload.content.contentType, urlPath: payload.urlPath, transition: payload.transition });\n const entry: NavigationStackEntry = {\n id: payload.stackEntryId,\n content: payload.content,\n urlPath: payload.urlPath,\n timestamp: Date.now(),\n zone: payload.zone as NavigationZone,\n initiator: payload.initiator as NavigationStackEntry['initiator'],\n navigationSource: payload.navigationSource as NavigationSource,\n transition: payload.transition as NavigationStackEntry['transition'],\n appearance: payload.appearance,\n overlayBehavior: payload.overlayBehavior,\n ephemeral: payload.ephemeral,\n hostedPane: payload.hostedPane,\n collapsedFromZone: payload.collapsedFromZone,\n persistent: payload.persistent,\n };\n if (payload.zone === NavigationZone.OVERLAY) {\n pushOverlay(entry);\n } else {\n pushEntry(payload.zone as NavigationZoneName, entry);\n }\n });\n }, [onZoneStateEvent, pushEntry, pushOverlay]);\n\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_REPLACE, (payload: FrontendEvent_NavigationReplace) => {\n logDebug('NAVIGATION_REPLACE received', { zone: payload.zone, contentType: payload.content.contentType, urlPath: payload.urlPath, transition: payload.transition });\n const entry: NavigationStackEntry = {\n id: payload.stackEntryId,\n content: payload.content,\n urlPath: payload.urlPath,\n timestamp: Date.now(),\n zone: payload.zone as NavigationZone,\n initiator: payload.initiator as NavigationStackEntry['initiator'],\n navigationSource: payload.navigationSource as NavigationSource,\n transition: payload.transition as NavigationStackEntry['transition'],\n appearance: payload.appearance,\n overlayBehavior: payload.overlayBehavior,\n ephemeral: payload.ephemeral,\n hostedPane: payload.hostedPane,\n collapsedFromZone: payload.collapsedFromZone,\n persistent: payload.persistent,\n };\n if (payload.zone === NavigationZone.OVERLAY) {\n // Replace the top of the overlay stack\n setState(prev => {\n if (prev.overlay.length === 0) return { ...prev, overlay: [entry] };\n return { ...prev, overlay: [...prev.overlay.slice(0, -1), entry] };\n });\n } else {\n replaceEntry(payload.zone as NavigationZoneName, entry);\n }\n });\n }, [onZoneStateEvent, replaceEntry]);\n\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_POP, (payload: FrontendEvent_NavigationPop) => {\n logDebug('NAVIGATION_POP received', { zone: payload.zone, toStackEntryId: payload.toStackEntryId });\n if (payload.zone === NavigationZone.OVERLAY) {\n popOverlay(payload.toStackEntryId);\n } else {\n popEntry(payload.zone as NavigationZoneName, payload.toStackEntryId);\n }\n });\n }, [onZoneStateEvent, popEntry, popOverlay]);\n \n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_CLOSE, (payload: FrontendEvent_NavigationClose) => {\n logDebug('NAVIGATION_CLOSE received', { zone: payload.zone, stackEntryId: payload.stackEntryId });\n if (payload.zone === NavigationZone.OVERLAY) {\n if (payload.stackEntryId) {\n popOverlay(payload.stackEntryId);\n } else {\n clearOverlay();\n }\n }\n /*\n * There is no structural branch, and the type is what says so: `FrontendEvent_NavigationClose`\n * declares `zone: z.literal(OVERLAY)` and the bus `safeParse`s every payload, so a structural\n * zone cannot reach here. A branch existed until 2026-09-25 calling a `closeEntry` primitive\n * that was therefore unreachable — and that primitive was the ONE stack mutator without the\n * \"PRIMARY is always visible\" guard its two siblings carry (`popEntry`, `clearZoneEntries`), so\n * widening the schema would have produced an invisible primary zone. The `as NavigationZoneName`\n * cast on the way in is what hid it: it widened a type that can only ever be OVERLAY.\n *\n * Clearing a structural zone is `NAVIGATION_CLEAR_ZONE`, just below.\n */\n });\n }, [onZoneStateEvent, popOverlay, clearOverlay]);\n \n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_CLEAR_ZONE, (payload: FrontendEvent_NavigationClearZone) => {\n logDebug('NAVIGATION_CLEAR_ZONE received', { zone: payload.zone, preservePersistent: payload.preservePersistent });\n clearZoneEntries(payload.zone as NavigationZoneName, payload.preservePersistent === true);\n });\n }, [onZoneStateEvent, clearZoneEntries]);\n\n /*\n * A URL refresh keeps the entry — id, content, depth — and moves only `urlPath`. It is the\n * reconciler's answer to a VIEW-STATE query change (`?section=` on a board): the destination on\n * screen is still the one the URL names, so nothing is rebuilt, nothing is re-keyed and the\n * dependency cleanup (which watches the primary TOP ENTRY, not its URL) stays quiet.\n */\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_URL_PATH_UPDATED, (payload: FrontendEvent_NavigationUrlPathUpdated) => {\n logDebug('NAVIGATION_URL_PATH_UPDATED received', { zone: payload.zone, stackEntryId: payload.stackEntryId, urlPath: payload.urlPath });\n setState(prev => {\n const zoneState = prev.zones[payload.zone as NavigationZoneName];\n if (!zoneState) return prev;\n const index = zoneState.stack.findIndex(entry => entry.id === payload.stackEntryId);\n if (index < 0 || zoneState.stack[index].urlPath === payload.urlPath) return prev;\n const newStack = zoneState.stack.slice();\n newStack[index] = { ...newStack[index], urlPath: payload.urlPath };\n return {\n ...prev,\n zones: { ...prev.zones, [payload.zone]: { ...zoneState, stack: newStack } },\n };\n });\n });\n }, [onZoneStateEvent]);\n\n // ================================\n // Emit NAVIGATION_ZONE_CHANGED after any state mutation\n // ================================\n //\n // Note: useRouterSync suppression is now handled by the NavigationTransaction\n // model (NavigationUtils.beginTransaction / commitTransaction / isInTransaction).\n // Callers that perform multi-step operations (home click, org switch, cascading)\n // begin a transaction before clearing zones, and the transaction auto-commits\n // after the current event loop iteration (setTimeout(0)).\n const previousStateRef = useRef<NavigationState>(state);\n useEffect(() => {\n const prevState = previousStateRef.current;\n previousStateRef.current = state;\n \n // Compare each zone and emit if changed\n for (const zone of NAVIGATION_STRUCTURAL_ZONES) {\n const prev = prevState.zones[zone];\n const curr = state.zones[zone];\n if (prev.stack !== curr.stack) {\n const topEntry = curr.stack[curr.stack.length - 1];\n logDebug('Emitting NAVIGATION_ZONE_CHANGED', { zone, stackDepth: curr.stack.length, previousStackDepth: prev.stack.length });\n emit(FrontendEvents.NAVIGATION_ZONE_CHANGED, {\n zone,\n currentContent: topEntry?.content,\n stackDepth: curr.stack.length,\n previousStackDepth: prev.stack.length,\n });\n }\n }\n }, [state, emit]);\n\n // ================================\n // Zone Dependency Cleanup\n // ================================\n //\n // When PRIMARY's top entry changes, evaluate SECONDARY and COMPANION zones for relevance. It runs on\n // any change except the early returns below: an empty primary, the same entry refreshed, a top that\n // went home from a collapse, the same record (same type and id), or a scope-addressed operation (any\n // collection verb, a list or a CREATE among them) of the same type with the same scope. A record replaced by a scope-addressed\n // operation, or the reverse, always runs it. A PERSISTENT pane is exempt throughout.\n // - SECONDARY is cleared when it no longer relates to the new PRIMARY content, and a\n // non-persistent COMPANION is cleared with it, without a check of its own.\n // - Otherwise COMPANION is kept when it relates to PRIMARY's content or to the SECONDARY content\n // beside it (a record it belongs to, or a collection of its own type with the same parents), and\n // cleared when it relates to neither.\n //\n // This ensures dependent zones don't show stale content from a previous context.\n // For example: User views Projects LIST (PRIMARY) → Project Alpha READ (SECONDARY).\n // Then navigates to Invoices LIST (PRIMARY) → SECONDARY should clear because\n // Invoice LIST has no relationship to Project Alpha.\n //\n // IMPORTANT: This effect uses its OWN ref to track previous PRIMARY state, separate\n // from the ZONE_CHANGED effect above. Both effects depend on `state` and run in\n // declaration order — if they shared the same ref, the ZONE_CHANGED effect would\n // overwrite the ref before this effect reads it, making the cleanup always a no-op.\n const previousPrimaryForCleanupRef = useRef<NavigationZoneState>(state.zones[NavigationZoneName.PRIMARY]);\n useEffect(() => {\n const prevPrimary = previousPrimaryForCleanupRef.current;\n previousPrimaryForCleanupRef.current = state.zones[NavigationZoneName.PRIMARY];\n\n const currPrimary = state.zones[NavigationZoneName.PRIMARY];\n\n // Only react to actual PRIMARY stack changes\n if (prevPrimary.stack === currPrimary.stack) return;\n\n const currTopEntry = currPrimary.stack[currPrimary.stack.length - 1];\n const prevTopEntry = prevPrimary.stack[prevPrimary.stack.length - 1];\n\n // An empty PRIMARY gives the panes nothing to be measured against, so this effect leaves them. The\n // paths that empty primary on purpose clear the dependent zones themselves: the home click through\n // `navigation-clean-break.frontend.utils.ts`, an organization switch in this provider's\n // PRIMARY_SCOPE_CHANGED handler below.\n if (!currTopEntry) return;\n\n // The SAME entry — a `urlPath` refresh after a view-state query change — is not a change of\n // primary at all. Without this the refresh would count as one, and beside a composite primary\n // the relationship-aware rule below would clear the hosted pane on every tab click.\n if (prevTopEntry && prevTopEntry.id === currTopEntry.id) return;\n\n /*\n * A top that went HOME is not a navigation. When a collapsed pane is given back, the entries\n * primary was holding for it leave primary's stack, so its top changes — and read as a\n * navigation, that change would judge the returning panes against the list now on top and could\n * close the very companion that is coming back. The reader navigated nowhere; the viewport\n * widened. (`zone-collapse-migration.ts`)\n */\n if (prevTopEntry?.collapsedFromZone !== undefined && !currPrimary.stack.some(entry => entry.id === prevTopEntry.id)) {\n return;\n }\n\n // If PRIMARY still points at the same target, dependency cleanup can be skipped. Resource type alone\n // is not enough once duplicate edges and same-type parent chains are in play.\n //\n // A RECORD is the same target when its id is. A SCOPE-addressed operation — any collection verb, a list\n // or a CREATE among them — has no id of its own: its type slot holds at most ambient scope, so two of them\n // are the same only when their whole scope is — the todos of one list are not the todos of another (#2115\n // review), while a CREATE pushed over its own list is that list. And a record is never the same target as\n // a scope-addressed operation, even when that scope names the record's id: from a unit to the list of its\n // children is a change. `NavigationUtils.isSameResourceTarget` decides it.\n //\n // The scope comparison is by KEY SHAPE, not by meaning: the same list keyed by type (`todoLists`) and by\n // foreign key (`todoListId`, the cascade's sibling list) compares as different, so the cleanup runs. That\n // errs safe — running it is a relevance check, and a pane that belongs beside the new primary is kept by\n // `isContentRelevantToParent`, which reads both shapes. Skipping it wrongly is what leaves stale panes.\n if (\n prevTopEntry &&\n currTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION &&\n prevTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION &&\n NavigationUtils.isSameResourceTarget(currTopEntry.content.resourceContext, prevTopEntry.content.resourceContext)\n ) {\n return;\n }\n\n const secondaryState = state.zones[NavigationZoneName.SECONDARY];\n let companionHandled = false;\n // Whether THIS run cleared SECONDARY: `secondaryState` is the snapshot from before the clear, so the\n // companion check below must not measure a companion against a pane that is already gone.\n let secondaryCleared = false;\n if (secondaryState.stack.length > 0) {\n const secondaryTop = secondaryState.stack[secondaryState.stack.length - 1];\n if (secondaryTop) {\n /*\n * A HOSTED pane is kept for as long as its host is a non-resource primary. The relevance\n * rule is relationship-aware and a composite view has no relationships, so it would call the\n * pane stale the moment primary changed from empty to the board on a deep link — the #203\n * shape again, one content kind over. Once primary becomes a RESOURCE the ordinary rule\n * applies, and the pane is measured like any other detail.\n */\n const isRelevant = (\n secondaryTop.hostedPane === true\n && currTopEntry.content.contentType !== NavigationContentType.RESOURCE_OPERATION\n ) || NavigationUtils.isContentRelevantToParent(\n secondaryTop.content,\n currTopEntry.content,\n );\n if (!isRelevant && secondaryTop.persistent) {\n logDebug('Zone dependency cleanup: SECONDARY is PERSISTENT — kept across the primary change', {\n paneResourceType: secondaryTop.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? secondaryTop.content.resourceContext.resourceType\n : secondaryTop.content.contentType,\n });\n } else if (!isRelevant) {\n logDebug('Zone dependency cleanup: SECONDARY stale, clearing', {\n primaryResourceType: currTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? currTopEntry.content.resourceContext.resourceType\n : currTopEntry.content.contentType,\n });\n clearZoneEntries(NavigationZoneName.SECONDARY);\n secondaryCleared = true;\n const companionStack = state.zones[NavigationZoneName.COMPANION].stack;\n const companionTopEntry = companionStack[companionStack.length - 1];\n if (companionStack.length > 0 && !companionTopEntry?.persistent) {\n companionHandled = true;\n clearZoneEntries(NavigationZoneName.COMPANION);\n }\n }\n }\n }\n\n const companionState = state.zones[NavigationZoneName.COMPANION];\n if (!companionHandled && companionState.stack.length > 0) {\n const companionTop = companionState.stack[companionState.stack.length - 1];\n if (companionTop) {\n /*\n * The companion is the detail of the pane BESIDE it as much as of primary: in a three-pane chain\n * (a folder, a thread, a message) it belongs to SECONDARY's record. Measuring it against PRIMARY\n * alone cleared a companion whose parent sits in SECONDARY whenever primary held a collection\n * rather than the root record — measured on a reloaded depth-2 URL whose root parent had no page\n * (#2115). So it is kept when it belongs to either. This only ADDS keeps, and only against a\n * SECONDARY this run kept against the new primary (or that is persistent): a SECONDARY cleared just\n * above is excluded, so a companion is never kept for a pane that is gone. (A companion reaching\n * here after that clear is a PERSISTENT one, which the branch below keeps anyway.)\n */\n const secondaryTop = secondaryCleared ? undefined : secondaryState.stack[secondaryState.stack.length - 1];\n const isRelevant = NavigationUtils.isContentRelevantToParent(\n companionTop.content,\n currTopEntry.content,\n ) || (\n !!secondaryTop\n && secondaryTop.content.contentType === NavigationContentType.RESOURCE_OPERATION\n && NavigationUtils.isContentRelevantToParent(companionTop.content, secondaryTop.content)\n );\n /*\n * ─── A PERSISTENT pane is exempt from the DEPENDENCY cleanup ────────────────────────────\n *\n * That is what `TransitionConfig.persistent` has always promised — \"the split zone persists\n * when the source zone's content changes\" — and until 2026-09-25 the modifier only chose\n * COMPANION as the target zone, so the documented reference-panel pattern (a thread, a\n * terminal, a doc kept open while you move around) closed on the first unrelated navigation.\n *\n * Exempt from THIS cleanup only. An explicit dismiss, a clean break and a direct clear all\n * still close it: persistence means \"do not close because the page beneath changed\".\n */\n if (!isRelevant && companionTop.persistent) {\n logDebug('Zone dependency cleanup: COMPANION is PERSISTENT — kept across the primary change', {\n paneResourceType: companionTop.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? companionTop.content.resourceContext.resourceType\n : companionTop.content.contentType,\n });\n } else if (!isRelevant) {\n logDebug('Zone dependency cleanup: COMPANION stale, clearing', {\n primaryResourceType: currTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? currTopEntry.content.resourceContext.resourceType\n : currTopEntry.content.contentType,\n });\n clearZoneEntries(NavigationZoneName.COMPANION);\n }\n }\n }\n }, [state, clearZoneEntries]);\n\n // ================================\n // URL Sync Bridge (AppScope → URL)\n // ================================\n //\n // Keeps the browser URL in sync with the currently selected AppScope values,\n // but ONLY when those scopes are relevant for the current top navigation content.\n // This is intentionally navigation-aware to avoid \"query spam\" and border effects.\n useEffect(() => {\n if (!appScope) {\n return;\n }\n\n return on(FrontendEvents.APP_SCOPE_CHANGED, (payload: FrontendEvent_AppScopeChanged) => {\n // Scope changes that MIRROR the current surface must not re-write the URL:\n // ROUTER came FROM the route, and SURFACE_FILTER came from a listing's\n // active filter — rewriting on either would move the route out from under\n // the very surface that produced the value (and, for ROUTER, loop).\n if (payload.initiator === ScopeChangeInitiator.ROUTER\n || payload.initiator === ScopeChangeInitiator.SURFACE_FILTER) {\n return;\n }\n\n const currentBrowserUrl = `${location.pathname}${location.search}`;\n const routeOwner = NavigationUtils.findStructuralRouteOwner(\n currentBrowserUrl,\n (zone) => stateRef.current.zones[zone],\n );\n if (!routeOwner) {\n return;\n }\n\n // A hosted pane's URL is the HOST's, carrying the pane as a parameter; rewriting it to the\n // pane's resolved resource route would drop the host. The pane's address mirrors no scope\n // field today, so there is nothing for this bridge to move.\n if (routeOwner.entry.hostedPane) {\n return;\n }\n\n const addressedZone = routeOwner.zone;\n const topEntry = routeOwner.entry;\n const topContent = topEntry.content as NavigationContent | undefined;\n if (!topContent) {\n return;\n }\n\n // Only resource operations are URL-addressable via the URL builder.\n if (topContent.contentType !== NavigationContentType.RESOURCE_OPERATION) {\n return;\n }\n\n const resourceType = topContent.resourceContext?.resourceType;\n const operation = topContent.resourceContext?.operation as any;\n if (!resourceType || !operation) {\n return;\n }\n\n const resourceConfig = registry.resourceConfigurations?.[resourceType];\n if (!resourceConfig) {\n return;\n }\n\n // Rebuild identifiers the same way controller navigation does: keep\n // primary-scope globals filtered to the target resource and merge custom\n // AppScope identifiers separately so unrelated scope keys do not distort\n // route selection or URL rewriting.\n const scopeFilteredGlobalIdentifiers = ScopeUtilsService.primaryScopeToContextIdentifiers(\n ScopeUtilsService.buildInitiatorIds({\n userId: appScope.currentUserId,\n organizationId: appScope.currentOrganizationId,\n applicationId: appScope.currentApplicationId,\n anonymousUserId: appScope.currentAnonymousUserId,\n }),\n resourceConfig.resourcePrimaryScope,\n );\n const customScopeIdentifiers = { ...appScope.buildContextResourceIdentifiers() };\n\n // Overlay the EVENT PAYLOAD onto the scope-derived map. `setScopeValue`\n // emits from a queueMicrotask, so this handler's `appScope` closure may\n // predate the state commit — the payload is the only value guaranteed to\n // be the post-change truth. A cleared field (`newValue: null` or an empty\n // array) must also DELETE its keys here, or the stale map keeps\n // addressing the old value.\n //\n // `newValue` may be a MULTI value (`string[]`, e.g. an isMultiple quick\n // switcher field). URL/route identifiers are scalar, so the payload must\n // go through the SAME first-scalar projection AppScope's own\n // `buildContextResourceIdentifiers()` applies (its\n // `getFirstScopeScalarValue`) — the map this overlay corrects. Treating\n // an array as \"not a string ⇒ cleared\" would delete the key and demote\n // the URL on every change to a selected multi field.\n const rawPayloadValue = Array.isArray(payload.newValue)\n ? payload.newValue[0]\n : payload.newValue;\n const payloadValue = typeof rawPayloadValue === 'string' && rawPayloadValue.length > 0\n ? rawPayloadValue\n : undefined;\n const payloadKeys = [payload.resourceType, payload.fieldIdentifier].filter(Boolean) as string[];\n for (const key of payloadKeys) {\n if (payloadValue) {\n customScopeIdentifiers[key] = payloadValue;\n } else {\n delete customScopeIdentifiers[key];\n }\n }\n\n const explicitIdentifiers = topContent.resourceContext?.contextResourceIdentifiers ?? {};\n const explicitNormalized: Record<string, string> = {};\n for (const [resType, rawValue] of Object.entries(explicitIdentifiers as Record<string, unknown>)) {\n const id = frontendResourceUtils.getResourceId(rawValue as any);\n if (id) {\n explicitNormalized[resType] = id;\n const explicitFieldIdentifier = frontendResourceUtils.getFieldIdentifier(rawValue as any);\n if (explicitFieldIdentifier) {\n explicitNormalized[explicitFieldIdentifier] = id;\n }\n }\n }\n // Scope-owned keys include every DECLARED custom scope field — not only\n // the fields currently holding a value. A cleared scope field's key must\n // stay scope-owned, otherwise the CURRENT route's explicit identifier for\n // it survives as \"preserved explicit\" and the URL can never demote back\n // to the scope-less route (clearing the quick switcher would be a no-op).\n const declaredCustomScopeKeys = (appScope.customScopeFields ?? []).flatMap(field =>\n [field.resourceType, field.fieldIdentifier].filter(Boolean) as string[],\n );\n const scopeOwnedKeys = new Set<string>([\n ...Object.keys(scopeFilteredGlobalIdentifiers),\n ...Object.keys(customScopeIdentifiers),\n ...declaredCustomScopeKeys,\n ]);\n const preservedExplicitIdentifiers = Object.fromEntries(\n Object.entries(explicitNormalized).filter(([key]) => !scopeOwnedKeys.has(key)),\n );\n const candidateContextIdentifiers: Record<string, string> = {\n ...scopeFilteredGlobalIdentifiers,\n ...customScopeIdentifiers,\n ...preservedExplicitIdentifiers,\n };\n\n // Re-resolve the route WITHOUT pinning it to the current route's parent\n // chain. A scope change is precisely the situation where the parent-edge\n // ARITY may need to change: selecting a list on the org-only todos route\n // must PROMOTE the URL to `/…/todo-lists/:todoListId/todos`, and clearing\n // it must DEMOTE back — both routes differ in edge-chain length, so the\n // edge-identity filter (which rejects on arity first) would eliminate the\n // correct candidate before specificity ranking ever saw it. Resolving\n // from scope-satisfiability alone is the SAME semantics launcher items\n // use (`launcher-resolution.ts` passes no requirements), so a sidebar\n // click and a quick-switcher selection land on the same route. Non-scope\n // explicit parents remain in the candidate identifiers, so routes that\n // genuinely need them stay satisfiable and win on specificity.\n //\n // A RECORD page is the exception (#3548, the #2746 invariant): a record opened by id keeps the route its own\n // identity selects — the identifiers the route owns plus the (possibly new) tenancy — so a list selected in the\n // switcher can no longer promote a record of another list under itself. The chain is recomputed from that\n // identity, never taken from the current route, so a tenancy change still moves it. A listing has no own id and\n // is resolved exactly as above. `useNavigationController` and the page's read ask the same function.\n const recordOwnRouteChain = resolveRecordOwnRouteChainFromIdentifiers({\n initiatorInfos: operation.initiatorInfos,\n targetResourceType: resourceType as ResourceType,\n registry,\n ownIdentifiers: preservedExplicitIdentifiers,\n tenancyIdentifiers: scopeFilteredGlobalIdentifiers,\n });\n const resolved = NavigationUtils.resolveResourceUrl(\n resourceConfig as any,\n operation as any,\n candidateContextIdentifiers,\n registry.allResourceFieldIdentifiers,\n recordOwnRouteChain,\n recordOwnRouteChain !== undefined,\n );\n if (!resolved?.resolvedUrl) {\n return;\n }\n const resolvedPath = resolved.resolvedUrl;\n\n // Preserve non-scope query params (e.g., dataMode), but drop scope_* params.\n const currentParams = new URLSearchParams(location.search);\n for (const key of Array.from(currentParams.keys())) {\n if (key.startsWith('scope_')) {\n currentParams.delete(key);\n }\n }\n const finalUrl = currentParams.toString().length > 0\n ? `${resolvedPath}?${currentParams.toString()}`\n : resolvedPath;\n\n // No-op if URL didn't change.\n if (finalUrl === currentBrowserUrl) {\n return;\n }\n\n // Rebuild the entry CONTENT for the new URL — replacing only `urlPath`\n // while keeping the old `resourceContext` shipped the previous list's\n // identifiers/parent chain inside the still-mounted surface: the URL\n // rewrote but the LIST kept rendering the old scope's rows (stale data\n // under the new scope). The rebuild mirrors exactly what a fresh mount of\n // the new URL produces (`ResourcePageWrapper` in AppRouter): explicit\n // identifiers from the resolved route's own parameters, merged with live\n // primary + custom scope, and `parentResourcesRequirements` recomputed\n // from the resolved route — so the mounted surface's fetch identity and\n // the HTTP client's route selection both follow the new scope.\n const rewrittenUrlParameters: Record<string, string> = {};\n for (const param of resolved.routePathParameters) {\n const value = candidateContextIdentifiers[param.fieldIdentifier]\n ?? candidateContextIdentifiers[param.resourceType];\n if (value) {\n rewrittenUrlParameters[param.fieldIdentifier] = value;\n }\n }\n const rewrittenUrlContextIdentifiers = frontendResourceUtils.extractResourceIdentifiersFromUrlParams(\n rewrittenUrlParameters,\n registry,\n resolved.routePathParameters as any,\n );\n const rewrittenContextIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope.currentUserId,\n currentOrganizationId: appScope.currentOrganizationId,\n currentApplicationId: appScope.currentApplicationId,\n currentAnonymousUserId: appScope.currentAnonymousUserId,\n primaryScope: resourceConfig.resourcePrimaryScope,\n liveAppScopeContextResourceIdentifiers: customScopeIdentifiers,\n explicitContextResourceIdentifiers: rewrittenUrlContextIdentifiers,\n });\n const rewrittenParentRequirements = frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n resolved.routePathParameters as any,\n resourceType,\n registry,\n );\n const rewrittenContent: NavigationContent = {\n ...topContent,\n resourceContext: frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation,\n contextResourceIdentifiers: rewrittenContextIdentifiers,\n parentResourcesRequirements: rewrittenParentRequirements,\n }),\n };\n\n // Keep Navigation state aligned with browser URL to avoid URL_SYNC loops.\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: addressedZone,\n content: rewrittenContent,\n urlPath: finalUrl,\n stackEntryId: topEntry.id,\n initiator: topEntry.initiator,\n navigationSource: NavigationSource.CONTROLLER,\n transition: NavigationTransition.REPLACE,\n });\n\n routerNavigate(finalUrl, { replace: true });\n });\n }, [appScope, emit, location.pathname, location.search, on, registry, routerNavigate]);\n\n // ================================\n // Organization Switch → Reset Navigation & Go Home\n // ================================\n //\n // When the user switches organization (PRIMARY_SCOPE_CHANGED with scopeLevel ORGANIZATIONS),\n // all navigation stacks become stale because the data belongs to the previous org.\n // We wrap the entire clear + navigate sequence in a NavigationTransaction to prevent\n // useRouterSync from re-populating stacks with stale content during the transition.\n useEffect(() => {\n return on(FrontendEvents.PRIMARY_SCOPE_CHANGED, (payload: FrontendEvent_PrimaryScopeChanged) => {\n if (payload.scopeLevel !== ResourcePrimaryScope.ORGANIZATIONS) {\n return;\n }\n\n // Skip true no-ops (scope re-published with an unchanged org value).\n if (payload.newValue === payload.previousValue) {\n return;\n }\n\n // Skip the INITIAL establishment of organization scope (previousValue is\n // null). The fresh-start reset below exists to DISCARD STALE prior-org\n // navigation when the user switches between two real organizations — the\n // existing zone stacks point at the previous org's data and must be torn\n // down. A `null -> org` transition has no prior-org navigation to\n // invalidate: it is AppScope resolving the persisted org asynchronously\n // during app bootstrap (hard refresh / deep-link), AFTER the baseline was\n // captured while still org-less. The URL the user loaded (e.g.\n // `/composite/<ref>`) already belongs to this org, so resetting here would\n // clobber a legitimate deep link and bounce the user to home — the exact\n // refresh-loses-the-page bug. Skipping lets useRouterSync /\n // useViewRouterSync reconstruct the loaded URL's navigation state instead.\n //\n // This guard is navigation-only: sibling PRIMARY_SCOPE_CHANGED subscribers\n // still act on establishment (ErrorContext sets the reporting org id,\n // LoadingContext clears its loaded-once cache). Genuine org-to-org switches\n // (and org -> null teardown) keep a real `previousValue` and still reset.\n if (!payload.previousValue) {\n return;\n }\n\n // Skip the session FOLLOWING the route (#2247). The person opened a link into another organization, so\n // the route is the page they asked for and the session moved to match it, not the other way round.\n // Resetting here would send them home from the very page that moved the organization. What the previous\n // organization left in the zones is dropped instead, in the follow's own commit:\n // `NAVIGATION_ORGANIZATION_FOLLOWED`, below (#2276).\n if (payload.initiator === ScopeChangeInitiator.ROUTER) {\n return;\n }\n\n // Begin transaction — useRouterSync will skip sync while active.\n // Auto-commits after the current event loop iteration (setTimeout(0)).\n NavigationUtils.beginTransaction('org_switch');\n\n // Clear all zone stacks + overlay — previous org data is no longer valid\n clearZoneEntries(NavigationZoneName.PRIMARY);\n clearZoneEntries(NavigationZoneName.SECONDARY);\n clearZoneEntries(NavigationZoneName.COMPANION);\n clearOverlay();\n\n // Navigate to home\n routerNavigate('/', { replace: true });\n\n // Transaction auto-commits via setTimeout(0) — no explicit commit needed.\n // The auto-commit fires after React processes the batched state updates and\n // effects, ensuring useRouterSync is suppressed during the entire transition.\n });\n }, [on, clearZoneEntries, clearOverlay, routerNavigate]);\n\n // ================================\n // Route organization followed → drop what the previous organization left (#2276)\n // ================================\n //\n // A followed change keeps the page the person opened (no reset to home, see above), but a pane, an overlay or a\n // backstack entry of the organization they left would now be judged by the new organization's roles and features.\n // `useRouteOrganizationFollow` emits this in the same effect that commits the organization, so the drop and the\n // move land in ONE render. A PRIMARY left empty renders the route outlet, which rebuilds the page from the URL.\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_ORGANIZATION_FOLLOWED, (payload: FrontendEvent_NavigationOrganizationFollowed) => {\n logDebug('NAVIGATION_ORGANIZATION_FOLLOWED received', { organizationId: payload.organizationId });\n dropEntriesAddressingAnotherOrganization(payload.organizationId);\n });\n }, [onZoneStateEvent, dropEntriesAddressingAnotherOrganization]);\n\n // ================================\n // INSPECT Auto-Close (D26)\n // ================================\n //\n // When a zone's stack changes (PUSH, REPLACE, POP, CLEAR), any overlay\n // entries that were opened via INSPECT intent auto-close. COMPANION\n // overlays persist until explicitly closed.\n //\n /**\n * Ephemeral overlay auto-close: when a structural zone's stack changes,\n * any overlay entries that were opened from that zone AND marked ephemeral\n * are automatically removed from the overlay stack.\n *\n * This implements the \"inspect\" pattern: quick-peek overlays that dismiss\n * when the user interacts with the source zone (clicks another item, navigates away).\n */\n useEffect(() => {\n return on(FrontendEvents.NAVIGATION_ZONE_CHANGED, (payload: FrontendEvent_NavigationZoneChanged) => {\n const changedZone = payload.zone as NavigationZoneName;\n if (!NAVIGATION_STRUCTURAL_ZONES.includes(changedZone)) return;\n\n const currentState = stateRef.current;\n const overlayStack = currentState.overlay;\n if (overlayStack.length === 0) return;\n\n const ephemeralFromChangedZone = overlayStack.filter(\n entry => entry.ephemeral === true && entry.initiator?.sourceZone === changedZone,\n );\n\n if (ephemeralFromChangedZone.length === 0) return;\n\n for (const entry of ephemeralFromChangedZone) {\n logDebug('Ephemeral auto-close: closing overlay entry', { entryId: entry.id, changedZone });\n }\n\n const idsToRemove = new Set(ephemeralFromChangedZone.map(e => e.id));\n setState(prev => ({\n ...prev,\n overlay: prev.overlay.filter(e => !idsToRemove.has(e.id)),\n }));\n });\n }, [on]);\n\n // ================================\n // Context API\n // ================================\n\n const getZoneStateCallback = useCallback((zone: NavigationZone): NavigationZoneState => {\n if (zone === NavigationZone.OVERLAY) {\n return { zone: NavigationZone.OVERLAY, stack: state.overlay, isVisible: state.overlay.length > 0 };\n }\n return state.zones[zone] ?? NavigationUtils.createEmptyZoneState(zone as NavigationZoneName);\n }, [state]);\n \n const getZoneDepthCallback = useCallback((zone: NavigationZone): number => {\n if (zone === NavigationZone.OVERLAY) return state.overlay.length;\n return NavigationUtils.getZoneDepth(getZoneStateCallback(zone));\n }, [getZoneStateCallback, state.overlay.length]);\n \n const getTopContentCallback = useCallback((zone: NavigationZone): NavigationContent | undefined => {\n if (zone === NavigationZone.OVERLAY) {\n const top = state.overlay[state.overlay.length - 1];\n return top?.content;\n }\n const entry = NavigationUtils.getTopEntry(getZoneStateCallback(zone));\n return entry?.content;\n }, [getZoneStateCallback, state.overlay]);\n \n const getTopEntryCallback = useCallback((zone: NavigationZone): NavigationStackEntry | undefined => {\n if (zone === NavigationZone.OVERLAY) {\n return state.overlay[state.overlay.length - 1];\n }\n return NavigationUtils.getTopEntry(getZoneStateCallback(zone));\n }, [getZoneStateCallback, state.overlay]);\n \n const isZoneVisibleCallback = useCallback((zone: NavigationZone): boolean => {\n if (zone === NavigationZone.OVERLAY) return state.overlay.length > 0;\n return getZoneStateCallback(zone).isVisible;\n }, [getZoneStateCallback, state.overlay.length]);\n\n // Calculate resource relationship depth from current primary zone content\n const resourceRelationshipDepth = useMemo(() => {\n const primaryEntry = NavigationUtils.getTopEntry(state.zones[NavigationZoneName.PRIMARY]);\n const primaryContent = primaryEntry?.content;\n if (primaryContent && NavigationUtils.isResourceOperationContent(primaryContent)) {\n return NavigationUtils.calculateResourceRelationshipDepth(\n primaryContent.resourceContext.parentResourcesRequirements as unknown[] | null\n );\n }\n return 0;\n }, [state]);\n\n // Compute if a navigation item is active based on current location\n const isNavigationItemActiveCallback = useCallback((urlPath: string): boolean => {\n return NavigationUtils.isActiveRoute(urlPath, location.pathname);\n }, [location.pathname]);\n\n const setActiveTabCallback = useCallback((zone: NavigationZoneName, entryId: string) => {\n setState(prev => {\n const zoneState = prev.zones[zone];\n if (!zoneState) return prev;\n /*\n * Refuse an id the zone does not hold. A tab that was closed while its trigger was still on\n * screen would otherwise set an `activeTabId` matching no entry, and the renderer would show\n * nothing at all — a blank zone with a full tab bar above it.\n */\n if (!zoneState.stack.some(entry => entry.id === entryId)) return prev;\n if (zoneState.activeTabId === entryId) return prev;\n return {\n ...prev,\n zones: { ...prev.zones, [zone]: { ...zoneState, activeTabId: entryId } },\n };\n });\n }, []);\n\n const reconcileCollapsedZonesCallback = useCallback((situations: CollapsibleZoneSituation[]) => {\n setState(prev => reconcileCollapsedZones(prev, situations));\n }, []);\n\n const contextValue: NavigationContextType = useMemo(() => ({\n state,\n getZoneState: getZoneStateCallback,\n getZoneDepth: getZoneDepthCallback,\n getTopContent: getTopContentCallback,\n getTopEntry: getTopEntryCallback,\n isZoneVisible: isZoneVisibleCallback,\n resourceRelationshipDepth,\n isNavigationItemActive: isNavigationItemActiveCallback,\n focusedZone,\n setFocusedZone,\n setActiveTab: setActiveTabCallback,\n emphasizedZone,\n setEmphasizedZone,\n contentAreaWidth,\n setContentAreaWidth,\n reconcileCollapsedZones: reconcileCollapsedZonesCallback,\n }), [\n state,\n getZoneStateCallback,\n getZoneDepthCallback,\n getTopContentCallback,\n getTopEntryCallback,\n isZoneVisibleCallback,\n resourceRelationshipDepth,\n isNavigationItemActiveCallback,\n setActiveTabCallback,\n focusedZone,\n emphasizedZone,\n contentAreaWidth,\n reconcileCollapsedZonesCallback,\n ]);\n\n return (\n <NavigationContext.Provider value={contextValue}>\n {children}\n </NavigationContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"NavigationContext.js","sourceRoot":"","sources":["../../../../src/core/navigation/NavigationContext.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AAEH,OAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE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n * \n * Manages the navigation state for all zones (primary, secondary, companion) + overlay.\n * Each zone maintains its own navigation stack.\n * \n * v3 state model: { zones: Record<NavigationZoneName, NavigationZoneState>, overlay: NavigationStackEntry[] }\n * — Dialog, sheet, and drawer appearances share a single overlay stack.\n * — Former THIRD zone is now COMPANION.\n * \n * This context subscribes to navigation events and manages state accordingly.\n * Components that need to render zone content subscribe to this context.\n */\n\nimport React, { createContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport { useLocation, useNavigate } from 'react-router';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { flushHeldNavigationCommit } from './navigation-commit';\nimport { type FrontendEvent_AppScopeChanged, type FrontendEvent_PrimaryScopeChanged, type FrontendEvent_NavigationZoneChanged } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { ResourcePrimaryScope, NavigationZoneName, NavigationTransition, type ResourceType } from '@wildo-ai/saas-models';\nimport { zoneMutationTargetIndex } from './zone-visible-entry';\nimport { NavigationUtils } from './navigation.utils';\nimport {\n FrontendEvents,\n FrontendEvent_NavigationPush,\n FrontendEvent_NavigationReplace,\n FrontendEvent_NavigationPop,\n FrontendEvent_NavigationClose,\n FrontendEvent_NavigationClearZone,\n FrontendEvent_NavigationOrganizationFollowed,\n FrontendEvent_NavigationUrlPathUpdated,\n} from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport {\n NavigationState,\n NavigationZoneState,\n NavigationStackEntry,\n NavigationSource,\n NavigationZone,\n NavigationContent,\n NavigationContentType,\n NAVIGATION_STRUCTURAL_ZONES,\n} from './navigation.schemas';\nimport { reconcileCollapsedZones } from './zone-collapse-migration';\nimport { navigationContentOrganizationId } from './zone-entry-organization';\nimport type { CollapsibleZoneSituation } from './zone-collapse-migration';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { resolveRecordOwnRouteChainFromIdentifiers } from '~wildo-frontend-lib/core/resources/record-own-route.frontend.utils';\nimport { frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { ScopeChangeInitiator } from '~wildo-frontend-lib/core/scope/scope.frontend.schemas';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\nconst logDebug: (message: string, context?: Record<string, unknown>) => void = logger.debugByType('NavigationContext');\nlogger.setDebugTypeLogging('NavigationContext', false);\n\n// ================================\n// Context Type\n// ================================\n\nexport interface NavigationContextType {\n state: NavigationState;\n \n getZoneState: (zone: NavigationZone) => NavigationZoneState;\n getZoneDepth: (zone: NavigationZone) => number;\n getTopContent: (zone: NavigationZone) => NavigationContent | undefined;\n getTopEntry: (zone: NavigationZone) => NavigationStackEntry | undefined;\n isZoneVisible: (zone: NavigationZone) => boolean;\n \n resourceRelationshipDepth: number;\n isNavigationItemActive: (urlPath: string) => boolean;\n\n /**\n * Currently focused zone (D11 — focus tracking).\n * Updated when a zone receives interaction (click within data-content-area).\n * Used by the resolver for SPLIT target selection heuristics.\n */\n focusedZone: NavigationZoneName;\n setFocusedZone: (zone: NavigationZoneName) => void;\n\n /**\n * Make one entry the visible tab of a `NavigationZoneContentModel.TABBED` zone.\n *\n * Writes `NavigationZoneState.activeTabId`, which was declared and documented from the beginning\n * and never written by anything — the reason a TABBED zone rendered as an ordinary single stack\n * (#411). Every entry in a tabbed zone stays mounted, so switching is a visibility change and no\n * content is refetched.\n *\n * A no-op for an entry that is not in the zone's stack: a stale tab id from a closed tab must not\n * blank the zone.\n */\n setActiveTab: (zone: NavigationZoneName, entryId: string) => void;\n\n /**\n * The adjacent zone currently given the WHOLE content area, or `null` for the ordinary split.\n *\n * ## What it is for\n *\n * A list-and-detail layout opens a record at two thirds of the width, which is right for reading\n * beside the list it came from and wrong for the moment a reader wants the record alone — a long\n * diff, a wide table, a document. Emphasis is that moment: the emphasized zone takes the full\n * content area and the other structural zones fold away, WITHOUT any of them leaving the\n * navigation state. Nothing is pushed, popped or re-routed; the URL is untouched; restoring is the\n * inverse of the same gesture (the control, or Escape).\n *\n * ## Why it is NAVIGATION state and not a panel size\n *\n * The resizable split already lets a reader drag the divider, bounded by the zone's declared\n * `minWidth` / `maxWidth`, and those bounds are deliberate — a pane should not be dragged into\n * nothing (#952). Emphasis is not a wider drag: it is a different MODE the reader enters and leaves\n * deliberately, and it must survive re-renders of the content areas and be observable by whatever\n * renders the pane's chrome. That is what the navigation context is for. It is transient — never\n * serialised to the URL and never persisted — because a link to a record should open the split the\n * layout declares, not the mode one reader happened to be in.\n *\n * Only `SECONDARY` and `COMPANION` may be emphasized: PRIMARY already has the whole area whenever\n * nothing is beside it. The content areas re-derive the effective emphasis on every render (an\n * emphasized zone that empties or collapses responsively yields the area back), so a stale value\n * here never hides the page.\n */\n emphasizedZone: NavigationZoneName | null;\n setEmphasizedZone: (zone: NavigationZoneName | null) => void;\n\n /**\n * The measured width, in pixels, of the CONTENT AREA the structural zones share — `undefined`\n * until the first layout pass.\n *\n * Published here because it is MEASURED in one place (the content areas, which own the container)\n * and NEEDED in another (the policy resolver, which decides whether a SPLIT can open at all). The\n * window's breakpoint cannot answer that: the content area is narrower by the sidebar, narrower\n * again when a pane is already open, and whatever an embedded shell gives it. Transient and never\n * serialised, like `emphasizedZone` beside it — a layout decision is re-derived from the space\n * that exists now, never restored from a space that existed once.\n */\n contentAreaWidth: number | undefined;\n setContentAreaWidth: (width: number | undefined) => void;\n\n /**\n * Enforce \"a collapsed zone holds nothing\" for every collapsible zone in ONE state update — see\n * `zone-collapse-migration.ts`. Applied against the latest state rather than the last render's, so\n * two zones collapsing or returning together are one decision, and entries move as objects so no\n * field is lost on the way. A no-op (no re-render) when nothing has to move.\n */\n reconcileCollapsedZones: (situations: CollapsibleZoneSituation[]) => void;\n}\n\nexport const NavigationContext: React.Context<NavigationContextType | undefined> = createContext<NavigationContextType | undefined>(undefined);\n\n// ================================\n// Provider\n// ================================\n\ninterface NavigationProviderProps {\n children: React.ReactNode;\n}\n\nexport function NavigationProvider({ children }: NavigationProviderProps): React.ReactElement {\n const [state, setState] = useState<NavigationState>(NavigationUtils.createInitialNavigationState());\n const [focusedZone, setFocusedZone] = useState<NavigationZoneName>(NavigationZoneName.PRIMARY);\n const [emphasizedZone, setEmphasizedZone] = useState<NavigationZoneName | null>(null);\n const [contentAreaWidth, setContentAreaWidth] = useState<number | undefined>(undefined);\n const { on, emit } = useEventBus();\n const location = useLocation(); // Get current location for isActive computation\n const routerNavigate = useNavigate();\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n\n // Keep a ref to the latest navigation state so event handlers\n // always see up-to-date stack entries without re-subscribing.\n const stateRef = useRef(state);\n useEffect(() => {\n stateRef.current = state;\n }, [state]);\n\n // ================================\n // State Update Helpers\n // ================================\n\n const pushEntry = useCallback((zone: NavigationZoneName, entry: NavigationStackEntry) => {\n logDebug('pushEntry', { zone, entryId: entry.id, contentType: entry.content.contentType, urlPath: entry.urlPath, source: entry.navigationSource });\n setState(prev => ({\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...prev.zones[zone],\n stack: [...prev.zones[zone].stack, entry],\n isVisible: true,\n /*\n * A pushed entry in a TABBED zone becomes the active tab. `activeTabId` is only ever written\n * for a tabbed zone, so its presence is the reducer's signal, as in `zoneMutationTargetIndex`.\n * Until 2026-09-25 a push left it alone: once a reader had clicked any tab, every record\n * they opened afterwards landed as a tab that was not shown — the tab bar grew and the\n * screen did not change. Absent, the renderer already shows the top, which is the new entry.\n */\n activeTabId: prev.zones[zone].activeTabId !== undefined ? entry.id : undefined,\n },\n },\n }));\n }, []);\n\n /**\n * Replace what the zone is SHOWING.\n *\n * In a `SINGLE` zone that is the top of the stack. In a `TABBED` zone it is the ACTIVE TAB, which\n * is not the same entry — and until 2026-09-25 this always replaced the top, so with three tabs\n * open and tab 0 on screen a REPLACE silently overwrote tab 2 and the visible tab did not change.\n * The enum's own contract says \"`replace` replaces the ACTIVE TAB's content\".\n *\n * The reducer does not read the layout, so it does not ask for the content model — it reads\n * `activeTabId`, which is written for a TABBED zone and for nothing else. Absent, the visible entry\n * is the top of the stack, which is the SINGLE contract exactly.\n */\n const replaceEntry = useCallback((zone: NavigationZoneName, entry: NavigationStackEntry) => {\n logDebug('replaceEntry', { zone, entryId: entry.id, contentType: entry.content.contentType, urlPath: entry.urlPath, source: entry.navigationSource });\n setState(prev => {\n const zoneState = prev.zones[zone];\n logDebug('replaceEntry: previous stack depth', { zone, previousStackDepth: zoneState.stack.length });\n if (zoneState.stack.length === 0) {\n return { ...prev, zones: { ...prev.zones, [zone]: { ...zoneState, stack: [entry], isVisible: true } } };\n }\n const visibleIndex = zoneMutationTargetIndex(zoneState.stack, zoneState.activeTabId);\n const replacedTheActiveTab = zoneState.activeTabId !== undefined\n && zoneState.stack[visibleIndex]?.id === zoneState.activeTabId;\n const newStack = zoneState.stack.map((existing, index) => (index === visibleIndex ? entry : existing));\n return {\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...zoneState,\n stack: newStack,\n isVisible: true,\n // The replacement becomes the active tab; otherwise the zone shows an entry that is gone.\n activeTabId: replacedTheActiveTab ? entry.id : zoneState.activeTabId,\n },\n },\n };\n });\n }, []);\n\n const popEntry = useCallback((zone: NavigationZoneName, toEntryId?: string) => {\n setState(prev => {\n const zoneState = prev.zones[zone];\n if (zoneState.stack.length === 0) return prev;\n \n let newStack: NavigationStackEntry[];\n let nextActiveTabId = zoneState.activeTabId;\n if (toEntryId) {\n const targetIndex = zoneState.stack.findIndex(e => e.id === toEntryId);\n newStack = targetIndex >= 0\n ? zoneState.stack.slice(0, targetIndex + 1)\n : zoneState.stack.slice(0, -1);\n nextActiveTabId = zoneState.activeTabId !== undefined\n ? newStack[newStack.length - 1]?.id\n : zoneState.activeTabId;\n } else if (zoneState.activeTabId !== undefined) {\n /*\n * ─── In a TABBED zone, back leaves the ACTIVE tab ───────────────────────────────────────\n *\n * `NavigationTransition.PUSH` documents this as \"back navigation pops the stack OR switches\n * to the previous tab\", and until 2026-09-25 it always sliced the LAST entry — so with tab 0\n * on screen, back removed tab 2 and the reader saw nothing change. Removing the active tab\n * and showing its neighbour is what \"switches to the previous tab\" means.\n */\n const activeIndex = zoneMutationTargetIndex(zoneState.stack, zoneState.activeTabId);\n if (zoneState.stack[activeIndex]?.id !== zoneState.activeTabId) {\n newStack = zoneState.stack.slice(0, -1);\n } else {\n newStack = zoneState.stack.filter((_, index) => index !== activeIndex);\n nextActiveTabId = newStack[Math.max(0, activeIndex - 1)]?.id;\n }\n } else {\n newStack = zoneState.stack.slice(0, -1);\n }\n \n return {\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...zoneState,\n stack: newStack,\n activeTabId: newStack.length > 0 ? nextActiveTabId : undefined,\n isVisible: newStack.length > 0 || zone === NavigationZoneName.PRIMARY,\n },\n },\n };\n });\n }, []);\n\n const clearZoneEntries = useCallback((zone: NavigationZoneName, preservePersistent = false) => {\n logDebug('clearZoneEntries called', { zone });\n setState(prev => {\n logDebug('clearZoneEntries: previous stack depth', { zone, previousStackDepth: prev.zones[zone].stack.length });\n /*\n * A fresh start asks to keep a PERSISTENT pane — see `emitFreshStartNavigationCleanup`. Read\n * here because this is the only layer that can see the zone's top entry; the emitter has no\n * state. The whole stack below a persistent top is dropped: what persists is the reference the\n * reader is keeping open, not the history of how they got to it.\n */\n const persistentTop = prev.zones[zone].stack[prev.zones[zone].stack.length - 1];\n if (preservePersistent && persistentTop?.persistent) {\n logDebug('clearZoneEntries: PERSISTENT top kept across the fresh start', { zone });\n return prev.zones[zone].stack.length === 1\n ? prev\n : { ...prev, zones: { ...prev.zones, [zone]: { ...prev.zones[zone], stack: [persistentTop] } } };\n }\n return {\n ...prev,\n zones: {\n ...prev.zones,\n [zone]: {\n ...prev.zones[zone],\n stack: [],\n isVisible: zone === NavigationZoneName.PRIMARY,\n },\n },\n };\n });\n }, []);\n\n /**\n * Remove every entry, from every zone and the overlay, whose content addresses an organization other than\n * `organizationId` (#2276). Run when the session follows the route into that organization: see the\n * `PRIMARY_SCOPE_CHANGED` handler below. Entries addressing no organization (an engine page, the settings hub) stay.\n *\n * A TABBED zone whose active tab is removed shows the last remaining entry, as a POP does.\n */\n const dropEntriesAddressingAnotherOrganization = useCallback((organizationId: string) => {\n const addressesAnother = (entry: NavigationStackEntry): boolean => {\n const entryOrganizationId = navigationContentOrganizationId(entry.content);\n return entryOrganizationId !== null && entryOrganizationId !== organizationId;\n };\n setState(prev => {\n let changed = false;\n const zones = { ...prev.zones };\n for (const zone of NAVIGATION_STRUCTURAL_ZONES) {\n const zoneState = prev.zones[zone];\n const stack = zoneState.stack.filter(entry => !addressesAnother(entry));\n if (stack.length === zoneState.stack.length) continue;\n changed = true;\n logDebug('dropEntriesAddressingAnotherOrganization', { zone, dropped: zoneState.stack.length - stack.length, organizationId });\n const activeTabKept = zoneState.activeTabId === undefined || stack.some(entry => entry.id === zoneState.activeTabId);\n zones[zone] = {\n ...zoneState,\n stack,\n activeTabId: stack.length === 0 ? undefined : activeTabKept ? zoneState.activeTabId : stack[stack.length - 1].id,\n isVisible: stack.length > 0 || zone === NavigationZoneName.PRIMARY,\n };\n }\n const overlay = prev.overlay.filter(entry => !addressesAnother(entry));\n if (overlay.length !== prev.overlay.length) changed = true;\n return changed ? { ...prev, zones, overlay } : prev;\n });\n }, []);\n\n // ================================\n // Overlay Stack Helpers\n // ================================\n\n const pushOverlay = useCallback((entry: NavigationStackEntry) => {\n logDebug('pushOverlay', { entryId: entry.id, contentType: entry.content.contentType, appearance: entry.appearance });\n setState(prev => ({\n ...prev,\n overlay: [...prev.overlay, entry],\n }));\n }, []);\n\n const popOverlay = useCallback((entryId?: string) => {\n setState(prev => {\n if (prev.overlay.length === 0) return prev;\n if (entryId) {\n return { ...prev, overlay: prev.overlay.filter(e => e.id !== entryId) };\n }\n return { ...prev, overlay: prev.overlay.slice(0, -1) };\n });\n }, []);\n\n const clearOverlay = useCallback(() => {\n logDebug('clearOverlay called');\n setState(prev => {\n if (prev.overlay.length === 0) return prev;\n return { ...prev, overlay: [] };\n });\n }, []);\n\n // ================================\n // Event Handlers\n // ================================\n\n /**\n * Subscribes a handler that CHANGES the zone state. Before it applies anything, a navigation commit a shell layout is\n * still holding (a view transition between the screens, `navigation-commit.ts`) lands first — so a later change of\n * any origin (a clean break, a dismiss, a back, the router reconciling a URL) is never undone by an earlier commit\n * landing after it. Every zone-state handler below subscribes through this, which is what makes the order hold\n * whichever emitter the change came from.\n */\n const onZoneStateEvent: typeof on = useCallback((event, handler) => on(event, (payload) => {\n flushHeldNavigationCommit();\n handler(payload);\n }), [on]);\n\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_PUSH, (payload: FrontendEvent_NavigationPush) => {\n logDebug('NAVIGATION_PUSH received', { zone: payload.zone, contentType: payload.content.contentType, urlPath: payload.urlPath, transition: payload.transition });\n const entry: NavigationStackEntry = {\n id: payload.stackEntryId,\n content: payload.content,\n urlPath: payload.urlPath,\n timestamp: Date.now(),\n zone: payload.zone as NavigationZone,\n initiator: payload.initiator as NavigationStackEntry['initiator'],\n navigationSource: payload.navigationSource as NavigationSource,\n transition: payload.transition as NavigationStackEntry['transition'],\n appearance: payload.appearance,\n overlayBehavior: payload.overlayBehavior,\n ephemeral: payload.ephemeral,\n hostedPane: payload.hostedPane,\n collapsedFromZone: payload.collapsedFromZone,\n persistent: payload.persistent,\n };\n if (payload.zone === NavigationZone.OVERLAY) {\n pushOverlay(entry);\n } else {\n pushEntry(payload.zone as NavigationZoneName, entry);\n }\n });\n }, [onZoneStateEvent, pushEntry, pushOverlay]);\n\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_REPLACE, (payload: FrontendEvent_NavigationReplace) => {\n logDebug('NAVIGATION_REPLACE received', { zone: payload.zone, contentType: payload.content.contentType, urlPath: payload.urlPath, transition: payload.transition });\n const entry: NavigationStackEntry = {\n id: payload.stackEntryId,\n content: payload.content,\n urlPath: payload.urlPath,\n timestamp: Date.now(),\n zone: payload.zone as NavigationZone,\n initiator: payload.initiator as NavigationStackEntry['initiator'],\n navigationSource: payload.navigationSource as NavigationSource,\n transition: payload.transition as NavigationStackEntry['transition'],\n appearance: payload.appearance,\n overlayBehavior: payload.overlayBehavior,\n ephemeral: payload.ephemeral,\n hostedPane: payload.hostedPane,\n collapsedFromZone: payload.collapsedFromZone,\n persistent: payload.persistent,\n };\n if (payload.zone === NavigationZone.OVERLAY) {\n // Replace the top of the overlay stack\n setState(prev => {\n if (prev.overlay.length === 0) return { ...prev, overlay: [entry] };\n return { ...prev, overlay: [...prev.overlay.slice(0, -1), entry] };\n });\n } else {\n replaceEntry(payload.zone as NavigationZoneName, entry);\n }\n });\n }, [onZoneStateEvent, replaceEntry]);\n\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_POP, (payload: FrontendEvent_NavigationPop) => {\n logDebug('NAVIGATION_POP received', { zone: payload.zone, toStackEntryId: payload.toStackEntryId });\n if (payload.zone === NavigationZone.OVERLAY) {\n popOverlay(payload.toStackEntryId);\n } else {\n popEntry(payload.zone as NavigationZoneName, payload.toStackEntryId);\n }\n });\n }, [onZoneStateEvent, popEntry, popOverlay]);\n \n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_CLOSE, (payload: FrontendEvent_NavigationClose) => {\n logDebug('NAVIGATION_CLOSE received', { zone: payload.zone, stackEntryId: payload.stackEntryId });\n if (payload.zone === NavigationZone.OVERLAY) {\n if (payload.stackEntryId) {\n popOverlay(payload.stackEntryId);\n } else {\n clearOverlay();\n }\n }\n /*\n * There is no structural branch, and the type is what says so: `FrontendEvent_NavigationClose`\n * declares `zone: z.literal(OVERLAY)` and the bus `safeParse`s every payload, so a structural\n * zone cannot reach here. A branch existed until 2026-09-25 calling a `closeEntry` primitive\n * that was therefore unreachable — and that primitive was the ONE stack mutator without the\n * \"PRIMARY is always visible\" guard its two siblings carry (`popEntry`, `clearZoneEntries`), so\n * widening the schema would have produced an invisible primary zone. The `as NavigationZoneName`\n * cast on the way in is what hid it: it widened a type that can only ever be OVERLAY.\n *\n * Clearing a structural zone is `NAVIGATION_CLEAR_ZONE`, just below.\n */\n });\n }, [onZoneStateEvent, popOverlay, clearOverlay]);\n \n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_CLEAR_ZONE, (payload: FrontendEvent_NavigationClearZone) => {\n logDebug('NAVIGATION_CLEAR_ZONE received', { zone: payload.zone, preservePersistent: payload.preservePersistent });\n clearZoneEntries(payload.zone as NavigationZoneName, payload.preservePersistent === true);\n });\n }, [onZoneStateEvent, clearZoneEntries]);\n\n /*\n * A URL refresh keeps the entry — id, content, depth — and moves only `urlPath`. It is the\n * reconciler's answer to a VIEW-STATE query change (`?section=` on a board): the destination on\n * screen is still the one the URL names, so nothing is rebuilt, nothing is re-keyed and the\n * dependency cleanup (which watches the primary TOP ENTRY, not its URL) stays quiet.\n */\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_URL_PATH_UPDATED, (payload: FrontendEvent_NavigationUrlPathUpdated) => {\n logDebug('NAVIGATION_URL_PATH_UPDATED received', { zone: payload.zone, stackEntryId: payload.stackEntryId, urlPath: payload.urlPath });\n setState(prev => {\n const zoneState = prev.zones[payload.zone as NavigationZoneName];\n if (!zoneState) return prev;\n const index = zoneState.stack.findIndex(entry => entry.id === payload.stackEntryId);\n if (index < 0 || zoneState.stack[index].urlPath === payload.urlPath) return prev;\n const newStack = zoneState.stack.slice();\n newStack[index] = { ...newStack[index], urlPath: payload.urlPath };\n return {\n ...prev,\n zones: { ...prev.zones, [payload.zone]: { ...zoneState, stack: newStack } },\n };\n });\n });\n }, [onZoneStateEvent]);\n\n // ================================\n // Emit NAVIGATION_ZONE_CHANGED after any state mutation\n // ================================\n //\n // Note: useRouterSync suppression is now handled by the NavigationTransaction\n // model (NavigationUtils.beginTransaction / commitTransaction / isInTransaction).\n // Callers that perform multi-step operations (home click, org switch, cascading)\n // begin a transaction before clearing zones, and the transaction auto-commits\n // after the current event loop iteration (setTimeout(0)).\n const previousStateRef = useRef<NavigationState>(state);\n useEffect(() => {\n const prevState = previousStateRef.current;\n previousStateRef.current = state;\n \n // Compare each zone and emit if changed\n for (const zone of NAVIGATION_STRUCTURAL_ZONES) {\n const prev = prevState.zones[zone];\n const curr = state.zones[zone];\n if (prev.stack !== curr.stack) {\n const topEntry = curr.stack[curr.stack.length - 1];\n logDebug('Emitting NAVIGATION_ZONE_CHANGED', { zone, stackDepth: curr.stack.length, previousStackDepth: prev.stack.length });\n emit(FrontendEvents.NAVIGATION_ZONE_CHANGED, {\n zone,\n currentContent: topEntry?.content,\n stackDepth: curr.stack.length,\n previousStackDepth: prev.stack.length,\n });\n }\n }\n }, [state, emit]);\n\n // ================================\n // Zone Dependency Cleanup\n // ================================\n //\n // When PRIMARY's top entry changes, evaluate SECONDARY and COMPANION zones for relevance. It runs on\n // any change except the early returns below: an empty primary, the same entry refreshed, a top that\n // went home from a collapse, the same record (same type and id), or a scope-addressed operation (any\n // collection verb, a list or a CREATE among them) of the same type with the same scope. A record replaced by a scope-addressed\n // operation, or the reverse, always runs it. A PERSISTENT pane is exempt throughout.\n // - SECONDARY is cleared when it no longer relates to the new PRIMARY content, and a\n // non-persistent COMPANION is cleared with it, without a check of its own.\n // - Otherwise COMPANION is kept when it relates to PRIMARY's content or to the SECONDARY content\n // beside it (a record it belongs to, or a collection of its own type with the same parents), and\n // cleared when it relates to neither.\n //\n // This ensures dependent zones don't show stale content from a previous context.\n // For example: User views Projects LIST (PRIMARY) → Project Alpha READ (SECONDARY).\n // Then navigates to Invoices LIST (PRIMARY) → SECONDARY should clear because\n // Invoice LIST has no relationship to Project Alpha.\n //\n // IMPORTANT: This effect uses its OWN ref to track previous PRIMARY state, separate\n // from the ZONE_CHANGED effect above. Both effects depend on `state` and run in\n // declaration order — if they shared the same ref, the ZONE_CHANGED effect would\n // overwrite the ref before this effect reads it, making the cleanup always a no-op.\n const previousPrimaryForCleanupRef = useRef<NavigationZoneState>(state.zones[NavigationZoneName.PRIMARY]);\n useEffect(() => {\n const prevPrimary = previousPrimaryForCleanupRef.current;\n previousPrimaryForCleanupRef.current = state.zones[NavigationZoneName.PRIMARY];\n\n const currPrimary = state.zones[NavigationZoneName.PRIMARY];\n\n // Only react to actual PRIMARY stack changes\n if (prevPrimary.stack === currPrimary.stack) return;\n\n const currTopEntry = currPrimary.stack[currPrimary.stack.length - 1];\n const prevTopEntry = prevPrimary.stack[prevPrimary.stack.length - 1];\n\n // An empty PRIMARY gives the panes nothing to be measured against, so this effect leaves them. The\n // paths that empty primary on purpose clear the dependent zones themselves: the home click through\n // `navigation-clean-break.frontend.utils.ts`, an organization switch in this provider's\n // PRIMARY_SCOPE_CHANGED handler below.\n if (!currTopEntry) return;\n\n // The SAME entry — a `urlPath` refresh after a view-state query change — is not a change of\n // primary at all. Without this the refresh would count as one, and beside a composite primary\n // the relationship-aware rule below would clear the hosted pane on every tab click.\n if (prevTopEntry && prevTopEntry.id === currTopEntry.id) return;\n\n /*\n * A top that went HOME is not a navigation. When a collapsed pane is given back, the entries\n * primary was holding for it leave primary's stack, so its top changes — and read as a\n * navigation, that change would judge the returning panes against the list now on top and could\n * close the very companion that is coming back. The reader navigated nowhere; the viewport\n * widened. (`zone-collapse-migration.ts`)\n */\n if (prevTopEntry?.collapsedFromZone !== undefined && !currPrimary.stack.some(entry => entry.id === prevTopEntry.id)) {\n return;\n }\n\n // If PRIMARY still points at the same target, dependency cleanup can be skipped. Resource type alone\n // is not enough once duplicate edges and same-type parent chains are in play.\n //\n // A RECORD is the same target when its id is. A SCOPE-addressed operation — any collection verb, a list\n // or a CREATE among them — has no id of its own: its type slot holds at most ambient scope, so two of them\n // are the same only when their whole scope is — the todos of one list are not the todos of another (#2115\n // review), while a CREATE pushed over its own list is that list. And a record is never the same target as\n // a scope-addressed operation, even when that scope names the record's id: from a unit to the list of its\n // children is a change. `NavigationUtils.isSameResourceTarget` decides it.\n //\n // The scope comparison is by KEY SHAPE, not by meaning: the same list keyed by type (`todoLists`) and by\n // foreign key (`todoListId`, the cascade's sibling list) compares as different, so the cleanup runs. That\n // errs safe — running it is a relevance check, and a pane that belongs beside the new primary is kept by\n // `isContentRelevantToParent`, which reads both shapes. Skipping it wrongly is what leaves stale panes.\n if (\n prevTopEntry &&\n currTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION &&\n prevTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION &&\n NavigationUtils.isSameResourceTarget(currTopEntry.content.resourceContext, prevTopEntry.content.resourceContext)\n ) {\n return;\n }\n\n const secondaryState = state.zones[NavigationZoneName.SECONDARY];\n let companionHandled = false;\n // Whether THIS run cleared SECONDARY: `secondaryState` is the snapshot from before the clear, so the\n // companion check below must not measure a companion against a pane that is already gone.\n let secondaryCleared = false;\n if (secondaryState.stack.length > 0) {\n const secondaryTop = secondaryState.stack[secondaryState.stack.length - 1];\n if (secondaryTop) {\n /*\n * A HOSTED pane is kept for as long as its host is a non-resource primary. The relevance\n * rule is relationship-aware and a composite view has no relationships, so it would call the\n * pane stale the moment primary changed from empty to the board on a deep link — the #203\n * shape again, one content kind over. Once primary becomes a RESOURCE the ordinary rule\n * applies, and the pane is measured like any other detail.\n */\n const isRelevant = (\n secondaryTop.hostedPane === true\n && currTopEntry.content.contentType !== NavigationContentType.RESOURCE_OPERATION\n ) || NavigationUtils.isContentRelevantToParent(\n secondaryTop.content,\n currTopEntry.content,\n );\n if (!isRelevant && secondaryTop.persistent) {\n logDebug('Zone dependency cleanup: SECONDARY is PERSISTENT — kept across the primary change', {\n paneResourceType: secondaryTop.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? secondaryTop.content.resourceContext.resourceType\n : secondaryTop.content.contentType,\n });\n } else if (!isRelevant) {\n logDebug('Zone dependency cleanup: SECONDARY stale, clearing', {\n primaryResourceType: currTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? currTopEntry.content.resourceContext.resourceType\n : currTopEntry.content.contentType,\n });\n clearZoneEntries(NavigationZoneName.SECONDARY);\n secondaryCleared = true;\n const companionStack = state.zones[NavigationZoneName.COMPANION].stack;\n const companionTopEntry = companionStack[companionStack.length - 1];\n if (companionStack.length > 0 && !companionTopEntry?.persistent) {\n companionHandled = true;\n clearZoneEntries(NavigationZoneName.COMPANION);\n }\n }\n }\n }\n\n const companionState = state.zones[NavigationZoneName.COMPANION];\n if (!companionHandled && companionState.stack.length > 0) {\n const companionTop = companionState.stack[companionState.stack.length - 1];\n if (companionTop) {\n /*\n * The companion is the detail of the pane BESIDE it as much as of primary: in a three-pane chain\n * (a folder, a thread, a message) it belongs to SECONDARY's record. Measuring it against PRIMARY\n * alone cleared a companion whose parent sits in SECONDARY whenever primary held a collection\n * rather than the root record — measured on a reloaded depth-2 URL whose root parent had no page\n * (#2115). So it is kept when it belongs to either. This only ADDS keeps, and only against a\n * SECONDARY this run kept against the new primary (or that is persistent): a SECONDARY cleared just\n * above is excluded, so a companion is never kept for a pane that is gone. (A companion reaching\n * here after that clear is a PERSISTENT one, which the branch below keeps anyway.)\n */\n const secondaryTop = secondaryCleared ? undefined : secondaryState.stack[secondaryState.stack.length - 1];\n const isRelevant = NavigationUtils.isContentRelevantToParent(\n companionTop.content,\n currTopEntry.content,\n ) || (\n !!secondaryTop\n && secondaryTop.content.contentType === NavigationContentType.RESOURCE_OPERATION\n && NavigationUtils.isContentRelevantToParent(companionTop.content, secondaryTop.content)\n );\n /*\n * ─── A PERSISTENT pane is exempt from the DEPENDENCY cleanup ────────────────────────────\n *\n * That is what `TransitionConfig.persistent` has always promised — \"the split zone persists\n * when the source zone's content changes\" — and until 2026-09-25 the modifier only chose\n * COMPANION as the target zone, so the documented reference-panel pattern (a thread, a\n * terminal, a doc kept open while you move around) closed on the first unrelated navigation.\n *\n * Exempt from THIS cleanup only. An explicit dismiss, a clean break and a direct clear all\n * still close it: persistence means \"do not close because the page beneath changed\".\n */\n if (!isRelevant && companionTop.persistent) {\n logDebug('Zone dependency cleanup: COMPANION is PERSISTENT — kept across the primary change', {\n paneResourceType: companionTop.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? companionTop.content.resourceContext.resourceType\n : companionTop.content.contentType,\n });\n } else if (!isRelevant) {\n logDebug('Zone dependency cleanup: COMPANION stale, clearing', {\n primaryResourceType: currTopEntry.content.contentType === NavigationContentType.RESOURCE_OPERATION\n ? currTopEntry.content.resourceContext.resourceType\n : currTopEntry.content.contentType,\n });\n clearZoneEntries(NavigationZoneName.COMPANION);\n }\n }\n }\n }, [state, clearZoneEntries]);\n\n // ================================\n // URL Sync Bridge (AppScope → URL)\n // ================================\n //\n // Keeps the browser URL in sync with the currently selected AppScope values,\n // but ONLY when those scopes are relevant for the current top navigation content.\n // This is intentionally navigation-aware to avoid \"query spam\" and border effects.\n /*\n * ─── A scope change that arrives before the page is placed waits for it (#3746) ──────────────────────\n *\n * A selection persisted from an earlier visit is RESTORED during the cold load (AppScope emits it with\n * `ScopeChangeInitiator.RESTORE`), and the AppScope → URL bridge below is what promotes the loaded listing to\n * the selected list's route. The restore can land before URL sync has placed the loaded page in a zone, and the\n * bridge asks the zone that owns the URL what is on screen: with no owner yet, it had nothing to rewrite and the\n * change was dropped for good. Measured on Wonder Todos (2026-11-14): with a list selected, a cold load of\n * `/organizations/:org/todos` kept the org-wide route and listed every list's todos, while the same RESTORE\n * replayed a second later promoted it to `/todo-lists/:list/todos`. (\"Persisted scope on cold load →\n * auto-promotion\" was verified on 2026-08-18 and no longer happened on 2026-11-14; which commit changed the order is not identified.)\n *\n * So a change that finds no owner is HELD, latest per field, and applied once a zone owns the URL. Only that\n * case is held: a change the bridge decided (rewrote, or had nothing to rewrite for the page on screen) is done.\n */\n const pendingScopeRewritesRef = useRef(new Map<string, FrontendEvent_AppScopeChanged>());\n const applyScopeChangeToUrlRef = useRef<((payload: FrontendEvent_AppScopeChanged) => boolean) | null>(null);\n\n useEffect(() => {\n if (!appScope) {\n return;\n }\n\n /** Applies one scope change to the URL. `false` when no zone owns the URL yet, so there is nothing to rewrite. */\n const applyScopeChangeToUrl = (payload: FrontendEvent_AppScopeChanged): boolean => {\n const currentBrowserUrl = `${location.pathname}${location.search}`;\n const routeOwner = NavigationUtils.findStructuralRouteOwner(\n currentBrowserUrl,\n (zone) => stateRef.current.zones[zone],\n );\n if (!routeOwner) {\n return false;\n }\n\n // A hosted pane's URL is the HOST's, carrying the pane as a parameter; rewriting it to the\n // pane's resolved resource route would drop the host. The pane's address mirrors no scope\n // field today, so there is nothing for this bridge to move.\n if (routeOwner.entry.hostedPane) {\n return true;\n }\n\n const addressedZone = routeOwner.zone;\n const topEntry = routeOwner.entry;\n const topContent = topEntry.content as NavigationContent | undefined;\n if (!topContent) {\n return true;\n }\n\n // Only resource operations are URL-addressable via the URL builder.\n if (topContent.contentType !== NavigationContentType.RESOURCE_OPERATION) {\n return true;\n }\n\n const resourceType = topContent.resourceContext?.resourceType;\n const operation = topContent.resourceContext?.operation as any;\n if (!resourceType || !operation) {\n return true;\n }\n\n const resourceConfig = registry.resourceConfigurations?.[resourceType];\n if (!resourceConfig) {\n return true;\n }\n\n // Rebuild identifiers the same way controller navigation does: keep\n // primary-scope globals filtered to the target resource and merge custom\n // AppScope identifiers separately so unrelated scope keys do not distort\n // route selection or URL rewriting.\n const scopeFilteredGlobalIdentifiers = ScopeUtilsService.primaryScopeToContextIdentifiers(\n ScopeUtilsService.buildInitiatorIds({\n userId: appScope.currentUserId,\n organizationId: appScope.currentOrganizationId,\n applicationId: appScope.currentApplicationId,\n anonymousUserId: appScope.currentAnonymousUserId,\n }),\n resourceConfig.resourcePrimaryScope,\n );\n const customScopeIdentifiers = { ...appScope.buildContextResourceIdentifiers() };\n\n // Overlay the EVENT PAYLOAD onto the scope-derived map. `setScopeValue`\n // emits from a queueMicrotask, so this handler's `appScope` closure may\n // predate the state commit — the payload is the only value guaranteed to\n // be the post-change truth. A cleared field (`newValue: null` or an empty\n // array) must also DELETE its keys here, or the stale map keeps\n // addressing the old value.\n //\n // `newValue` may be a MULTI value (`string[]`, e.g. an isMultiple quick\n // switcher field). URL/route identifiers are scalar, so the payload must\n // go through the SAME first-scalar projection AppScope's own\n // `buildContextResourceIdentifiers()` applies (its\n // `getFirstScopeScalarValue`) — the map this overlay corrects. Treating\n // an array as \"not a string ⇒ cleared\" would delete the key and demote\n // the URL on every change to a selected multi field.\n const rawPayloadValue = Array.isArray(payload.newValue)\n ? payload.newValue[0]\n : payload.newValue;\n const payloadValue = typeof rawPayloadValue === 'string' && rawPayloadValue.length > 0\n ? rawPayloadValue\n : undefined;\n const payloadKeys = [payload.resourceType, payload.fieldIdentifier].filter(Boolean) as string[];\n for (const key of payloadKeys) {\n if (payloadValue) {\n customScopeIdentifiers[key] = payloadValue;\n } else {\n delete customScopeIdentifiers[key];\n }\n }\n\n const explicitIdentifiers = topContent.resourceContext?.contextResourceIdentifiers ?? {};\n const explicitNormalized: Record<string, string> = {};\n for (const [resType, rawValue] of Object.entries(explicitIdentifiers as Record<string, unknown>)) {\n const id = frontendResourceUtils.getResourceId(rawValue as any);\n if (id) {\n explicitNormalized[resType] = id;\n const explicitFieldIdentifier = frontendResourceUtils.getFieldIdentifier(rawValue as any);\n if (explicitFieldIdentifier) {\n explicitNormalized[explicitFieldIdentifier] = id;\n }\n }\n }\n // Scope-owned keys include every DECLARED custom scope field — not only\n // the fields currently holding a value. A cleared scope field's key must\n // stay scope-owned, otherwise the CURRENT route's explicit identifier for\n // it survives as \"preserved explicit\" and the URL can never demote back\n // to the scope-less route (clearing the quick switcher would be a no-op).\n const declaredCustomScopeKeys = (appScope.customScopeFields ?? []).flatMap(field =>\n [field.resourceType, field.fieldIdentifier].filter(Boolean) as string[],\n );\n const scopeOwnedKeys = new Set<string>([\n ...Object.keys(scopeFilteredGlobalIdentifiers),\n ...Object.keys(customScopeIdentifiers),\n ...declaredCustomScopeKeys,\n ]);\n const preservedExplicitIdentifiers = Object.fromEntries(\n Object.entries(explicitNormalized).filter(([key]) => !scopeOwnedKeys.has(key)),\n );\n const candidateContextIdentifiers: Record<string, string> = {\n ...scopeFilteredGlobalIdentifiers,\n ...customScopeIdentifiers,\n ...preservedExplicitIdentifiers,\n };\n\n // Re-resolve the route WITHOUT pinning it to the current route's parent\n // chain. A scope change is precisely the situation where the parent-edge\n // ARITY may need to change: selecting a list on the org-only todos route\n // must PROMOTE the URL to `/…/todo-lists/:todoListId/todos`, and clearing\n // it must DEMOTE back — both routes differ in edge-chain length, so the\n // edge-identity filter (which rejects on arity first) would eliminate the\n // correct candidate before specificity ranking ever saw it. Resolving\n // from scope-satisfiability alone is the SAME semantics launcher items\n // use (`launcher-resolution.ts` passes no requirements), so a sidebar\n // click and a quick-switcher selection land on the same route. Non-scope\n // explicit parents remain in the candidate identifiers, so routes that\n // genuinely need them stay satisfiable and win on specificity.\n //\n // A RECORD page is the exception (#3548, the #2746 invariant): a record opened by id keeps the route its own\n // identity selects — the identifiers the route owns plus the (possibly new) tenancy — so a list selected in the\n // switcher can no longer promote a record of another list under itself. The chain is recomputed from that\n // identity, never taken from the current route, so a tenancy change still moves it. A listing has no own id and\n // is resolved exactly as above. `useNavigationController` and the page's read ask the same function.\n const recordOwnRouteChain = resolveRecordOwnRouteChainFromIdentifiers({\n initiatorInfos: operation.initiatorInfos,\n targetResourceType: resourceType as ResourceType,\n registry,\n ownIdentifiers: preservedExplicitIdentifiers,\n tenancyIdentifiers: scopeFilteredGlobalIdentifiers,\n });\n const resolved = NavigationUtils.resolveResourceUrl(\n resourceConfig as any,\n operation as any,\n candidateContextIdentifiers,\n registry.allResourceFieldIdentifiers,\n recordOwnRouteChain,\n recordOwnRouteChain !== undefined,\n );\n if (!resolved?.resolvedUrl) {\n return true;\n }\n const resolvedPath = resolved.resolvedUrl;\n\n // Preserve non-scope query params (e.g., dataMode), but drop scope_* params.\n const currentParams = new URLSearchParams(location.search);\n for (const key of Array.from(currentParams.keys())) {\n if (key.startsWith('scope_')) {\n currentParams.delete(key);\n }\n }\n const finalUrl = currentParams.toString().length > 0\n ? `${resolvedPath}?${currentParams.toString()}`\n : resolvedPath;\n\n // No-op if URL didn't change.\n if (finalUrl === currentBrowserUrl) {\n return true;\n }\n\n // Rebuild the entry CONTENT for the new URL — replacing only `urlPath`\n // while keeping the old `resourceContext` shipped the previous list's\n // identifiers/parent chain inside the still-mounted surface: the URL\n // rewrote but the LIST kept rendering the old scope's rows (stale data\n // under the new scope). The rebuild mirrors exactly what a fresh mount of\n // the new URL produces (`ResourcePageWrapper` in AppRouter): explicit\n // identifiers from the resolved route's own parameters, merged with live\n // primary + custom scope, and `parentResourcesRequirements` recomputed\n // from the resolved route — so the mounted surface's fetch identity and\n // the HTTP client's route selection both follow the new scope.\n const rewrittenUrlParameters: Record<string, string> = {};\n for (const param of resolved.routePathParameters) {\n const value = candidateContextIdentifiers[param.fieldIdentifier]\n ?? candidateContextIdentifiers[param.resourceType];\n if (value) {\n rewrittenUrlParameters[param.fieldIdentifier] = value;\n }\n }\n const rewrittenUrlContextIdentifiers = frontendResourceUtils.extractResourceIdentifiersFromUrlParams(\n rewrittenUrlParameters,\n registry,\n resolved.routePathParameters as any,\n );\n const rewrittenContextIdentifiers = ScopeUtilsService.buildResourceOperationContextIdentifiers({\n currentUserId: appScope.currentUserId,\n currentOrganizationId: appScope.currentOrganizationId,\n currentApplicationId: appScope.currentApplicationId,\n currentAnonymousUserId: appScope.currentAnonymousUserId,\n primaryScope: resourceConfig.resourcePrimaryScope,\n liveAppScopeContextResourceIdentifiers: customScopeIdentifiers,\n explicitContextResourceIdentifiers: rewrittenUrlContextIdentifiers,\n });\n const rewrittenParentRequirements = frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n resolved.routePathParameters as any,\n resourceType,\n registry,\n );\n const rewrittenContent: NavigationContent = {\n ...topContent,\n resourceContext: frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation,\n contextResourceIdentifiers: rewrittenContextIdentifiers,\n parentResourcesRequirements: rewrittenParentRequirements,\n }),\n };\n\n // Keep Navigation state aligned with browser URL to avoid URL_SYNC loops.\n emit(FrontendEvents.NAVIGATION_REPLACE, {\n zone: addressedZone,\n content: rewrittenContent,\n urlPath: finalUrl,\n stackEntryId: topEntry.id,\n initiator: topEntry.initiator,\n navigationSource: NavigationSource.CONTROLLER,\n transition: NavigationTransition.REPLACE,\n });\n\n routerNavigate(finalUrl, { replace: true });\n return true;\n };\n applyScopeChangeToUrlRef.current = applyScopeChangeToUrl;\n\n return on(FrontendEvents.APP_SCOPE_CHANGED, (payload: FrontendEvent_AppScopeChanged) => {\n // Scope changes that MIRROR the current surface must not re-write the URL:\n // ROUTER came FROM the route, and SURFACE_FILTER came from a listing's\n // active filter — rewriting on either would move the route out from under\n // the very surface that produced the value (and, for ROUTER, loop).\n const fieldKey = payload.fieldIdentifier || payload.resourceType;\n if (payload.initiator === ScopeChangeInitiator.ROUTER\n || payload.initiator === ScopeChangeInitiator.SURFACE_FILTER) {\n // The surface now states this field's value, so a held change to it is no longer the latest word.\n pendingScopeRewritesRef.current.delete(fieldKey);\n return;\n }\n if (applyScopeChangeToUrl(payload)) {\n pendingScopeRewritesRef.current.delete(fieldKey);\n return;\n }\n pendingScopeRewritesRef.current.set(fieldKey, payload);\n });\n }, [appScope, emit, location.pathname, location.search, on, registry, routerNavigate]);\n\n // Apply the held scope changes once a zone owns the URL (see `pendingScopeRewritesRef`). Runs on every zone or\n // location change while something is held; each held change is applied once, in arrival order.\n useEffect(() => {\n const pending = pendingScopeRewritesRef.current;\n const apply = applyScopeChangeToUrlRef.current;\n if (pending.size === 0 || !apply) return;\n for (const [fieldKey, payload] of Array.from(pending.entries())) {\n if (!apply(payload)) return;\n pending.delete(fieldKey);\n }\n }, [state.zones, location.pathname, location.search]);\n\n // ================================\n // Organization Switch → Reset Navigation & Go Home\n // ================================\n //\n // When the user switches organization (PRIMARY_SCOPE_CHANGED with scopeLevel ORGANIZATIONS),\n // all navigation stacks become stale because the data belongs to the previous org.\n // We wrap the entire clear + navigate sequence in a NavigationTransaction to prevent\n // useRouterSync from re-populating stacks with stale content during the transition.\n useEffect(() => {\n return on(FrontendEvents.PRIMARY_SCOPE_CHANGED, (payload: FrontendEvent_PrimaryScopeChanged) => {\n if (payload.scopeLevel !== ResourcePrimaryScope.ORGANIZATIONS) {\n return;\n }\n\n // Skip true no-ops (scope re-published with an unchanged org value).\n if (payload.newValue === payload.previousValue) {\n return;\n }\n\n // Skip the INITIAL establishment of organization scope (previousValue is\n // null). The fresh-start reset below exists to DISCARD STALE prior-org\n // navigation when the user switches between two real organizations — the\n // existing zone stacks point at the previous org's data and must be torn\n // down. A `null -> org` transition has no prior-org navigation to\n // invalidate: it is AppScope resolving the persisted org asynchronously\n // during app bootstrap (hard refresh / deep-link), AFTER the baseline was\n // captured while still org-less. The URL the user loaded (e.g.\n // `/composite/<ref>`) already belongs to this org, so resetting here would\n // clobber a legitimate deep link and bounce the user to home — the exact\n // refresh-loses-the-page bug. Skipping lets useRouterSync /\n // useViewRouterSync reconstruct the loaded URL's navigation state instead.\n //\n // This guard is navigation-only: sibling PRIMARY_SCOPE_CHANGED subscribers\n // still act on establishment (ErrorContext sets the reporting org id,\n // LoadingContext clears its loaded-once cache). Genuine org-to-org switches\n // (and org -> null teardown) keep a real `previousValue` and still reset.\n if (!payload.previousValue) {\n return;\n }\n\n // Skip the session FOLLOWING the route (#2247). The person opened a link into another organization, so\n // the route is the page they asked for and the session moved to match it, not the other way round.\n // Resetting here would send them home from the very page that moved the organization. What the previous\n // organization left in the zones is dropped instead, in the follow's own commit:\n // `NAVIGATION_ORGANIZATION_FOLLOWED`, below (#2276).\n if (payload.initiator === ScopeChangeInitiator.ROUTER) {\n return;\n }\n\n // Begin transaction — useRouterSync will skip sync while active.\n // Auto-commits after the current event loop iteration (setTimeout(0)).\n NavigationUtils.beginTransaction('org_switch');\n\n // Clear all zone stacks + overlay — previous org data is no longer valid\n clearZoneEntries(NavigationZoneName.PRIMARY);\n clearZoneEntries(NavigationZoneName.SECONDARY);\n clearZoneEntries(NavigationZoneName.COMPANION);\n clearOverlay();\n\n // Navigate to home\n routerNavigate('/', { replace: true });\n\n // Transaction auto-commits via setTimeout(0) — no explicit commit needed.\n // The auto-commit fires after React processes the batched state updates and\n // effects, ensuring useRouterSync is suppressed during the entire transition.\n });\n }, [on, clearZoneEntries, clearOverlay, routerNavigate]);\n\n // ================================\n // Route organization followed → drop what the previous organization left (#2276)\n // ================================\n //\n // A followed change keeps the page the person opened (no reset to home, see above), but a pane, an overlay or a\n // backstack entry of the organization they left would now be judged by the new organization's roles and features.\n // `useRouteOrganizationFollow` emits this in the same effect that commits the organization, so the drop and the\n // move land in ONE render. A PRIMARY left empty renders the route outlet, which rebuilds the page from the URL.\n useEffect(() => {\n return onZoneStateEvent(FrontendEvents.NAVIGATION_ORGANIZATION_FOLLOWED, (payload: FrontendEvent_NavigationOrganizationFollowed) => {\n logDebug('NAVIGATION_ORGANIZATION_FOLLOWED received', { organizationId: payload.organizationId });\n dropEntriesAddressingAnotherOrganization(payload.organizationId);\n });\n }, [onZoneStateEvent, dropEntriesAddressingAnotherOrganization]);\n\n // ================================\n // INSPECT Auto-Close (D26)\n // ================================\n //\n // When a zone's stack changes (PUSH, REPLACE, POP, CLEAR), any overlay\n // entries that were opened via INSPECT intent auto-close. COMPANION\n // overlays persist until explicitly closed.\n //\n /**\n * Ephemeral overlay auto-close: when a structural zone's stack changes,\n * any overlay entries that were opened from that zone AND marked ephemeral\n * are automatically removed from the overlay stack.\n *\n * This implements the \"inspect\" pattern: quick-peek overlays that dismiss\n * when the user interacts with the source zone (clicks another item, navigates away).\n */\n useEffect(() => {\n return on(FrontendEvents.NAVIGATION_ZONE_CHANGED, (payload: FrontendEvent_NavigationZoneChanged) => {\n const changedZone = payload.zone as NavigationZoneName;\n if (!NAVIGATION_STRUCTURAL_ZONES.includes(changedZone)) return;\n\n const currentState = stateRef.current;\n const overlayStack = currentState.overlay;\n if (overlayStack.length === 0) return;\n\n const ephemeralFromChangedZone = overlayStack.filter(\n entry => entry.ephemeral === true && entry.initiator?.sourceZone === changedZone,\n );\n\n if (ephemeralFromChangedZone.length === 0) return;\n\n for (const entry of ephemeralFromChangedZone) {\n logDebug('Ephemeral auto-close: closing overlay entry', { entryId: entry.id, changedZone });\n }\n\n const idsToRemove = new Set(ephemeralFromChangedZone.map(e => e.id));\n setState(prev => ({\n ...prev,\n overlay: prev.overlay.filter(e => !idsToRemove.has(e.id)),\n }));\n });\n }, [on]);\n\n // ================================\n // Context API\n // ================================\n\n const getZoneStateCallback = useCallback((zone: NavigationZone): NavigationZoneState => {\n if (zone === NavigationZone.OVERLAY) {\n return { zone: NavigationZone.OVERLAY, stack: state.overlay, isVisible: state.overlay.length > 0 };\n }\n return state.zones[zone] ?? NavigationUtils.createEmptyZoneState(zone as NavigationZoneName);\n }, [state]);\n \n const getZoneDepthCallback = useCallback((zone: NavigationZone): number => {\n if (zone === NavigationZone.OVERLAY) return state.overlay.length;\n return NavigationUtils.getZoneDepth(getZoneStateCallback(zone));\n }, [getZoneStateCallback, state.overlay.length]);\n \n const getTopContentCallback = useCallback((zone: NavigationZone): NavigationContent | undefined => {\n if (zone === NavigationZone.OVERLAY) {\n const top = state.overlay[state.overlay.length - 1];\n return top?.content;\n }\n const entry = NavigationUtils.getTopEntry(getZoneStateCallback(zone));\n return entry?.content;\n }, [getZoneStateCallback, state.overlay]);\n \n const getTopEntryCallback = useCallback((zone: NavigationZone): NavigationStackEntry | undefined => {\n if (zone === NavigationZone.OVERLAY) {\n return state.overlay[state.overlay.length - 1];\n }\n return NavigationUtils.getTopEntry(getZoneStateCallback(zone));\n }, [getZoneStateCallback, state.overlay]);\n \n const isZoneVisibleCallback = useCallback((zone: NavigationZone): boolean => {\n if (zone === NavigationZone.OVERLAY) return state.overlay.length > 0;\n return getZoneStateCallback(zone).isVisible;\n }, [getZoneStateCallback, state.overlay.length]);\n\n // Calculate resource relationship depth from current primary zone content\n const resourceRelationshipDepth = useMemo(() => {\n const primaryEntry = NavigationUtils.getTopEntry(state.zones[NavigationZoneName.PRIMARY]);\n const primaryContent = primaryEntry?.content;\n if (primaryContent && NavigationUtils.isResourceOperationContent(primaryContent)) {\n return NavigationUtils.calculateResourceRelationshipDepth(\n primaryContent.resourceContext.parentResourcesRequirements as unknown[] | null\n );\n }\n return 0;\n }, [state]);\n\n // Compute if a navigation item is active based on current location\n const isNavigationItemActiveCallback = useCallback((urlPath: string): boolean => {\n return NavigationUtils.isActiveRoute(urlPath, location.pathname);\n }, [location.pathname]);\n\n const setActiveTabCallback = useCallback((zone: NavigationZoneName, entryId: string) => {\n setState(prev => {\n const zoneState = prev.zones[zone];\n if (!zoneState) return prev;\n /*\n * Refuse an id the zone does not hold. A tab that was closed while its trigger was still on\n * screen would otherwise set an `activeTabId` matching no entry, and the renderer would show\n * nothing at all — a blank zone with a full tab bar above it.\n */\n if (!zoneState.stack.some(entry => entry.id === entryId)) return prev;\n if (zoneState.activeTabId === entryId) return prev;\n return {\n ...prev,\n zones: { ...prev.zones, [zone]: { ...zoneState, activeTabId: entryId } },\n };\n });\n }, []);\n\n const reconcileCollapsedZonesCallback = useCallback((situations: CollapsibleZoneSituation[]) => {\n setState(prev => reconcileCollapsedZones(prev, situations));\n }, []);\n\n const contextValue: NavigationContextType = useMemo(() => ({\n state,\n getZoneState: getZoneStateCallback,\n getZoneDepth: getZoneDepthCallback,\n getTopContent: getTopContentCallback,\n getTopEntry: getTopEntryCallback,\n isZoneVisible: isZoneVisibleCallback,\n resourceRelationshipDepth,\n isNavigationItemActive: isNavigationItemActiveCallback,\n focusedZone,\n setFocusedZone,\n setActiveTab: setActiveTabCallback,\n emphasizedZone,\n setEmphasizedZone,\n contentAreaWidth,\n setContentAreaWidth,\n reconcileCollapsedZones: reconcileCollapsedZonesCallback,\n }), [\n state,\n getZoneStateCallback,\n getZoneDepthCallback,\n getTopContentCallback,\n getTopEntryCallback,\n isZoneVisibleCallback,\n resourceRelationshipDepth,\n isNavigationItemActiveCallback,\n setActiveTabCallback,\n focusedZone,\n emphasizedZone,\n contentAreaWidth,\n reconcileCollapsedZonesCallback,\n ]);\n\n return (\n <NavigationContext.Provider value={contextValue}>\n {children}\n </NavigationContext.Provider>\n );\n}\n"]}
@@ -99,6 +99,35 @@ export declare function viewerBelongsToOrganization(viewer: LauncherEffectiveRol
99
99
  * every time the context flickers. Role-gated operations stay hidden for such a viewer anyway, by the role check.
100
100
  */
101
101
  export declare function viewerIsKnownOutsideOrganization(viewer: LauncherEffectiveRoles): boolean;
102
+ /**
103
+ * Whether the shell may offer this viewer an operation addressed to ONE person's row (#3791) — the WHOSE-ROW half of the
104
+ * backend's gate, which {@link viewerMayPerformOperation} (the WHO half) does not ask.
105
+ *
106
+ * A `USER_SELF`-scoped operation reaches only the person the request is made by (`authorizeUserSelf`), unless its variant
107
+ * declares `admitsCrossSubjectUserAdministration`; the backend's own account of that reach is `userSubjectReadReach`.
108
+ * So for another person:
109
+ * - the ordinary variant is not this viewer's, whatever role they hold: the `users` default READ is gated `APP_USER`,
110
+ * which every signed-in person holds, and it answers `403` for any row but their own;
111
+ * - an admitting variant is administrative, and is the viewer's only when their roles satisfy it.
112
+ *
113
+ * Measured on Wonder Todos (#3791): an organization administrator clicked a member's name in the Settings Hub, the
114
+ * reference opened the `users` default READ for that member, every read on the page answered `403`, and the page was
115
+ * titled by the person's id over a column of "Couldn't load" panels. Whether an organization administrator should be able
116
+ * to open a member's person page is a product decision the `users` configuration records as not taken; until it is, the
117
+ * honest answer is to offer no door.
118
+ *
119
+ * Outside the question, and answered `true`: an operation that is not `USER_SELF`-scoped (its other gates are unchanged)
120
+ * and a row that is the viewer's own. A subject or viewer that is not known answers `false` — fail closed, the door
121
+ * appears once the session is known. Presentation, never authorization: the backend still decides every request.
122
+ */
123
+ export declare function viewerReachesUserSubject(operation: {
124
+ roles?: readonly string[];
125
+ admitsCrossSubjectUserAdministration?: boolean;
126
+ resourcePrimaryScope?: unknown;
127
+ }, subject: {
128
+ subjectUserId: string | null | undefined;
129
+ viewerUserId: string | null | undefined;
130
+ }, viewer: LauncherEffectiveRoles): boolean;
102
131
  export interface LauncherResolutionContext {
103
132
  registry: FrontendResourcesRegistry;
104
133
  contextResourceIdentifiers?: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"launcher-resolution.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/launcher-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EASL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAEV,uCAAuC,EACvC,yBAAyB,EACzB,gCAAgC,EACjC,MAAM,+DAA+D,CAAC;AAGvE,OAAO,EAAE,qBAAqB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG3F,OAAO,EACL,sBAAsB,EACtB,aAAa,EAEb,yBAAyB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAOpB,KAAK,cAAc,EAMnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EAExB,KAAK,2BAA2B,EACjC,MAAM,iEAAiE,CAAC;AAEzE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAKL,KAAK,uBAAuB,EAC7B,MAAM,wDAAwD,CAAC;AAMhE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACzG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AAiB3G;;;GAGG;AACH;;;;;;;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evB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,SAAS,EACtD,KAAK,EAAE,mBAAmB,EAAE,GAAG,SAAS,EACxC,GAAG,EAAE,yBAAyB,GAC7B,sBAAsB,CAoBxB"}
1
+ {"version":3,"file":"launcher-resolution.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/launcher-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EASL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAEV,uCAAuC,EACvC,yBAAyB,EACzB,gCAAgC,EACjC,MAAM,+DAA+D,CAAC;AAGvE,OAAO,EAAE,qBAAqB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG3F,OAAO,EACL,sBAAsB,EACtB,aAAa,EAEb,yBAAyB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAOpB,KAAK,cAAc,EAMnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EAExB,KAAK,2BAA2B,EACjC,MAAM,iEAAiE,CAAC;AAEzE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAKL,KAAK,uBAAuB,EAC7B,MAAM,wDAAwD,CAAC;AAMhE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACzG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AAiB3G;;;GAGG;AACH;;;;;;;;GAQG;AACH,M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,EAAE,CAsBzB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,eAAe,EAAE,EAC1B,GAAG,EAAE,yBAAyB,GAC7B,uBAAuB,EAAE,CAc3B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,gBAAgB,EAAE,EACzB,GAAG,EAAE,yBAAyB,GAC7B,wBAAwB,EAAE,CAc5B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAAE,EACpB,GAAG,EAAE,yBAAyB,GAC7B,mBAAmB,EAAE,CAevB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,SAAS,EACtD,KAAK,EAAE,mBAAmB,EAAE,GAAG,SAAS,EACxC,GAAG,EAAE,yBAAyB,GAC7B,sBAAsB,CAoBxB"}
@@ -123,6 +123,37 @@ export function viewerIsKnownOutsideOrganization(viewer) {
123
123
  return false;
124
124
  return viewer.applicationRoles.length > 0 || viewer.accessProfile !== null;
125
125
  }
126
+ /**
127
+ * Whether the shell may offer this viewer an operation addressed to ONE person's row (#3791) — the WHOSE-ROW half of the
128
+ * backend's gate, which {@link viewerMayPerformOperation} (the WHO half) does not ask.
129
+ *
130
+ * A `USER_SELF`-scoped operation reaches only the person the request is made by (`authorizeUserSelf`), unless its variant
131
+ * declares `admitsCrossSubjectUserAdministration`; the backend's own account of that reach is `userSubjectReadReach`.
132
+ * So for another person:
133
+ * - the ordinary variant is not this viewer's, whatever role they hold: the `users` default READ is gated `APP_USER`,
134
+ * which every signed-in person holds, and it answers `403` for any row but their own;
135
+ * - an admitting variant is administrative, and is the viewer's only when their roles satisfy it.
136
+ *
137
+ * Measured on Wonder Todos (#3791): an organization administrator clicked a member's name in the Settings Hub, the
138
+ * reference opened the `users` default READ for that member, every read on the page answered `403`, and the page was
139
+ * titled by the person's id over a column of "Couldn't load" panels. Whether an organization administrator should be able
140
+ * to open a member's person page is a product decision the `users` configuration records as not taken; until it is, the
141
+ * honest answer is to offer no door.
142
+ *
143
+ * Outside the question, and answered `true`: an operation that is not `USER_SELF`-scoped (its other gates are unchanged)
144
+ * and a row that is the viewer's own. A subject or viewer that is not known answers `false` — fail closed, the door
145
+ * appears once the session is known. Presentation, never authorization: the backend still decides every request.
146
+ */
147
+ export function viewerReachesUserSubject(operation, subject, viewer) {
148
+ if (operation.resourcePrimaryScope !== ResourcePrimaryScope.USER_SELF)
149
+ return true;
150
+ if (subject.subjectUserId && subject.viewerUserId && subject.subjectUserId === subject.viewerUserId)
151
+ return true;
152
+ // The role question alone (`viewerHoldsOneOfRoles`): the tenant rules `viewerMayPerformOperation` adds — the crossing
153
+ // into another organization, unit narrowing — govern an organization's rows, and a person's row is in no organization.
154
+ // Through them an application administrator reading a member of an organization they hold no role in was refused.
155
+ return operation.admitsCrossSubjectUserAdministration === true && viewerHoldsOneOfRoles(operation.roles, viewer);
156
+ }
126
157
  /**
127
158
  * A COLLECTION-shaped variant that crosses into a tenant (`admitsCrossTenantPlatformAdministration`: a LIST, SEARCH,
128
159
  * COUNT, CREATE-like or `*_MANY` verb) is the platform operator's door into an organization they do NOT belong to (#2315). For a