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

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 (94) hide show
  1. package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
  2. package/dist/esm/components/flows-actors/approval.labels.js +3 -0
  3. package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
  4. package/dist/esm/components/flows-actors/task-detail.d.ts +12 -1
  5. package/dist/esm/components/flows-actors/task-detail.d.ts.map +1 -1
  6. package/dist/esm/components/flows-actors/task-detail.js +2 -2
  7. package/dist/esm/components/flows-actors/task-detail.js.map +1 -1
  8. package/dist/esm/components/settings/AppPage_AgentActivitySettings.d.ts +79 -0
  9. package/dist/esm/components/settings/AppPage_AgentActivitySettings.d.ts.map +1 -0
  10. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js +271 -0
  11. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js.map +1 -0
  12. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.d.ts +3 -0
  13. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.d.ts.map +1 -0
  14. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.js +66 -0
  15. package/dist/esm/components/settings/AppPage_AgentActivitySettings.labels.js.map +1 -0
  16. package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
  17. package/dist/esm/components/settings/SettingsHub.js +6 -0
  18. package/dist/esm/components/settings/SettingsHub.js.map +1 -1
  19. package/dist/esm/components/views/composite-view/CompositeView.d.ts +6 -0
  20. package/dist/esm/components/views/composite-view/CompositeView.d.ts.map +1 -1
  21. package/dist/esm/components/views/composite-view/CompositeView.js +12 -2
  22. package/dist/esm/components/views/composite-view/CompositeView.js.map +1 -1
  23. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.d.ts +57 -0
  24. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.d.ts.map +1 -0
  25. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.js +136 -0
  26. package/dist/esm/components/views/flows-actors-view/ConversationLinkPage.js.map +1 -0
  27. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts +20 -0
  28. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts.map +1 -1
  29. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js +139 -22
  30. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js.map +1 -1
  31. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.labels.d.ts.map +1 -1
  32. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.labels.js +5 -0
  33. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.labels.js.map +1 -1
  34. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.d.ts +4 -0
  35. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.d.ts.map +1 -1
  36. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.js +19 -0
  37. package/dist/esm/components/views/flows-actors-view/held-conversation-selection.js.map +1 -1
  38. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.d.ts +26 -0
  39. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.d.ts.map +1 -0
  40. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.js +3 -0
  41. package/dist/esm/components/views/flows-actors-view/linked-conversation.context.js.map +1 -0
  42. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
  43. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +1 -0
  44. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
  45. package/dist/esm/core/config/composite-view.schemas.d.ts +19 -0
  46. package/dist/esm/core/config/composite-view.schemas.d.ts.map +1 -1
  47. package/dist/esm/core/config/composite-view.schemas.js.map +1 -1
  48. package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
  49. package/dist/esm/core/config/engine-settings-destinations.js +23 -0
  50. package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
  51. package/dist/esm/core/config/settings-hub-presentation.frontend.utils.d.ts.map +1 -1
  52. package/dist/esm/core/config/settings-hub-presentation.frontend.utils.js +3 -0
  53. package/dist/esm/core/config/settings-hub-presentation.frontend.utils.js.map +1 -1
  54. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +12 -0
  55. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
  56. package/dist/esm/core/config/settings-hub.frontend.schemas.js +12 -0
  57. package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
  58. package/dist/esm/core/events/events.frontend.schemas.d.ts +16 -0
  59. package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
  60. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +10 -1
  61. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
  62. package/dist/esm/core/flows-actors/FlowsActorsContext.js +12 -3
  63. package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
  64. package/dist/esm/core/flows-actors/conversation-history.model.d.ts +19 -1
  65. package/dist/esm/core/flows-actors/conversation-history.model.d.ts.map +1 -1
  66. package/dist/esm/core/flows-actors/conversation-history.model.js +45 -4
  67. package/dist/esm/core/flows-actors/conversation-history.model.js.map +1 -1
  68. package/dist/esm/core/navigation/NavigationContentAreas.d.ts +0 -5
  69. package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
  70. package/dist/esm/core/navigation/NavigationContentAreas.js +27 -1
  71. package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
  72. package/dist/esm/core/navigation/navigation.schemas.d.ts +20 -0
  73. package/dist/esm/core/navigation/navigation.schemas.d.ts.map +1 -1
  74. package/dist/esm/core/navigation/navigation.schemas.js +4 -0
  75. package/dist/esm/core/navigation/navigation.schemas.js.map +1 -1
  76. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  77. package/dist/esm/core/navigation/useNavigationRouterSync.js +5 -1
  78. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  79. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +20 -1
  80. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  81. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +25 -0
  82. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  83. package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
  84. package/dist/esm/core/resources/resources-repository.frontend.service.js +2 -0
  85. package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
  86. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  87. package/dist/esm/core/runtime/AppRouter.js +2 -1
  88. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  89. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts +6 -0
  90. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts.map +1 -1
  91. package/dist/esm/core/runtime/routes.frontend.definitions.js +7 -1
  92. package/dist/esm/core/runtime/routes.frontend.definitions.js.map +1 -1
  93. package/dist/tsconfig.build.tsbuildinfo +1 -1
  94. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsHub.js","sourceRoot":"","sources":["../../../../src/components/settings/SettingsHub.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAC/I,OAAO,EAAE,IAAI,EAAE,QA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;;;;GA6BG;AACH,SAAS,+BAA+B,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAItF;IACC,MAAM,YAAY,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,CAAC,YAAY,CAAC,WAAW,IAAI,YAAY,CAAC,QAAQ,KAAK,6BAA6B,CAAC,IAAI,CAAC;IAC9G,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACtE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,yEAAyE;QACzE,OAAO,cAAK,SAAS,EAAC,cAAc,YAAC,KAAC,WAAW,IAAC,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAe,GAAM,CAAC;IACzG,CAAC;IACD,OAAO,CACL,eAAK,SAAS,EAAC,cAAc,aAC3B,KAAC,KAAK,IAAC,OAAO,EAAC,MAAM,YACnB,KAAC,gBAAgB,cAAE,uBAAuB,GAAoB,GACxD,EAEP,cAAc,IAAI,KAAC,WAAW,IAAC,SAAS,EAAE,SAAS,YAAG,IAAI,GAAe,EACzE,QAAQ,IACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * SettingsHub — the unified settings surface.\n *\n * Renders the declarative `ResolvedSettingsHubConfig` as a vertical NAVIGATION rail beside a\n * content panel. Categories become labelled groups of links, each destination addressed by its own\n * URL. A section's `target` resolves to a framework panel, an auto-rendered resource surface, a\n * custom component, or a set of horizontal sub-tabs.\n *\n * The rail was a `Tabs`/`TabsList` until 2026-09-19, chosen so that section state and keyboard\n * roving came from the primitive rather than being hand-rolled. It became navigation because a\n * tablist switches panels WITHIN a view while these are thirty destinations that each own a URL —\n * and the keyboard argument dissolves rather than transferring: roving tabindex is a tablist\n * requirement, and navigation wants ordinary Tab order through links. See the rail's own comment.\n *\n * The SUB-TABS are still `Tabs`, correctly: Configuration/Connections inside one destination is\n * exactly what a tablist is for.\n *\n * Mounted by `NavigationContentRenderer` for `NavigationContentType.SETTINGS_HUB`\n * (always in the overlay zone). The `sectionRef` prop names the open\n * section: it wins whenever the gated config admits it (see `active` below).\n */\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { Link, useNavigate } from 'react-router';\nimport { ViewportBreakpoint } from '@wildo-ai/zod-decorators';\nimport { CorePresetNames, FrontendComponentType, SelectableVariant, TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '~wildo-frontend-lib/components/sections/tabs';\nimport { Separator } from '~wildo-frontend-lib/components/layout/separator';\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { ButtonSize } from '@wildo-ai/presets-components-models';\nimport { useIconRegistry } from '~wildo-frontend-lib/core/icons/useIconRegistry';\nimport { IconSize, StandardIconReference } from '~wildo-frontend-lib/core/icons/icon-registry.frontend.schemas';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { AppPage_SecuritySettings } from '~wildo-frontend-lib/components/auth/admin-config/AppPage_SecuritySettings';\nimport { AppPage_AppearanceSettings } from './AppPage_AppearanceSettings';\nimport { AppPage_InvitationsSettings } from './AppPage_InvitationsSettings';\nimport { AppPage_BillingSettings } from './AppPage_BillingSettings';\nimport { ExternalProvider_Connection_OwnerScope } from '@wildo-ai/external-connectors-models';\nimport { AppPage_ConnectedAccountsSettings } from './AppPage_ConnectedAccountsSettings';\nimport { AppPage_AgentWorkOverrideRateSettings } from './AppPage_AgentWorkOverrideRateSettings';\nimport { AppPage_AutonomousAgentsSettings } from './AppPage_AutonomousAgentsSettings';\nimport { AppPage_ModelCostBreakdownSettings, ModelCostBreakdownScope } from './AppPage_ModelCostBreakdownSettings';\nimport { AppPage_RepresentativeActivitySettings } from './AppPage_RepresentativeActivitySettings';\nimport { AppPage_AgentWorkEvaluationExportSettings } from './AppPage_AgentWorkEvaluationExportSettings';\nimport { ComponentRegistryService } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.service';\nimport { ComponentNotInjected } from '~wildo-frontend-lib/core/components-registry/ComponentNotInjected';\nimport { SettingsPanelRef, SettingsSectionTargetKind } from '~wildo-frontend-lib/core/config/settings-hub.frontend.schemas';\nimport type {\n ResolvedSettingsHubConfig,\n SettingsCategory,\n SettingsCategoryGroup,\n SettingsSection,\n SettingsSectionTarget,\n SettingsSubTabsTarget,\n} from '~wildo-frontend-lib/core/config/settings-hub.frontend.schemas';\nimport { CommonRoutePaths } from '~wildo-frontend-lib/core/runtime/routes.frontend.definitions';\nimport { useVisibleSettingsHubConfig } from '~wildo-frontend-lib/core/config/useVisibleSettingsHubConfig';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { FeatureGate } from '~wildo-frontend-lib/core/features/FeatureGate';\nimport { useFeatureAvailability } from '~wildo-frontend-lib/core/features/useFeatureAvailability';\nimport { Alert, AlertDescription } from '~wildo-frontend-lib/components/overlays/containers/alert';\nimport { FeatureUnavailabilityBehavior } from '@wildo-ai/saas-models';\nimport { LoadingGate } from '~wildo-frontend-lib/core/loading/LoadingGate';\nimport { SettingsResourceOperationPanel } from './SettingsResourceOperationPanel';\n\n// ──────────────────────────────────────────────────────────────\n// Config helpers\n// ──────────────────────────────────────────────────────────────\n\nfunction orderedCategories(config: ResolvedSettingsHubConfig): SettingsCategory[] {\n return [...config.categories].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n}\n\nfunction sectionsForCategory(config: ResolvedSettingsHubConfig, categoryRef: string): SettingsSection[] {\n return config.sections\n .filter(section => section.categoryRef === categoryRef)\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n}\n\n/**\n * A category's rail in sub-category blocks (#2329): its ungrouped sections first, with no heading, then each declared\n * group in order with its sections. A group no placed section names draws nothing, and a section naming an undeclared\n * group (refused by the DEV verifier) is drawn with the ungrouped ones rather than lost.\n */\nfunction railBlocks(category: SettingsCategory, sections: SettingsSection[]): Array<{ group?: SettingsCategoryGroup; sections: SettingsSection[] }> {\n const groups = [...(category.groups ?? [])].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n const declared = new Set(groups.map(group => group.ref));\n const ungrouped = sections.filter(section => section.groupRef === undefined || !declared.has(section.groupRef));\n return [\n ...(ungrouped.length > 0 ? [{ sections: ungrouped }] : []),\n ...groups\n .map(group => ({ group, sections: sections.filter(section => section.groupRef === group.ref) }))\n .filter(block => block.sections.length > 0),\n ];\n}\n\n/** Resolve the section to open: requested → config default → first section. */\nfunction resolveActiveSection(config: ResolvedSettingsHubConfig, sectionRef?: string): string | undefined {\n if (sectionRef && config.sections.some(section => section.ref === sectionRef)) return sectionRef;\n if (config.defaultSectionRef && config.sections.some(section => section.ref === config.defaultSectionRef)) {\n return config.defaultSectionRef;\n }\n return config.sections[0]?.ref;\n}\n\n// ──────────────────────────────────────────────────────────────\n// Target rendering (function declarations → hoisted for mutual recursion\n// between a SUB_TABS target and its leaf targets)\n// ──────────────────────────────────────────────────────────────\n\nfunction SettingsEnginePanel({ panelRef }: { panelRef: SettingsPanelRef }): React.JSX.Element {\n switch (panelRef) {\n case SettingsPanelRef.SECURITY:\n return <AppPage_SecuritySettings />;\n case SettingsPanelRef.APPEARANCE:\n return <AppPage_AppearanceSettings />;\n case SettingsPanelRef.INVITATIONS:\n return <AppPage_InvitationsSettings />;\n case SettingsPanelRef.BILLING:\n return <AppPage_BillingSettings />;\n case SettingsPanelRef.CONNECTED_ACCOUNTS:\n return <AppPage_ConnectedAccountsSettings ownerScope={ExternalProvider_Connection_OwnerScope.USER} />;\n case SettingsPanelRef.ORGANIZATION_CONNECTED_ACCOUNTS:\n // The scope is passed EXPLICITLY at both sites rather than left to the component's default.\n // A default is invisible at the call site, and the one thing a reader must be able to see here\n // is whose account each panel connects.\n return <AppPage_ConnectedAccountsSettings ownerScope={ExternalProvider_Connection_OwnerScope.ORGANIZATION} />;\n case SettingsPanelRef.APPLICATION_CONNECTED_ACCOUNTS:\n // The application's own account (#3579): the third owner, passed explicitly for the same reason.\n return <AppPage_ConnectedAccountsSettings ownerScope={ExternalProvider_Connection_OwnerScope.APPLICATION} />;\n case SettingsPanelRef.AGENT_WORK_OVERRIDE_RATE:\n return <AppPage_AgentWorkOverrideRateSettings />;\n case SettingsPanelRef.AUTONOMOUS_AGENTS:\n return <AppPage_AutonomousAgentsSettings />;\n case SettingsPanelRef.MODEL_COST_BREAKDOWN:\n // Whose cost is passed EXPLICITLY at both sites, as for connected accounts above.\n return <AppPage_ModelCostBreakdownSettings scope={ModelCostBreakdownScope.APPLICATION} />;\n case SettingsPanelRef.REPRESENTING_ORGANIZATION_MODEL_COST_BREAKDOWN:\n return <AppPage_ModelCostBreakdownSettings scope={ModelCostBreakdownScope.REPRESENTING_ORGANIZATION} />;\n case SettingsPanelRef.REPRESENTATIVE_ACTIVITY:\n return <AppPage_RepresentativeActivitySettings />;\n case SettingsPanelRef.AGENT_WORK_EVALUATION_EXPORT:\n return <AppPage_AgentWorkEvaluationExportSettings />;\n }\n}\n\n/** Resolves a display label for a section/sub-tab ref, falling back to the authored label. */\ntype SettingsLabelResolver = (ref: string, fallbackLabel: string) => string;\n\nfunction SettingsTargetRenderer({\n target,\n resolveSubTabLabel,\n subTabRef,\n onSubTabChange,\n}: {\n target: SettingsSectionTarget;\n resolveSubTabLabel: SettingsLabelResolver;\n subTabRef?: string;\n onSubTabChange?: (subTabRef: string) => void;\n}): React.JSX.Element {\n switch (target.kind) {\n case SettingsSectionTargetKind.ENGINE_PANEL:\n return <SettingsEnginePanel panelRef={target.panelRef} />;\n case SettingsSectionTargetKind.CUSTOM_COMPONENT: {\n const CustomComponent = ComponentRegistryService.resolve(\n target.componentRef,\n CorePresetNames.DEFAULT,\n );\n if (!CustomComponent) {\n return <ComponentNotInjected componentType={target.componentRef} componentName={target.componentRef} />;\n }\n return (\n <React.Suspense fallback={<div className=\"h-8 animate-pulse motion-reduce:animate-none bg-muted rounded\" aria-hidden=\"true\" />}>\n <CustomComponent />\n </React.Suspense>\n );\n }\n case SettingsSectionTargetKind.RESOURCE_OPERATION:\n return (\n <SettingsResourceOperationPanel\n resourceType={target.resourceType}\n operation={target.operation}\n operationVariant={target.operationVariant}\n />\n );\n case SettingsSectionTargetKind.SUB_TABS:\n return (\n <SettingsSubTabs\n target={target}\n resolveSubTabLabel={resolveSubTabLabel}\n subTabRef={subTabRef}\n onSubTabChange={onSubTabChange}\n />\n );\n }\n}\n\n/**\n * The sub-tab strip inside one section.\n *\n * The active tab is URL-DRIVEN since 2026-09-17. It used to be `useState(target.subTabs[0]?.ref)` —\n * local state that read nothing from the URL — so all twenty-one sub-tab panels in the shipped\n * catalogue were unaddressable: every link to a sub-tabbed section opened its FIRST tab, and\n * \"Single sign-on → Connections\" could not be sent to anybody. That contradicted the hub's own\n * contract, which is that the URL is its single source of truth, and it made the outcome banner a\n * connect-callback renders depend on tab ORDER rather than on the URL it returns to.\n *\n * A `subTabRef` the section does not declare is IGNORED rather than refused: the tab falls back to\n * the first entry, so a stale bookmark or a hand-typed segment still opens the section instead of an\n * error. `onSubTabChange` writes the selection back, which is what makes the strip a navigation\n * control rather than a widget with a URL beside it.\n */\nfunction SettingsSubTabs({\n target,\n resolveSubTabLabel,\n subTabRef,\n onSubTabChange,\n}: {\n target: SettingsSubTabsTarget;\n resolveSubTabLabel: SettingsLabelResolver;\n subTabRef?: string;\n onSubTabChange?: (subTabRef: string) => void;\n}): React.JSX.Element | null {\n const active = target.subTabs.some(subTab => subTab.ref === subTabRef)\n ? subTabRef\n : target.subTabs[0]?.ref;\n if (target.subTabs.length === 0) return null;\n return (\n <Tabs value={active} onValueChange={next => onSubTabChange?.(next)}>\n <TabsList>\n {target.subTabs.map(subTab => (\n // `data-ref` is the i18n-independent automation hook (labels are\n // runtime-translated; e2e drives must never key off them).\n <TabsTrigger key={subTab.ref} value={subTab.ref} data-ref={subTab.ref}>\n {resolveSubTabLabel(subTab.ref, subTab.label)}\n </TabsTrigger>\n ))}\n </TabsList>\n {target.subTabs.map(subTab => (\n <TabsContent key={subTab.ref} value={subTab.ref}>\n {/* Leaf targets only (schema forbids nested sub-tabs); the resolver is\n still threaded to satisfy the shared renderer signature. */}\n <SettingsTargetRenderer target={subTab.target} resolveSubTabLabel={resolveSubTabLabel} />\n </TabsContent>\n ))}\n </Tabs>\n );\n}\n\n/**\n * A rail item's layout classes — full-width, left-aligned, icon-tolerant.\n *\n * Carried here rather than reused from the tab trigger because the rail is no longer a tab: this is\n * a navigation item and owns its own shape. Only the SELECTED treatment is shared, and that comes\n * from the theme recipe rather than from a copied class string, so a theme change still reaches\n * both.\n */\nconst RAIL_ITEM_CLASSES =\n \"inline-flex w-full cursor-pointer items-center justify-start gap-1.5 whitespace-nowrap rounded-md px-card-sm py-item text-sm font-medium no-underline [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\";\n\n// ──────────────────────────────────────────────────────────────\n// Hub\n// ──────────────────────────────────────────────────────────────\n\nexport interface SettingsHubProps {\n /** The section the URL names. It is open whenever the gated config admits it; until then, the config default. */\n sectionRef?: string;\n /** Sub-tab of `sectionRef` to pre-open; ignored when the section declares no such tab. */\n subTabRef?: string;\n}\n\nexport function SettingsHub({ sectionRef, subTabRef }: SettingsHubProps): React.JSX.Element {\n const config = useVisibleSettingsHubConfig();\n const categories = useMemo(() => orderedCategories(config), [config]);\n /*\n * The open section is DERIVED from the URL and the gated config, on every render. It is not\n * state, and it was until 2026-10-02 (#2190), when it held a fallback that outlived its reason.\n *\n * The gated config arrives in stages: on a cold load the first answer is built before the\n * organization's features resolve, so a feature-gated destination (`sso`, `scim`) is absent from\n * it. The old state machine resolved `/settings/sso` against that first config, fell back to the\n * first section (Profile), then kept Profile when `sso` joined the config, because Profile was\n * still selectable. Its URL effect did not help, since `sectionRef` never changed. A deep link or\n * a reload of a gated destination therefore opened the wrong pane for good, while a rail click\n * opened the right one.\n *\n * Deriving it removes the \"current choice\" that a fallback could become. The URL can stand for\n * the person's choice because the rail's links write it (`to` + `replace`) and nothing else\n * selects a section, so `sectionRef` is always the section the person last asked for. Whenever it\n * is selectable it is the open section, whatever order the gating signals land in. When it is not\n * (yet) selectable, the default stands in, and the requested section takes over the moment the\n * config admits it. The earlier concern that kept `config` out of the sync effect, config\n * identity churning and resetting a rail click, has no purchase here: a click changes\n * `sectionRef` itself, so a re-derivation can only re-confirm it.\n */\n const active = useMemo(() => resolveActiveSection(config, sectionRef), [config, sectionRef]);\n const routerNavigate = useNavigate();\n\n /*\n * In-hub navigation WRITES the URL. Until 2026-09-17 it did not, at either level: the rail set\n * local state and the sub-tab strip held its own, so the address bar kept whatever section the\n * hub was opened at. Deep-linking IN worked and linking OUT never did — you could be looking at\n * Administration → Single sign-on → Connections with `/settings/profile` in the address bar, and\n * no sequence of clicks produced a URL for where you were.\n *\n * REPLACE rather than push, deliberately. A settings rail is a switcher, not a trail: pushing\n * would make Back walk every section a person browsed before leaving the hub, which is the\n * behaviour the overlay's own dismiss already owns. Replace keeps the address bar truthful and\n * leaves Back meaning \"leave settings\".\n *\n * The overlay reconciler converges on the new URL — it keys on section AND sub-tab, so a tab\n * switch inside one section is seen as a change rather than as already-correct. There is no loop:\n * only a user gesture calls these, and the reconciler emits no navigation of its own.\n */\n // The SECTION half of this used to be `navigateToSection`, which the rail's triggers called. The\n // rail's links now carry `to` + `replace` themselves, and `active` is derived from the URL\n // (see its declaration above) — so the helper had no caller left. The SUB-TAB half stays: those really are tabs.\n\n const handleSubTabChange = useCallback((nextSubTabRef: string) => {\n if (!active) return;\n routerNavigate(`${CommonRoutePaths.settings}/${active}/${nextSubTabRef}`, { replace: true });\n }, [active, routerNavigate]);\n\n /*\n * On a small screen the hub is a BACK-STACK rather than two panes.\n *\n * It had no responsive treatment at all before 2026-09-17 — a fixed `w-60 shrink-0` rail at every\n * width, which is 240px of a ~375px viewport, and the rail is now thirty entries rather than\n * sixteen. The back-stack is chosen over a drawer or a collapsed select because the panel BELOW\n * already works this way: `SettingsSectionNavigationHost` keeps a section's own drill-ins\n * (view → edit → back) inside the panel, so mobile becomes the same mechanism one level up\n * instead of a second navigation concept.\n *\n * WHICH screen shows is the URL's business, not local state: `/settings` is the list and\n * `/settings/:sectionRef` is a section. That falls out of the hub's own contract — the URL is its\n * single source of truth — and it means Back, a deep link and a shared link all agree without any\n * of them being special-cased.\n *\n * Both panes stay MOUNTED and only their classes change. `field-chrome-and-sections.md` Gotcha 1b\n * records what the alternative costs: a chrome that swapped element structure across a breakpoint\n * remounted its control and dropped a pending edit on resize. Hiding is a class here for exactly\n * that reason.\n */\n const { UIConfig, getRecipe } = useUI();\n /*\n * The rail item's SELECTED styling comes from the theme's SELECTABLE/FILLED recipe — the same one\n * the vertical tab trigger used, so the rail looks exactly as it did and still follows whatever a\n * theme dresses it in. The recipe keys on `data-state`, which each link sets from `active`.\n */\n const railItemRecipe = getRecipe(UIBehavior.SELECTABLE, SelectableVariant.FILLED);\n const eyebrowRecipe = getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.EYEBROW);\n // A sub-category heading (#2329) sits one step below its category's eyebrow.\n const groupHeadingRecipe = getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.LABEL);\n const { renderIcon } = useIconRegistry();\n const isMobile = UIConfig?.currentBreakpoint === ViewportBreakpoint.MOBILE;\n const mobileShowsSection = isMobile && Boolean(sectionRef);\n\n const handleBackToSections = useCallback(() => {\n routerNavigate(CommonRoutePaths.settings, { replace: true });\n }, [routerNavigate]);\n\n\n const { tComponent, tSettingsHubCategory, tSettingsHubGroup, tSettingsHubSection, isReady } = useI18n({\n component: FrontendComponentType.APP_LAYOUTS_SETTINGS_HUB,\n });\n // Hub chrome labels (title, rail aria-label) read from the scoped component\n // namespace. Copy is owned by the labelling pipeline (declared in the sibling\n // `.labels.ts`), so there are deliberately no inline fallback strings — the\n // hub gates on `isReady` below, the same convention as the panels it hosts\n // (`AppPage_SecuritySettings` / `AppPage_AppearanceSettings`). The dynamic\n // category/section labels keep their config-authored `fallbackLabel` (the\n // required contract of `tSettingsHubCategory` / `tSettingsHubSection`).\n const t = useCallback(\n (key: string) => tComponent(FrontendComponentType.APP_LAYOUTS_SETTINGS_HUB, key),\n [tComponent],\n );\n\n /** The pushed section's own label — the mobile header's only cue for where you are. */\n const activeSectionLabel = useMemo(() => {\n const section = config.sections.find(candidate => candidate.ref === active);\n return section ? tSettingsHubSection(section.ref, section.label) : undefined;\n }, [config.sections, active, tSettingsHubSection]);\n\n /*\n * Bring the OPEN section into view when it is not — and only then.\n *\n * The rail carries thirty destinations and scrolls, so a cold load or a deep link at a section\n * near the bottom (`/settings/webhooks`) renders a list scrolled to the top with nothing on it\n * marked: the one cue that says where you are is off screen, and the reader has to scroll a list\n * of thirty to find out.\n *\n * `block: 'nearest'` is what makes this safe to run on every section change rather than only on\n * mount: it is defined to move the container by the MINIMUM needed, so an item already fully\n * visible — the ordinary case when somebody clicks the rail — is not scrolled at all. That is the\n * whole reason it is 'nearest' and not 'center', which would yank the list on every click and\n * replace one annoyance with another.\n *\n * It pairs with, and does not substitute for, the key fix in `getContentKey`: this positions the\n * rail, that one stops the rail being rebuilt (and its scroll offset discarded) on every click.\n * Without the key fix this would fire into a freshly mounted `<nav>` each time and merely make the\n * reset land somewhere else.\n */\n const activeRailItemRef = useRef<HTMLAnchorElement | null>(null);\n useEffect(() => {\n if (!active) return;\n activeRailItemRef.current?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [active]);\n\n /*\n * Gate on label readiness so the hub chrome never flashes raw key paths — copy is pipeline-owned\n * with no inline fallback, matching the hosted panels.\n *\n * Through `LoadingGate` rather than `if (!isReady) return null`, which is what this was until\n * 2026-09-17. Returning null is correct about the raw keys and wrong about everything else: the\n * overlay is already open and mounted by the time the hub renders, so a null gave a person an\n * empty dialog with no indication that anything was coming — and the wait got longer as the rail\n * grew. `LoadingGate` keeps the same guarantee (children are not rendered until ready) and lets\n * the ENCLOSING SURFACE POLICY choose the treatment, which for an overlay is to overlay the\n * children rather than to blank them. The hub does not pick a visual here on purpose: that choice\n * belongs to the surface it is hosted in, and hard-coding a skeleton would override a policy the\n * design system already owns.\n */\n return (\n <LoadingGate readiness={[{ id: 'settings-hub-labels', isReady }]}>\n {/*\n `min-w-0` is REQUIRED: this is the grid item of the (fixed-width) dialog surface.\n Without it the item keeps its default `min-width: auto` and cannot shrink below its\n content's min-content width — a wide field row (e.g. a file card with a long\n filename, or a text input) then pushes the whole two-pane body past the dialog edge,\n and the dialog's `overflow-x: hidden` clips the right side of every field. `min-w-0`\n lets the item fit the track so the content pane (and its form) reflow within it.\n */}\n <div className=\"flex h-full min-h-0 flex-col min-w-0\">\n <header className=\"flex h-14 shrink-0 items-center gap-item border-b px-card-lg\">\n {mobileShowsSection && (\n <Button\n variant={ButtonVariants_Variant.GHOST}\n size={ButtonSize.ICON_SM}\n aria-label={t('backToSections')}\n onClick={handleBackToSections}\n >\n {renderIcon(StandardIconReference.BACK, { size: IconSize.SM })}\n </Button>\n )}\n {/* On mobile the header names the SECTION you pushed into — without it the back-stack loses\n the one cue that says where you are, since the rail that said so is off screen. */}\n <h2 className=\"truncate text-base font-semibold tracking-tight\">\n {mobileShowsSection ? activeSectionLabel ?? t('title') : t('title')}\n </h2>\n </header>\n <div className=\"flex min-h-0 flex-1\">\n {/*\n * The rail is NAVIGATION, not a tablist, and until 2026-09-19 it was rendered as one —\n * thirty `<button role=\"tab\">` in a `TabsList`. Three things followed, all measured on the\n * running application:\n *\n * - No destination could be OPENED any other way. `/settings/members` is a real route the\n * hub already writes to the address bar, but with no `href` there was nothing to\n * ⌘-click, middle-click or \"copy link address\" — the one gesture an operator uses to\n * send a colleague to a setting.\n * - The ARIA pattern was wrong for what this is. A tablist switches panels WITHIN a view;\n * a list of destinations that each own a URL is navigation (WAI-ARIA APG). That is not a\n * preference — it decides what an assistive technology announces and how it is reached.\n * - The category headings carried `role=\"presentation\"`, so they were invisible to\n * assistive technology, and a tablist cannot nest labelled groups anyway. That left AT\n * users with a flat list of thirty items containing NINE duplicated names — \"General\",\n * \"Entitlements\", \"API keys\", \"Connected accounts\", \"Single sign-on\", \"User\n * provisioning\", \"Audit streaming\", \"Webhooks\" and \"Audit log\" each appear under two\n * scopes — with nothing to tell the pairs apart.\n *\n * A `<nav>` of grouped links fixes all three at once, and the keyboard concern the previous\n * shape was chosen for DISSOLVES rather than needing to be reimplemented: roving tabindex\n * is a tablist requirement. Navigation uses ordinary Tab order through links, which is what\n * a reader expects and what the browser already does.\n *\n * `replace` is kept from the old `navigateToSection` and for its reason: a settings rail is\n * a switcher, not a trail, so Back means \"leave settings\" rather than walking every section\n * somebody browsed.\n */}\n <nav\n aria-label={t('sectionsNavLabel')}\n className={cn(\n 'overflow-y-auto px-card-sm py-card',\n // Desktop: the fixed rail beside the content. Mobile: the full-width first screen of the\n // back-stack, with no divider because there is nothing beside it.\n isMobile ? 'w-full flex-1' : 'w-60 shrink-0 border-e',\n mobileShowsSection && 'hidden',\n )}\n >\n {categories.map((category, index) => {\n const sections = sectionsForCategory(config, category.ref);\n if (sections.length === 0) return null;\n const categoryLabelId = `settings-hub-category-${category.ref}`;\n return (\n <React.Fragment key={category.ref}>\n {index > 0 && <Separator className=\"my-item\" />}\n {/* Named, not decorative: this heading is the ONLY thing distinguishing the nine\n section labels that appear under two scopes, so it has to reach AT. */}\n <div\n id={categoryLabelId}\n className={cn(\"px-card-sm py-card-sm\", eyebrowRecipe.base)}\n >\n {tSettingsHubCategory(category.ref, category.label)}\n </div>\n <div role=\"group\" aria-labelledby={categoryLabelId}>\n {railBlocks(category, sections).map(block => (\n <React.Fragment key={block.group?.ref ?? '__ungrouped'}>\n {block.group && (\n <div\n id={`${categoryLabelId}-group-${block.group.ref}`}\n className={cn('px-card-sm pt-card-sm pb-item-xs text-muted-foreground', groupHeadingRecipe.base)}\n >\n {tSettingsHubGroup(category.ref, block.group.ref, block.group.label)}\n </div>\n )}\n <div role={block.group ? 'group' : undefined} aria-labelledby={block.group ? `${categoryLabelId}-group-${block.group.ref}` : undefined}>\n {block.sections.map(section => {\n const isActive = section.ref === active;\n return (\n // `data-ref` = i18n-independent automation hook (see sub-tabs above).\n <Link\n key={section.ref}\n // Only the OPEN item is tracked — the effect above needs one element, and a\n // ref on all thirty would be thirty callbacks re-created every render.\n ref={isActive ? activeRailItemRef : undefined}\n to={`${CommonRoutePaths.settings}/${section.ref}`}\n replace\n data-ref={section.ref}\n aria-current={isActive ? 'page' : undefined}\n data-state={isActive ? 'active' : 'inactive'}\n className={cn(\n RAIL_ITEM_CLASSES,\n // Composed part by part, exactly as the tab trigger does — `getRecipe`\n // returns a STRUCTURE (base / states / motion), not a class string, and\n // handing the object to `cn()` silently yields nothing. That is how the\n // first cut of this lost the selected fill while every other class held.\n railItemRecipe.base,\n railItemRecipe.states.focus,\n railItemRecipe.states.selected,\n railItemRecipe.motion.transition,\n )}\n >\n {/* The destination's glyph, sized by the rail item's own `[&_svg]:size-4`. Declared on every\n engine destination (#2378); a section that names none is drawn by its words alone. */}\n {section.icon && renderIcon(section.icon, { size: IconSize.SM })}\n {tSettingsHubSection(section.ref, section.label)}\n </Link>\n );\n })}\n </div>\n </React.Fragment>\n ))}\n </div>\n </React.Fragment>\n );\n })}\n </nav>\n <div\n className={cn(\n 'min-w-0 flex-1 overflow-y-auto p-card-lg',\n isMobile && !mobileShowsSection && 'hidden',\n )}\n >\n {/*\n * ONE section renders — the active one. `TabsContent` unmounts its inactive panels\n * anyway, so this is the same mounting behaviour written directly rather than delegated\n * to a primitive the rail no longer uses.\n */}\n {config.sections.filter(section => section.ref === active).map(section => (\n <React.Fragment key={section.ref}>\n {section.entitlementFeatureId ? (\n // Section SURVIVED because the app OFFERS this feature (`runtimeAvailability`\n // capability = plan-independent `isFeatureOffered`), or because something is still\n // configured here (#3126). Render its body through the entitlement gate: entitled →\n // the config surface; offered-but-not-entitled → the policy-driven upgrade/add-on\n // prompt; configured but sold by no plan → the kept-configuration notice alone.\n // Never a silent disappearance.\n <EntitlementGatedSettingsSection featureId={section.entitlementFeatureId} keptConfigurationNotice={t('entitlementLapsedConfigurationKept')}>\n <SettingsTargetRenderer\n target={section.target}\n resolveSubTabLabel={tSettingsHubSection}\n subTabRef={section.ref === active ? subTabRef : undefined}\n onSubTabChange={handleSubTabChange}\n />\n </EntitlementGatedSettingsSection>\n ) : (\n <SettingsTargetRenderer\n target={section.target}\n resolveSubTabLabel={tSettingsHubSection}\n subTabRef={section.ref === active ? subTabRef : undefined}\n onSubTabChange={handleSubTabChange}\n />\n )}\n </React.Fragment>\n ))}\n </div>\n </div>\n </div>\n </LoadingGate>\n );\n}\n\n/**\n * A settings section whose content the organization must be ENTITLED to (#2367).\n *\n * Not entitled: a notice says what happened to whatever was configured there. The backend keeps that configuration and\n * stops applying it while the entitlement is missing (single sign-on stops being required, a directory may only read\n * and remove access, security events stop being exported, webhooks stop being delivered), and it applies again on its\n * own once the entitlement returns. Without the notice an administrator whose plan lapsed would read the prompt as\n * \"this was never set up\", or as \"it was deleted\". Where a plan sells the feature, the upgrade prompt follows it.\n *\n * Then the section's CONTENT, still (#3162). An action that REMOVES access stays usable under a lapse: revoking a SCIM\n * token, switching security-event export off, removing an SSO connection. Only an action that ADDS or USES the\n * capability is gated, and each such operation already declares the feature it needs (`requiredFeatures`, enforced by\n * the backend), which the action bar renders locked with the upgrade path. The content used to be REPLACED by the\n * prompt, so a live directory token that only revocation can retire could be revoked through the API alone: the one\n * action an administrator most needs after a lapse was the one the screen hid. Fail closed means a credential can\n * always be cut off from the product, never that the product hides it.\n *\n * A feature whose unavailability behaviour is HIDE renders nothing, notice and content included.\n *\n * The rail also keeps such a section when the feature is not offered at all but something is still configured there\n * (#3126: a lapse no plan in the catalogue sells). Then there is no upgrade to offer, so the section shows the notice\n * and its content: an upgrade prompt whose \"View Upgrade Options\" leads to no plan that grants the feature would send\n * the administrator looking for a purchase that does not exist.\n *\n * Keyed on the absence of an upgrade path rather than on the unavailability behaviour, deliberately: the only sections\n * that reach this unentitled with no upgrade path are the engine's configured-survival case, since an offered feature\n * always has one. An application section declaring `entitlementFeatureId` without a runtime gate would also land here\n * and lose a CONTACT_ADMIN or DISABLE prompt; none exists, and such a section should pair the declaration with its\n * runtime gate as `SettingsSection.entitlementFeatureId` asks.\n */\nfunction EntitlementGatedSettingsSection({ featureId, keptConfigurationNotice, children }: {\n featureId: string;\n keptConfigurationNotice: string;\n children: React.ReactNode;\n}): React.JSX.Element {\n const availability = useFeatureAvailability(featureId);\n const showsNotice = !availability.isAvailable && availability.behavior !== FeatureUnavailabilityBehavior.HIDE;\n const hasUpgradePath = (availability.upgradeOptions?.length ?? 0) > 0;\n if (!showsNotice) {\n // Entitled, or a HIDE feature: the gate renders the content, or nothing.\n return <div className=\"space-y-card\"><FeatureGate featureId={featureId}>{children}</FeatureGate></div>;\n }\n return (\n <div className=\"space-y-card\">\n <Alert variant=\"info\">\n <AlertDescription>{keptConfigurationNotice}</AlertDescription>\n </Alert>\n {/* The prompt alone: the gate renders its prompt in place of nothing, since the feature is unavailable here. */}\n {hasUpgradePath && <FeatureGate featureId={featureId}>{null}</FeatureGate>}\n {children}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"SettingsHub.js","sourceRoot":"","sources":["../../../../src/components/settings/SettingsHub.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAC/I,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AACxG,OAAO,E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AAO,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACzD,cAAc,EAAE,kBAAkB,GAClC,CACH,IAvBkB,OAAO,CAAC,GAAG,CAwBf,CAClB,CAAC,GACE,IACF,IACF,GACQ,CACf,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAS,+BAA+B,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAItF;IACC,MAAM,YAAY,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,CAAC,YAAY,CAAC,WAAW,IAAI,YAAY,CAAC,QAAQ,KAAK,6BAA6B,CAAC,IAAI,CAAC;IAC9G,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACtE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,yEAAyE;QACzE,OAAO,cAAK,SAAS,EAAC,cAAc,YAAC,KAAC,WAAW,IAAC,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAe,GAAM,CAAC;IACzG,CAAC;IACD,OAAO,CACL,eAAK,SAAS,EAAC,cAAc,aAC3B,KAAC,KAAK,IAAC,OAAO,EAAC,MAAM,YACnB,KAAC,gBAAgB,cAAE,uBAAuB,GAAoB,GACxD,EAEP,cAAc,IAAI,KAAC,WAAW,IAAC,SAAS,EAAE,SAAS,YAAG,IAAI,GAAe,EACzE,QAAQ,IACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * SettingsHub — the unified settings surface.\n *\n * Renders the declarative `ResolvedSettingsHubConfig` as a vertical NAVIGATION rail beside a\n * content panel. Categories become labelled groups of links, each destination addressed by its own\n * URL. A section's `target` resolves to a framework panel, an auto-rendered resource surface, a\n * custom component, or a set of horizontal sub-tabs.\n *\n * The rail was a `Tabs`/`TabsList` until 2026-09-19, chosen so that section state and keyboard\n * roving came from the primitive rather than being hand-rolled. It became navigation because a\n * tablist switches panels WITHIN a view while these are thirty destinations that each own a URL —\n * and the keyboard argument dissolves rather than transferring: roving tabindex is a tablist\n * requirement, and navigation wants ordinary Tab order through links. See the rail's own comment.\n *\n * The SUB-TABS are still `Tabs`, correctly: Configuration/Connections inside one destination is\n * exactly what a tablist is for.\n *\n * Mounted by `NavigationContentRenderer` for `NavigationContentType.SETTINGS_HUB`\n * (always in the overlay zone). The `sectionRef` prop names the open\n * section: it wins whenever the gated config admits it (see `active` below).\n */\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { Link, useNavigate } from 'react-router';\nimport { ViewportBreakpoint } from '@wildo-ai/zod-decorators';\nimport { CorePresetNames, FrontendComponentType, SelectableVariant, TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '~wildo-frontend-lib/components/sections/tabs';\nimport { Separator } from '~wildo-frontend-lib/components/layout/separator';\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { ButtonSize } from '@wildo-ai/presets-components-models';\nimport { useIconRegistry } from '~wildo-frontend-lib/core/icons/useIconRegistry';\nimport { IconSize, StandardIconReference } from '~wildo-frontend-lib/core/icons/icon-registry.frontend.schemas';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { AppPage_SecuritySettings } from '~wildo-frontend-lib/components/auth/admin-config/AppPage_SecuritySettings';\nimport { AppPage_AppearanceSettings } from './AppPage_AppearanceSettings';\nimport { AppPage_InvitationsSettings } from './AppPage_InvitationsSettings';\nimport { AppPage_BillingSettings } from './AppPage_BillingSettings';\nimport { ExternalProvider_Connection_OwnerScope } from '@wildo-ai/external-connectors-models';\nimport { AppPage_ConnectedAccountsSettings } from './AppPage_ConnectedAccountsSettings';\nimport { AppPage_AgentWorkOverrideRateSettings } from './AppPage_AgentWorkOverrideRateSettings';\nimport { AppPage_AutonomousAgentsSettings } from './AppPage_AutonomousAgentsSettings';\nimport { AgentActivityScope, AppPage_AgentActivitySettings } from './AppPage_AgentActivitySettings';\nimport { AppPage_ModelCostBreakdownSettings, ModelCostBreakdownScope } from './AppPage_ModelCostBreakdownSettings';\nimport { AppPage_RepresentativeActivitySettings } from './AppPage_RepresentativeActivitySettings';\nimport { AppPage_AgentWorkEvaluationExportSettings } from './AppPage_AgentWorkEvaluationExportSettings';\nimport { ComponentRegistryService } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.service';\nimport { ComponentNotInjected } from '~wildo-frontend-lib/core/components-registry/ComponentNotInjected';\nimport { SettingsPanelRef, SettingsSectionTargetKind } from '~wildo-frontend-lib/core/config/settings-hub.frontend.schemas';\nimport type {\n ResolvedSettingsHubConfig,\n SettingsCategory,\n SettingsCategoryGroup,\n SettingsSection,\n SettingsSectionTarget,\n SettingsSubTabsTarget,\n} from '~wildo-frontend-lib/core/config/settings-hub.frontend.schemas';\nimport { CommonRoutePaths } from '~wildo-frontend-lib/core/runtime/routes.frontend.definitions';\nimport { useVisibleSettingsHubConfig } from '~wildo-frontend-lib/core/config/useVisibleSettingsHubConfig';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { FeatureGate } from '~wildo-frontend-lib/core/features/FeatureGate';\nimport { useFeatureAvailability } from '~wildo-frontend-lib/core/features/useFeatureAvailability';\nimport { Alert, AlertDescription } from '~wildo-frontend-lib/components/overlays/containers/alert';\nimport { FeatureUnavailabilityBehavior } from '@wildo-ai/saas-models';\nimport { LoadingGate } from '~wildo-frontend-lib/core/loading/LoadingGate';\nimport { SettingsResourceOperationPanel } from './SettingsResourceOperationPanel';\n\n// ──────────────────────────────────────────────────────────────\n// Config helpers\n// ──────────────────────────────────────────────────────────────\n\nfunction orderedCategories(config: ResolvedSettingsHubConfig): SettingsCategory[] {\n return [...config.categories].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n}\n\nfunction sectionsForCategory(config: ResolvedSettingsHubConfig, categoryRef: string): SettingsSection[] {\n return config.sections\n .filter(section => section.categoryRef === categoryRef)\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n}\n\n/**\n * A category's rail in sub-category blocks (#2329): its ungrouped sections first, with no heading, then each declared\n * group in order with its sections. A group no placed section names draws nothing, and a section naming an undeclared\n * group (refused by the DEV verifier) is drawn with the ungrouped ones rather than lost.\n */\nfunction railBlocks(category: SettingsCategory, sections: SettingsSection[]): Array<{ group?: SettingsCategoryGroup; sections: SettingsSection[] }> {\n const groups = [...(category.groups ?? [])].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n const declared = new Set(groups.map(group => group.ref));\n const ungrouped = sections.filter(section => section.groupRef === undefined || !declared.has(section.groupRef));\n return [\n ...(ungrouped.length > 0 ? [{ sections: ungrouped }] : []),\n ...groups\n .map(group => ({ group, sections: sections.filter(section => section.groupRef === group.ref) }))\n .filter(block => block.sections.length > 0),\n ];\n}\n\n/** Resolve the section to open: requested → config default → first section. */\nfunction resolveActiveSection(config: ResolvedSettingsHubConfig, sectionRef?: string): string | undefined {\n if (sectionRef && config.sections.some(section => section.ref === sectionRef)) return sectionRef;\n if (config.defaultSectionRef && config.sections.some(section => section.ref === config.defaultSectionRef)) {\n return config.defaultSectionRef;\n }\n return config.sections[0]?.ref;\n}\n\n// ──────────────────────────────────────────────────────────────\n// Target rendering (function declarations → hoisted for mutual recursion\n// between a SUB_TABS target and its leaf targets)\n// ──────────────────────────────────────────────────────────────\n\nfunction SettingsEnginePanel({ panelRef }: { panelRef: SettingsPanelRef }): React.JSX.Element {\n switch (panelRef) {\n case SettingsPanelRef.SECURITY:\n return <AppPage_SecuritySettings />;\n case SettingsPanelRef.APPEARANCE:\n return <AppPage_AppearanceSettings />;\n case SettingsPanelRef.INVITATIONS:\n return <AppPage_InvitationsSettings />;\n case SettingsPanelRef.BILLING:\n return <AppPage_BillingSettings />;\n case SettingsPanelRef.CONNECTED_ACCOUNTS:\n return <AppPage_ConnectedAccountsSettings ownerScope={ExternalProvider_Connection_OwnerScope.USER} />;\n case SettingsPanelRef.ORGANIZATION_CONNECTED_ACCOUNTS:\n // The scope is passed EXPLICITLY at both sites rather than left to the component's default.\n // A default is invisible at the call site, and the one thing a reader must be able to see here\n // is whose account each panel connects.\n return <AppPage_ConnectedAccountsSettings ownerScope={ExternalProvider_Connection_OwnerScope.ORGANIZATION} />;\n case SettingsPanelRef.APPLICATION_CONNECTED_ACCOUNTS:\n // The application's own account (#3579): the third owner, passed explicitly for the same reason.\n return <AppPage_ConnectedAccountsSettings ownerScope={ExternalProvider_Connection_OwnerScope.APPLICATION} />;\n case SettingsPanelRef.AGENT_WORK_OVERRIDE_RATE:\n return <AppPage_AgentWorkOverrideRateSettings />;\n case SettingsPanelRef.AUTONOMOUS_AGENTS:\n return <AppPage_AutonomousAgentsSettings />;\n case SettingsPanelRef.AGENT_ACTIVITY:\n // Whose runs are passed EXPLICITLY at both sites, as for connected accounts above (#3990).\n return <AppPage_AgentActivitySettings scope={AgentActivityScope.ORGANIZATION} />;\n case SettingsPanelRef.APPLICATION_AGENT_ACTIVITY:\n return <AppPage_AgentActivitySettings scope={AgentActivityScope.APPLICATION} />;\n case SettingsPanelRef.MODEL_COST_BREAKDOWN:\n // Whose cost is passed EXPLICITLY at both sites, as for connected accounts above.\n return <AppPage_ModelCostBreakdownSettings scope={ModelCostBreakdownScope.APPLICATION} />;\n case SettingsPanelRef.REPRESENTING_ORGANIZATION_MODEL_COST_BREAKDOWN:\n return <AppPage_ModelCostBreakdownSettings scope={ModelCostBreakdownScope.REPRESENTING_ORGANIZATION} />;\n case SettingsPanelRef.REPRESENTATIVE_ACTIVITY:\n return <AppPage_RepresentativeActivitySettings />;\n case SettingsPanelRef.AGENT_WORK_EVALUATION_EXPORT:\n return <AppPage_AgentWorkEvaluationExportSettings />;\n }\n}\n\n/** Resolves a display label for a section/sub-tab ref, falling back to the authored label. */\ntype SettingsLabelResolver = (ref: string, fallbackLabel: string) => string;\n\nfunction SettingsTargetRenderer({\n target,\n resolveSubTabLabel,\n subTabRef,\n onSubTabChange,\n}: {\n target: SettingsSectionTarget;\n resolveSubTabLabel: SettingsLabelResolver;\n subTabRef?: string;\n onSubTabChange?: (subTabRef: string) => void;\n}): React.JSX.Element {\n switch (target.kind) {\n case SettingsSectionTargetKind.ENGINE_PANEL:\n return <SettingsEnginePanel panelRef={target.panelRef} />;\n case SettingsSectionTargetKind.CUSTOM_COMPONENT: {\n const CustomComponent = ComponentRegistryService.resolve(\n target.componentRef,\n CorePresetNames.DEFAULT,\n );\n if (!CustomComponent) {\n return <ComponentNotInjected componentType={target.componentRef} componentName={target.componentRef} />;\n }\n return (\n <React.Suspense fallback={<div className=\"h-8 animate-pulse motion-reduce:animate-none bg-muted rounded\" aria-hidden=\"true\" />}>\n <CustomComponent />\n </React.Suspense>\n );\n }\n case SettingsSectionTargetKind.RESOURCE_OPERATION:\n return (\n <SettingsResourceOperationPanel\n resourceType={target.resourceType}\n operation={target.operation}\n operationVariant={target.operationVariant}\n />\n );\n case SettingsSectionTargetKind.SUB_TABS:\n return (\n <SettingsSubTabs\n target={target}\n resolveSubTabLabel={resolveSubTabLabel}\n subTabRef={subTabRef}\n onSubTabChange={onSubTabChange}\n />\n );\n }\n}\n\n/**\n * The sub-tab strip inside one section.\n *\n * The active tab is URL-DRIVEN since 2026-09-17. It used to be `useState(target.subTabs[0]?.ref)` —\n * local state that read nothing from the URL — so all twenty-one sub-tab panels in the shipped\n * catalogue were unaddressable: every link to a sub-tabbed section opened its FIRST tab, and\n * \"Single sign-on → Connections\" could not be sent to anybody. That contradicted the hub's own\n * contract, which is that the URL is its single source of truth, and it made the outcome banner a\n * connect-callback renders depend on tab ORDER rather than on the URL it returns to.\n *\n * A `subTabRef` the section does not declare is IGNORED rather than refused: the tab falls back to\n * the first entry, so a stale bookmark or a hand-typed segment still opens the section instead of an\n * error. `onSubTabChange` writes the selection back, which is what makes the strip a navigation\n * control rather than a widget with a URL beside it.\n */\nfunction SettingsSubTabs({\n target,\n resolveSubTabLabel,\n subTabRef,\n onSubTabChange,\n}: {\n target: SettingsSubTabsTarget;\n resolveSubTabLabel: SettingsLabelResolver;\n subTabRef?: string;\n onSubTabChange?: (subTabRef: string) => void;\n}): React.JSX.Element | null {\n const active = target.subTabs.some(subTab => subTab.ref === subTabRef)\n ? subTabRef\n : target.subTabs[0]?.ref;\n if (target.subTabs.length === 0) return null;\n return (\n <Tabs value={active} onValueChange={next => onSubTabChange?.(next)}>\n <TabsList>\n {target.subTabs.map(subTab => (\n // `data-ref` is the i18n-independent automation hook (labels are\n // runtime-translated; e2e drives must never key off them).\n <TabsTrigger key={subTab.ref} value={subTab.ref} data-ref={subTab.ref}>\n {resolveSubTabLabel(subTab.ref, subTab.label)}\n </TabsTrigger>\n ))}\n </TabsList>\n {target.subTabs.map(subTab => (\n <TabsContent key={subTab.ref} value={subTab.ref}>\n {/* Leaf targets only (schema forbids nested sub-tabs); the resolver is\n still threaded to satisfy the shared renderer signature. */}\n <SettingsTargetRenderer target={subTab.target} resolveSubTabLabel={resolveSubTabLabel} />\n </TabsContent>\n ))}\n </Tabs>\n );\n}\n\n/**\n * A rail item's layout classes — full-width, left-aligned, icon-tolerant.\n *\n * Carried here rather than reused from the tab trigger because the rail is no longer a tab: this is\n * a navigation item and owns its own shape. Only the SELECTED treatment is shared, and that comes\n * from the theme recipe rather than from a copied class string, so a theme change still reaches\n * both.\n */\nconst RAIL_ITEM_CLASSES =\n \"inline-flex w-full cursor-pointer items-center justify-start gap-1.5 whitespace-nowrap rounded-md px-card-sm py-item text-sm font-medium no-underline [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\";\n\n// ──────────────────────────────────────────────────────────────\n// Hub\n// ──────────────────────────────────────────────────────────────\n\nexport interface SettingsHubProps {\n /** The section the URL names. It is open whenever the gated config admits it; until then, the config default. */\n sectionRef?: string;\n /** Sub-tab of `sectionRef` to pre-open; ignored when the section declares no such tab. */\n subTabRef?: string;\n}\n\nexport function SettingsHub({ sectionRef, subTabRef }: SettingsHubProps): React.JSX.Element {\n const config = useVisibleSettingsHubConfig();\n const categories = useMemo(() => orderedCategories(config), [config]);\n /*\n * The open section is DERIVED from the URL and the gated config, on every render. It is not\n * state, and it was until 2026-10-02 (#2190), when it held a fallback that outlived its reason.\n *\n * The gated config arrives in stages: on a cold load the first answer is built before the\n * organization's features resolve, so a feature-gated destination (`sso`, `scim`) is absent from\n * it. The old state machine resolved `/settings/sso` against that first config, fell back to the\n * first section (Profile), then kept Profile when `sso` joined the config, because Profile was\n * still selectable. Its URL effect did not help, since `sectionRef` never changed. A deep link or\n * a reload of a gated destination therefore opened the wrong pane for good, while a rail click\n * opened the right one.\n *\n * Deriving it removes the \"current choice\" that a fallback could become. The URL can stand for\n * the person's choice because the rail's links write it (`to` + `replace`) and nothing else\n * selects a section, so `sectionRef` is always the section the person last asked for. Whenever it\n * is selectable it is the open section, whatever order the gating signals land in. When it is not\n * (yet) selectable, the default stands in, and the requested section takes over the moment the\n * config admits it. The earlier concern that kept `config` out of the sync effect, config\n * identity churning and resetting a rail click, has no purchase here: a click changes\n * `sectionRef` itself, so a re-derivation can only re-confirm it.\n */\n const active = useMemo(() => resolveActiveSection(config, sectionRef), [config, sectionRef]);\n const routerNavigate = useNavigate();\n\n /*\n * In-hub navigation WRITES the URL. Until 2026-09-17 it did not, at either level: the rail set\n * local state and the sub-tab strip held its own, so the address bar kept whatever section the\n * hub was opened at. Deep-linking IN worked and linking OUT never did — you could be looking at\n * Administration → Single sign-on → Connections with `/settings/profile` in the address bar, and\n * no sequence of clicks produced a URL for where you were.\n *\n * REPLACE rather than push, deliberately. A settings rail is a switcher, not a trail: pushing\n * would make Back walk every section a person browsed before leaving the hub, which is the\n * behaviour the overlay's own dismiss already owns. Replace keeps the address bar truthful and\n * leaves Back meaning \"leave settings\".\n *\n * The overlay reconciler converges on the new URL — it keys on section AND sub-tab, so a tab\n * switch inside one section is seen as a change rather than as already-correct. There is no loop:\n * only a user gesture calls these, and the reconciler emits no navigation of its own.\n */\n // The SECTION half of this used to be `navigateToSection`, which the rail's triggers called. The\n // rail's links now carry `to` + `replace` themselves, and `active` is derived from the URL\n // (see its declaration above) — so the helper had no caller left. The SUB-TAB half stays: those really are tabs.\n\n const handleSubTabChange = useCallback((nextSubTabRef: string) => {\n if (!active) return;\n routerNavigate(`${CommonRoutePaths.settings}/${active}/${nextSubTabRef}`, { replace: true });\n }, [active, routerNavigate]);\n\n /*\n * On a small screen the hub is a BACK-STACK rather than two panes.\n *\n * It had no responsive treatment at all before 2026-09-17 — a fixed `w-60 shrink-0` rail at every\n * width, which is 240px of a ~375px viewport, and the rail is now thirty entries rather than\n * sixteen. The back-stack is chosen over a drawer or a collapsed select because the panel BELOW\n * already works this way: `SettingsSectionNavigationHost` keeps a section's own drill-ins\n * (view → edit → back) inside the panel, so mobile becomes the same mechanism one level up\n * instead of a second navigation concept.\n *\n * WHICH screen shows is the URL's business, not local state: `/settings` is the list and\n * `/settings/:sectionRef` is a section. That falls out of the hub's own contract — the URL is its\n * single source of truth — and it means Back, a deep link and a shared link all agree without any\n * of them being special-cased.\n *\n * Both panes stay MOUNTED and only their classes change. `field-chrome-and-sections.md` Gotcha 1b\n * records what the alternative costs: a chrome that swapped element structure across a breakpoint\n * remounted its control and dropped a pending edit on resize. Hiding is a class here for exactly\n * that reason.\n */\n const { UIConfig, getRecipe } = useUI();\n /*\n * The rail item's SELECTED styling comes from the theme's SELECTABLE/FILLED recipe — the same one\n * the vertical tab trigger used, so the rail looks exactly as it did and still follows whatever a\n * theme dresses it in. The recipe keys on `data-state`, which each link sets from `active`.\n */\n const railItemRecipe = getRecipe(UIBehavior.SELECTABLE, SelectableVariant.FILLED);\n const eyebrowRecipe = getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.EYEBROW);\n // A sub-category heading (#2329) sits one step below its category's eyebrow.\n const groupHeadingRecipe = getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.LABEL);\n const { renderIcon } = useIconRegistry();\n const isMobile = UIConfig?.currentBreakpoint === ViewportBreakpoint.MOBILE;\n const mobileShowsSection = isMobile && Boolean(sectionRef);\n\n const handleBackToSections = useCallback(() => {\n routerNavigate(CommonRoutePaths.settings, { replace: true });\n }, [routerNavigate]);\n\n\n const { tComponent, tSettingsHubCategory, tSettingsHubGroup, tSettingsHubSection, isReady } = useI18n({\n component: FrontendComponentType.APP_LAYOUTS_SETTINGS_HUB,\n });\n // Hub chrome labels (title, rail aria-label) read from the scoped component\n // namespace. Copy is owned by the labelling pipeline (declared in the sibling\n // `.labels.ts`), so there are deliberately no inline fallback strings — the\n // hub gates on `isReady` below, the same convention as the panels it hosts\n // (`AppPage_SecuritySettings` / `AppPage_AppearanceSettings`). The dynamic\n // category/section labels keep their config-authored `fallbackLabel` (the\n // required contract of `tSettingsHubCategory` / `tSettingsHubSection`).\n const t = useCallback(\n (key: string) => tComponent(FrontendComponentType.APP_LAYOUTS_SETTINGS_HUB, key),\n [tComponent],\n );\n\n /** The pushed section's own label — the mobile header's only cue for where you are. */\n const activeSectionLabel = useMemo(() => {\n const section = config.sections.find(candidate => candidate.ref === active);\n return section ? tSettingsHubSection(section.ref, section.label) : undefined;\n }, [config.sections, active, tSettingsHubSection]);\n\n /*\n * Bring the OPEN section into view when it is not — and only then.\n *\n * The rail carries thirty destinations and scrolls, so a cold load or a deep link at a section\n * near the bottom (`/settings/webhooks`) renders a list scrolled to the top with nothing on it\n * marked: the one cue that says where you are is off screen, and the reader has to scroll a list\n * of thirty to find out.\n *\n * `block: 'nearest'` is what makes this safe to run on every section change rather than only on\n * mount: it is defined to move the container by the MINIMUM needed, so an item already fully\n * visible — the ordinary case when somebody clicks the rail — is not scrolled at all. That is the\n * whole reason it is 'nearest' and not 'center', which would yank the list on every click and\n * replace one annoyance with another.\n *\n * It pairs with, and does not substitute for, the key fix in `getContentKey`: this positions the\n * rail, that one stops the rail being rebuilt (and its scroll offset discarded) on every click.\n * Without the key fix this would fire into a freshly mounted `<nav>` each time and merely make the\n * reset land somewhere else.\n */\n const activeRailItemRef = useRef<HTMLAnchorElement | null>(null);\n useEffect(() => {\n if (!active) return;\n activeRailItemRef.current?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [active]);\n\n /*\n * Gate on label readiness so the hub chrome never flashes raw key paths — copy is pipeline-owned\n * with no inline fallback, matching the hosted panels.\n *\n * Through `LoadingGate` rather than `if (!isReady) return null`, which is what this was until\n * 2026-09-17. Returning null is correct about the raw keys and wrong about everything else: the\n * overlay is already open and mounted by the time the hub renders, so a null gave a person an\n * empty dialog with no indication that anything was coming — and the wait got longer as the rail\n * grew. `LoadingGate` keeps the same guarantee (children are not rendered until ready) and lets\n * the ENCLOSING SURFACE POLICY choose the treatment, which for an overlay is to overlay the\n * children rather than to blank them. The hub does not pick a visual here on purpose: that choice\n * belongs to the surface it is hosted in, and hard-coding a skeleton would override a policy the\n * design system already owns.\n */\n return (\n <LoadingGate readiness={[{ id: 'settings-hub-labels', isReady }]}>\n {/*\n `min-w-0` is REQUIRED: this is the grid item of the (fixed-width) dialog surface.\n Without it the item keeps its default `min-width: auto` and cannot shrink below its\n content's min-content width — a wide field row (e.g. a file card with a long\n filename, or a text input) then pushes the whole two-pane body past the dialog edge,\n and the dialog's `overflow-x: hidden` clips the right side of every field. `min-w-0`\n lets the item fit the track so the content pane (and its form) reflow within it.\n */}\n <div className=\"flex h-full min-h-0 flex-col min-w-0\">\n <header className=\"flex h-14 shrink-0 items-center gap-item border-b px-card-lg\">\n {mobileShowsSection && (\n <Button\n variant={ButtonVariants_Variant.GHOST}\n size={ButtonSize.ICON_SM}\n aria-label={t('backToSections')}\n onClick={handleBackToSections}\n >\n {renderIcon(StandardIconReference.BACK, { size: IconSize.SM })}\n </Button>\n )}\n {/* On mobile the header names the SECTION you pushed into — without it the back-stack loses\n the one cue that says where you are, since the rail that said so is off screen. */}\n <h2 className=\"truncate text-base font-semibold tracking-tight\">\n {mobileShowsSection ? activeSectionLabel ?? t('title') : t('title')}\n </h2>\n </header>\n <div className=\"flex min-h-0 flex-1\">\n {/*\n * The rail is NAVIGATION, not a tablist, and until 2026-09-19 it was rendered as one —\n * thirty `<button role=\"tab\">` in a `TabsList`. Three things followed, all measured on the\n * running application:\n *\n * - No destination could be OPENED any other way. `/settings/members` is a real route the\n * hub already writes to the address bar, but with no `href` there was nothing to\n * ⌘-click, middle-click or \"copy link address\" — the one gesture an operator uses to\n * send a colleague to a setting.\n * - The ARIA pattern was wrong for what this is. A tablist switches panels WITHIN a view;\n * a list of destinations that each own a URL is navigation (WAI-ARIA APG). That is not a\n * preference — it decides what an assistive technology announces and how it is reached.\n * - The category headings carried `role=\"presentation\"`, so they were invisible to\n * assistive technology, and a tablist cannot nest labelled groups anyway. That left AT\n * users with a flat list of thirty items containing NINE duplicated names — \"General\",\n * \"Entitlements\", \"API keys\", \"Connected accounts\", \"Single sign-on\", \"User\n * provisioning\", \"Audit streaming\", \"Webhooks\" and \"Audit log\" each appear under two\n * scopes — with nothing to tell the pairs apart.\n *\n * A `<nav>` of grouped links fixes all three at once, and the keyboard concern the previous\n * shape was chosen for DISSOLVES rather than needing to be reimplemented: roving tabindex\n * is a tablist requirement. Navigation uses ordinary Tab order through links, which is what\n * a reader expects and what the browser already does.\n *\n * `replace` is kept from the old `navigateToSection` and for its reason: a settings rail is\n * a switcher, not a trail, so Back means \"leave settings\" rather than walking every section\n * somebody browsed.\n */}\n <nav\n aria-label={t('sectionsNavLabel')}\n className={cn(\n 'overflow-y-auto px-card-sm py-card',\n // Desktop: the fixed rail beside the content. Mobile: the full-width first screen of the\n // back-stack, with no divider because there is nothing beside it.\n isMobile ? 'w-full flex-1' : 'w-60 shrink-0 border-e',\n mobileShowsSection && 'hidden',\n )}\n >\n {categories.map((category, index) => {\n const sections = sectionsForCategory(config, category.ref);\n if (sections.length === 0) return null;\n const categoryLabelId = `settings-hub-category-${category.ref}`;\n return (\n <React.Fragment key={category.ref}>\n {index > 0 && <Separator className=\"my-item\" />}\n {/* Named, not decorative: this heading is the ONLY thing distinguishing the nine\n section labels that appear under two scopes, so it has to reach AT. */}\n <div\n id={categoryLabelId}\n className={cn(\"px-card-sm py-card-sm\", eyebrowRecipe.base)}\n >\n {tSettingsHubCategory(category.ref, category.label)}\n </div>\n <div role=\"group\" aria-labelledby={categoryLabelId}>\n {railBlocks(category, sections).map(block => (\n <React.Fragment key={block.group?.ref ?? '__ungrouped'}>\n {block.group && (\n <div\n id={`${categoryLabelId}-group-${block.group.ref}`}\n className={cn('px-card-sm pt-card-sm pb-item-xs text-muted-foreground', groupHeadingRecipe.base)}\n >\n {tSettingsHubGroup(category.ref, block.group.ref, block.group.label)}\n </div>\n )}\n <div role={block.group ? 'group' : undefined} aria-labelledby={block.group ? `${categoryLabelId}-group-${block.group.ref}` : undefined}>\n {block.sections.map(section => {\n const isActive = section.ref === active;\n return (\n // `data-ref` = i18n-independent automation hook (see sub-tabs above).\n <Link\n key={section.ref}\n // Only the OPEN item is tracked — the effect above needs one element, and a\n // ref on all thirty would be thirty callbacks re-created every render.\n ref={isActive ? activeRailItemRef : undefined}\n to={`${CommonRoutePaths.settings}/${section.ref}`}\n replace\n data-ref={section.ref}\n aria-current={isActive ? 'page' : undefined}\n data-state={isActive ? 'active' : 'inactive'}\n className={cn(\n RAIL_ITEM_CLASSES,\n // Composed part by part, exactly as the tab trigger does — `getRecipe`\n // returns a STRUCTURE (base / states / motion), not a class string, and\n // handing the object to `cn()` silently yields nothing. That is how the\n // first cut of this lost the selected fill while every other class held.\n railItemRecipe.base,\n railItemRecipe.states.focus,\n railItemRecipe.states.selected,\n railItemRecipe.motion.transition,\n )}\n >\n {/* The destination's glyph, sized by the rail item's own `[&_svg]:size-4`. Declared on every\n engine destination (#2378); a section that names none is drawn by its words alone. */}\n {section.icon && renderIcon(section.icon, { size: IconSize.SM })}\n {tSettingsHubSection(section.ref, section.label)}\n </Link>\n );\n })}\n </div>\n </React.Fragment>\n ))}\n </div>\n </React.Fragment>\n );\n })}\n </nav>\n <div\n className={cn(\n 'min-w-0 flex-1 overflow-y-auto p-card-lg',\n isMobile && !mobileShowsSection && 'hidden',\n )}\n >\n {/*\n * ONE section renders — the active one. `TabsContent` unmounts its inactive panels\n * anyway, so this is the same mounting behaviour written directly rather than delegated\n * to a primitive the rail no longer uses.\n */}\n {config.sections.filter(section => section.ref === active).map(section => (\n <React.Fragment key={section.ref}>\n {section.entitlementFeatureId ? (\n // Section SURVIVED because the app OFFERS this feature (`runtimeAvailability`\n // capability = plan-independent `isFeatureOffered`), or because something is still\n // configured here (#3126). Render its body through the entitlement gate: entitled →\n // the config surface; offered-but-not-entitled → the policy-driven upgrade/add-on\n // prompt; configured but sold by no plan → the kept-configuration notice alone.\n // Never a silent disappearance.\n <EntitlementGatedSettingsSection featureId={section.entitlementFeatureId} keptConfigurationNotice={t('entitlementLapsedConfigurationKept')}>\n <SettingsTargetRenderer\n target={section.target}\n resolveSubTabLabel={tSettingsHubSection}\n subTabRef={section.ref === active ? subTabRef : undefined}\n onSubTabChange={handleSubTabChange}\n />\n </EntitlementGatedSettingsSection>\n ) : (\n <SettingsTargetRenderer\n target={section.target}\n resolveSubTabLabel={tSettingsHubSection}\n subTabRef={section.ref === active ? subTabRef : undefined}\n onSubTabChange={handleSubTabChange}\n />\n )}\n </React.Fragment>\n ))}\n </div>\n </div>\n </div>\n </LoadingGate>\n );\n}\n\n/**\n * A settings section whose content the organization must be ENTITLED to (#2367).\n *\n * Not entitled: a notice says what happened to whatever was configured there. The backend keeps that configuration and\n * stops applying it while the entitlement is missing (single sign-on stops being required, a directory may only read\n * and remove access, security events stop being exported, webhooks stop being delivered), and it applies again on its\n * own once the entitlement returns. Without the notice an administrator whose plan lapsed would read the prompt as\n * \"this was never set up\", or as \"it was deleted\". Where a plan sells the feature, the upgrade prompt follows it.\n *\n * Then the section's CONTENT, still (#3162). An action that REMOVES access stays usable under a lapse: revoking a SCIM\n * token, switching security-event export off, removing an SSO connection. Only an action that ADDS or USES the\n * capability is gated, and each such operation already declares the feature it needs (`requiredFeatures`, enforced by\n * the backend), which the action bar renders locked with the upgrade path. The content used to be REPLACED by the\n * prompt, so a live directory token that only revocation can retire could be revoked through the API alone: the one\n * action an administrator most needs after a lapse was the one the screen hid. Fail closed means a credential can\n * always be cut off from the product, never that the product hides it.\n *\n * A feature whose unavailability behaviour is HIDE renders nothing, notice and content included.\n *\n * The rail also keeps such a section when the feature is not offered at all but something is still configured there\n * (#3126: a lapse no plan in the catalogue sells). Then there is no upgrade to offer, so the section shows the notice\n * and its content: an upgrade prompt whose \"View Upgrade Options\" leads to no plan that grants the feature would send\n * the administrator looking for a purchase that does not exist.\n *\n * Keyed on the absence of an upgrade path rather than on the unavailability behaviour, deliberately: the only sections\n * that reach this unentitled with no upgrade path are the engine's configured-survival case, since an offered feature\n * always has one. An application section declaring `entitlementFeatureId` without a runtime gate would also land here\n * and lose a CONTACT_ADMIN or DISABLE prompt; none exists, and such a section should pair the declaration with its\n * runtime gate as `SettingsSection.entitlementFeatureId` asks.\n */\nfunction EntitlementGatedSettingsSection({ featureId, keptConfigurationNotice, children }: {\n featureId: string;\n keptConfigurationNotice: string;\n children: React.ReactNode;\n}): React.JSX.Element {\n const availability = useFeatureAvailability(featureId);\n const showsNotice = !availability.isAvailable && availability.behavior !== FeatureUnavailabilityBehavior.HIDE;\n const hasUpgradePath = (availability.upgradeOptions?.length ?? 0) > 0;\n if (!showsNotice) {\n // Entitled, or a HIDE feature: the gate renders the content, or nothing.\n return <div className=\"space-y-card\"><FeatureGate featureId={featureId}>{children}</FeatureGate></div>;\n }\n return (\n <div className=\"space-y-card\">\n <Alert variant=\"info\">\n <AlertDescription>{keptConfigurationNotice}</AlertDescription>\n </Alert>\n {/* The prompt alone: the gate renders its prompt in place of nothing, since the feature is unavailable here. */}\n {hasUpgradePath && <FeatureGate featureId={featureId}>{null}</FeatureGate>}\n {children}\n </div>\n );\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type CompositeViewDefinition } from '../../../core/config/composite-view.schemas';
3
3
  import { NavigationZone, type NavigationInitiatorContext } from '../../../core/navigation/navigation.schemas';
4
+ import { type LinkedConversationRequest } from '../../../components/views/flows-actors-view/linked-conversation.context';
4
5
  export interface CompositeViewProps {
5
6
  /** View reference — resolved from UIContext internally. Mutually exclusive with `document`. */
6
7
  viewRef?: string;
@@ -14,6 +15,11 @@ export interface CompositeViewProps {
14
15
  navigationZone?: NavigationZone;
15
16
  /** Framework-owned transient navigation initiator. */
16
17
  navigationInitiator?: NavigationInitiatorContext;
18
+ /**
19
+ * A conversation a link asked this view to open (#4043): handed to the conversation the view declares it hosts
20
+ * (`conversationSystemRef`). A view that declares none settles it at once, so its address does not keep it.
21
+ */
22
+ linkedConversation?: LinkedConversationRequest;
17
23
  }
18
24
  /**
19
25
  * CompositeView - top-level host for authored composite surfaces.
@@ -1 +1 @@
1
- {"version":3,"file":"CompositeView.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/composite-view/CompositeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EAAE,cAAc,EAAE,KAAK,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AAazH,MAAM,WAAW,kBAAkB;IACjC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,0BAA0B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,8CAA8C;IAC9C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;CAClD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6KtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CompositeView.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/composite-view/CompositeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EAAE,cAAc,EAAE,KAAK,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AAYzH,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,oFAAoF,CAAC;AAE5F,MAAM,WAAW,kBAAkB;IACjC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,0BAA0B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,8CAA8C;IAC9C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IACjD;;;OAGG;IACH,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;CAChD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8LtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -12,10 +12,11 @@ import { FrontendResourceUtils } from '../../../core/resources/frontend-resource
12
12
  import { ScopeUtilsService } from '../../../core/scope/scope.utils.frontend.service.js';
13
13
  import { useAppScopeSafe } from '../../../core/scope/useAppScope.js';
14
14
  import { CompositeViewProvider, useOptionalCompositeViewContext } from './CompositeViewContext.js';
15
+ import { HostedLinkedConversationContext, } from '../../../components/views/flows-actors-view/linked-conversation.context.js';
15
16
  /**
16
17
  * CompositeView - top-level host for authored composite surfaces.
17
18
  */
18
- export const CompositeView = ({ viewRef, document: documentProp, hostResourceType, contextResourceIdentifiers, navigationZone, navigationInitiator, }) => {
19
+ export const CompositeView = ({ viewRef, document: documentProp, hostResourceType, contextResourceIdentifiers, navigationZone, navigationInitiator, linkedConversation, }) => {
19
20
  const parentCompositeContext = useOptionalCompositeViewContext();
20
21
  const { registry } = useResourceRegistry();
21
22
  const appScope = useAppScopeSafe();
@@ -129,11 +130,20 @@ export const CompositeView = ({ viewRef, document: documentProp, hostResourceTyp
129
130
  ?? parentCompositeContext?.navigationZone
130
131
  ?? NavigationZone.PRIMARY;
131
132
  const resolvedNavigationInitiator = navigationInitiator ?? parentCompositeContext?.navigationInitiator;
133
+ // The linked conversation, for the conversation this view hosts on its record (#4043).
134
+ const outerHostedLinkedConversation = React.useContext(HostedLinkedConversationContext);
135
+ const hostedSystemRef = document?.conversationSystemRef;
136
+ const hostedLinkedConversation = useMemo(() => (linkedConversation && hostedSystemRef ? { ...linkedConversation, systemRef: hostedSystemRef } : null), [linkedConversation, hostedSystemRef]);
137
+ // A link nothing here can take is settled at once: the address does not keep a conversation no view will open.
138
+ const unhostedLink = linkedConversation && document && !hostedSystemRef ? linkedConversation : undefined;
139
+ useEffect(() => {
140
+ unhostedLink?.onSettled();
141
+ }, [unhostedLink]);
132
142
  if (!document) {
133
143
  return _jsx(ViewNotFound, { viewKind: "composite", viewRef: viewRef });
134
144
  }
135
145
  const CompositeComponent = document.viewComponent;
136
- return (_jsx(CompositeViewProvider, { viewDefinition: document, breakpoint: currentBreakpoint, navigationZone: resolvedNavigationZone, navigationInitiator: resolvedNavigationInitiator, hostResourceType: resolvedHostResourceType, contextResourceIdentifiers: mergedContextResourceIdentifiers, children: _jsx(CompositeComponent, { viewRef: document.ref, viewDefinition: document }) }));
146
+ return (_jsx(CompositeViewProvider, { viewDefinition: document, breakpoint: currentBreakpoint, navigationZone: resolvedNavigationZone, navigationInitiator: resolvedNavigationInitiator, hostResourceType: resolvedHostResourceType, contextResourceIdentifiers: mergedContextResourceIdentifiers, children: _jsx(HostedLinkedConversationContext.Provider, { value: hostedLinkedConversation ?? outerHostedLinkedConversation, children: _jsx(CompositeComponent, { viewRef: document.ref, viewDefinition: document }) }) }));
137
147
  };
138
148
  export default CompositeView;
139
149
  //# sourceMappingURL=CompositeView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CompositeView.js","sourceRoot":"","sources":["../../../../../src/components/views/composite-view/CompositeView.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAGL,8BAA8B,GAC/B,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,cAAc,EAAmC,MAAM,wDAAwD,CAAC;AACzH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gEAAgE,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAiBhG;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,OAAO,EACP,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB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cAAc;WACtC,cAAc,CAAC,OAAO,CAAC;IAC5B,MAAM,2BAA2B,GAAG,mBAAmB,IAAI,sBAAsB,EAAE,mBAAmB,CAAC;IAEvG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAC,YAAY,IAAC,QAAQ,EAAC,WAAW,EAAC,OAAO,EAAE,OAAO,GAAI,CAAC;IACjE,CAAC;IAED,MAAM,kBAAkB,GAAqD,QAAQ,CAAC,aAAa,CAAC;IAEpG,OAAO,CACL,KAAC,qBAAqB,IACpB,cAAc,EAAE,QAAQ,EACxB,UAAU,EAAE,iBAAiB,EAC7B,cAAc,EAAE,sBAAsB,EACtC,mBAAmB,EAAE,2BAA2B,EAChD,gBAAgB,EAAE,wBAAwB,EAC1C,0BAA0B,EAAE,gCAAgC,YAE5D,KAAC,kBAAkB,IAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,GAAI,GACjD,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { ResourceParentResourceRequirement } from '@wildo-ai/saas-models';\nimport {\n type CompositeViewComponentProps,\n type CompositeViewDefinition,\n resolveCompositeViewDefinition,\n} from '~wildo-frontend-lib/core/config/composite-view.schemas';\nimport { useUI } from \"~wildo-frontend-lib/core/ui/useUI\";\nimport { ViewNotFound } from '~wildo-frontend-lib/components/views/ViewNotFound';\nimport { NavigationZone, type NavigationInitiatorContext } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport {\n FrontendInsertedViewHostKind,\n FrontendInsertedViewKind,\n parseFrontendInsertedViewRef,\n} from '~wildo-frontend-lib/core/config/inserted-view.frontend.schemas';\nimport { FrontendView_ScopeMode } from '~wildo-frontend-lib/core/config/views-frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { CompositeViewProvider, useOptionalCompositeViewContext } from './CompositeViewContext';\n\nexport interface CompositeViewProps {\n /** View reference — resolved from UIContext internally. Mutually exclusive with `document`. */\n viewRef?: string;\n /** Pre-resolved document to load. When provided, viewRef is ignored. */\n document?: CompositeViewDefinition;\n /** Explicit resource host type for resource-scoped composite runtimes. */\n hostResourceType?: string;\n /** Explicit scoped resource identifiers for resource-scoped composite runtimes. */\n contextResourceIdentifiers?: Record<string, string>;\n /** Framework-owned transient runtime zone. */\n navigationZone?: NavigationZone;\n /** Framework-owned transient navigation initiator. */\n navigationInitiator?: NavigationInitiatorContext;\n}\n\n/**\n * CompositeView - top-level host for authored composite surfaces.\n */\nexport const CompositeView: React.FC<CompositeViewProps> = ({\n viewRef,\n document: documentProp,\n hostResourceType,\n contextResourceIdentifiers,\n navigationZone,\n navigationInitiator,\n}) => {\n const parentCompositeContext = useOptionalCompositeViewContext();\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n\n // Get current viewport breakpoint and composite views from UI context\n const { UIConfig, compositeViews } = useUI();\n const currentBreakpoint = UIConfig?.currentBreakpoint;\n\n const insertedIdentity = React.useMemo(() => parseFrontendInsertedViewRef(viewRef), [viewRef]);\n\n const resolvedHostResourceType = hostResourceType\n ?? (\n insertedIdentity?.hostKind === FrontendInsertedViewHostKind.RESOURCE\n && insertedIdentity.viewKind === FrontendInsertedViewKind.COMPOSITE_VIEW\n ? insertedIdentity.hostRef\n : undefined\n )\n ?? parentCompositeContext?.hostResourceType;\n\n const resolvedContextResourceIdentifiers = contextResourceIdentifiers\n ?? parentCompositeContext?.contextResourceIdentifiers;\n\n // Resolve document: use provided prop, or resolve from inserted resource host, or resolve from app UIContext.\n // Memoized so the resolved definition keeps a stable identity across renders — it\n // is a field of the CompositeViewProvider value and a dep of several memos below;\n // a fresh object each render would defeat that provider's identity stability and\n // re-render every embedded surface.\n const document = useMemo(\n () => documentProp ?? resolveCompositeViewDefinition({ viewRef, compositeViews, registry }),\n [documentProp, viewRef, compositeViews, registry],\n );\n useEffect(() => {\n if (\n process.env.NODE_ENV === 'production'\n || document\n || !viewRef\n || !resolvedContextResourceIdentifiers\n || Object.keys(resolvedContextResourceIdentifiers).length === 0\n ) {\n return;\n }\n\n console.warn('[CompositeView] Cannot validate explicit view context bindings because the view definition could not be resolved', {\n surfaceName: 'CompositeView',\n surfaceRef: viewRef,\n explicitContextResourceIdentifiers: resolvedContextResourceIdentifiers,\n });\n }, [document, resolvedContextResourceIdentifiers, viewRef]);\n const computedMergedContextResourceIdentifiers = useMemo(() => {\n const primaryScopeInitiatorIds = ScopeUtilsService.buildInitiatorIds({\n userId: appScope?.currentUserId,\n organizationId: appScope?.currentOrganizationId,\n applicationId: appScope?.currentApplicationId,\n anonymousUserId: appScope?.currentAnonymousUserId,\n });\n const primaryScopeContext =\n document?.primaryScope\n ? ScopeUtilsService.primaryScopeToContextIdentifiers(\n primaryScopeInitiatorIds,\n document.primaryScope,\n )\n : {};\n const liveAppScopeContext = appScope?.buildContextResourceIdentifiers() ?? {};\n const customScopeContext = ScopeUtilsService.filterCustomScopeContextResourceIdentifiers(liveAppScopeContext);\n\n if (!document) {\n return ScopeUtilsService.mergeContextResourceIdentifiers(\n primaryScopeContext,\n customScopeContext,\n resolvedContextResourceIdentifiers,\n );\n }\n\n const hostResourceRequirement = (\n document.scope === FrontendView_ScopeMode.RESOURCE\n && resolvedHostResourceType\n )\n ? [{\n resourceType: resolvedHostResourceType,\n requirement: ResourceParentResourceRequirement.OPTIONAL,\n isPrimaryScope: false,\n }]\n : [];\n\n const mergedAdditionalResourceRequirements = [\n ...(document.additionalResourceRequirements ?? []),\n ...hostResourceRequirement,\n ];\n // Drop inherited ancestor keys the composite never scopes by — e.g. a todo\n // opened via `/todo-lists/{list}/todos/{todo}` hands its workspace\n // `todoLists`, but the workspace's contract is {primaryScope, host todo}.\n // The host resource IS in the contract (added via hostResourceRequirement),\n // so the embedded host READ keeps the id it needs; only the dead ancestor is\n // dropped. This keeps the context forwarded to every embedded surface honest\n // and silences the dev \"context bindings outside its declared contract\" warning.\n const allowedBindingKeys = ScopeUtilsService.getAllowedViewBindingKeys({\n primaryScope: document.primaryScope,\n parentResourcesRequirements: document.parentResourcesRequirements,\n additionalResourceRequirements: mergedAdditionalResourceRequirements,\n });\n return ScopeUtilsService.resolveViewContextResourceIdentifiers({\n surfaceName: 'CompositeView',\n surfaceRef: document.ref,\n primaryScope: document.primaryScope,\n parentResourcesRequirements: document.parentResourcesRequirements,\n additionalResourceRequirements: mergedAdditionalResourceRequirements,\n primaryScopeContext,\n customScopeContext,\n explicitContextResourceIdentifiers: ScopeUtilsService.scopeContextToBindingContract(\n resolvedContextResourceIdentifiers,\n allowedBindingKeys,\n ),\n });\n }, [\n appScope,\n appScope?.currentAnonymousUserId,\n appScope?.currentApplicationId,\n appScope?.currentOrganizationId,\n appScope?.currentUserId,\n document,\n resolvedHostResourceType,\n resolvedContextResourceIdentifiers,\n ]);\n /**\n * IDENTITY-STABLE scoped identifiers. The memo above depends on the live\n * `appScope` object, whose identity churns on every AppScope provider render —\n * so it recomputes to a fresh `Record` constantly even when the actual scoped\n * ids are unchanged. That fresh object is the root of the composite re-render\n * loop: it flows into `CompositeViewProvider` and every embedded surface,\n * rebuilding resource-operation contexts (and cloning configs) each render.\n * Keying a passthrough memo on the value-derived identifiers key collapses the\n * identity back to a single reference per distinct value — recomputing only\n * when the scoped ids genuinely change, so no context goes stale.\n */\n const mergedContextResourceIdentifiersKey = FrontendResourceUtils.buildContextResourceIdentifiersKey(\n computedMergedContextResourceIdentifiers,\n );\n const mergedContextResourceIdentifiers = useMemo(\n () => computedMergedContextResourceIdentifiers,\n // eslint-disable-next-line react-hooks/exhaustive-deps -- intentionally keyed by value (key), not by the recomputed-every-render object identity\n [mergedContextResourceIdentifiersKey],\n );\n const resolvedNavigationZone = navigationZone\n ?? parentCompositeContext?.navigationZone\n ?? NavigationZone.PRIMARY;\n const resolvedNavigationInitiator = navigationInitiator ?? parentCompositeContext?.navigationInitiator;\n\n if (!document) {\n return <ViewNotFound viewKind=\"composite\" viewRef={viewRef} />;\n }\n\n const CompositeComponent: React.ComponentType<CompositeViewComponentProps> = document.viewComponent;\n\n return (\n <CompositeViewProvider\n viewDefinition={document}\n breakpoint={currentBreakpoint}\n navigationZone={resolvedNavigationZone}\n navigationInitiator={resolvedNavigationInitiator}\n hostResourceType={resolvedHostResourceType}\n contextResourceIdentifiers={mergedContextResourceIdentifiers}\n >\n <CompositeComponent viewRef={document.ref} viewDefinition={document} />\n </CompositeViewProvider>\n );\n};\n\nexport default CompositeView;\n\n"]}
1
+ {"version":3,"file":"CompositeView.js","sourceRoot":"","sources":["../../../../../src/components/views/composite-view/CompositeView.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAGL,8BAA8B,GAC/B,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,cAAc,EAAmC,MAAM,wDAAwD,CAAC;AACzH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gEAAgE,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,4CA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C,qBAAqB,IACpB,cAAc,EAAE,QAAQ,EACxB,UAAU,EAAE,iBAAiB,EAC7B,cAAc,EAAE,sBAAsB,EACtC,mBAAmB,EAAE,2BAA2B,EAChD,gBAAgB,EAAE,wBAAwB,EAC1C,0BAA0B,EAAE,gCAAgC,YAG5D,KAAC,+BAA+B,CAAC,QAAQ,IAAC,KAAK,EAAE,wBAAwB,IAAI,6BAA6B,YACxG,KAAC,kBAAkB,IAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,GAAI,GAC9B,GACrB,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { ResourceParentResourceRequirement } from '@wildo-ai/saas-models';\nimport {\n type CompositeViewComponentProps,\n type CompositeViewDefinition,\n resolveCompositeViewDefinition,\n} from '~wildo-frontend-lib/core/config/composite-view.schemas';\nimport { useUI } from \"~wildo-frontend-lib/core/ui/useUI\";\nimport { ViewNotFound } from '~wildo-frontend-lib/components/views/ViewNotFound';\nimport { NavigationZone, type NavigationInitiatorContext } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport {\n FrontendInsertedViewHostKind,\n FrontendInsertedViewKind,\n parseFrontendInsertedViewRef,\n} from '~wildo-frontend-lib/core/config/inserted-view.frontend.schemas';\nimport { FrontendView_ScopeMode } from '~wildo-frontend-lib/core/config/views-frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { ScopeUtilsService } from '~wildo-frontend-lib/core/scope/scope.utils.frontend.service';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { CompositeViewProvider, useOptionalCompositeViewContext } from './CompositeViewContext';\nimport {\n HostedLinkedConversationContext,\n type HostedLinkedConversation,\n type LinkedConversationRequest,\n} from '~wildo-frontend-lib/components/views/flows-actors-view/linked-conversation.context';\n\nexport interface CompositeViewProps {\n /** View reference — resolved from UIContext internally. Mutually exclusive with `document`. */\n viewRef?: string;\n /** Pre-resolved document to load. When provided, viewRef is ignored. */\n document?: CompositeViewDefinition;\n /** Explicit resource host type for resource-scoped composite runtimes. */\n hostResourceType?: string;\n /** Explicit scoped resource identifiers for resource-scoped composite runtimes. */\n contextResourceIdentifiers?: Record<string, string>;\n /** Framework-owned transient runtime zone. */\n navigationZone?: NavigationZone;\n /** Framework-owned transient navigation initiator. */\n navigationInitiator?: NavigationInitiatorContext;\n /**\n * A conversation a link asked this view to open (#4043): handed to the conversation the view declares it hosts\n * (`conversationSystemRef`). A view that declares none settles it at once, so its address does not keep it.\n */\n linkedConversation?: LinkedConversationRequest;\n}\n\n/**\n * CompositeView - top-level host for authored composite surfaces.\n */\nexport const CompositeView: React.FC<CompositeViewProps> = ({\n viewRef,\n document: documentProp,\n hostResourceType,\n contextResourceIdentifiers,\n navigationZone,\n navigationInitiator,\n linkedConversation,\n}) => {\n const parentCompositeContext = useOptionalCompositeViewContext();\n const { registry } = useResourceRegistry();\n const appScope = useAppScopeSafe();\n\n // Get current viewport breakpoint and composite views from UI context\n const { UIConfig, compositeViews } = useUI();\n const currentBreakpoint = UIConfig?.currentBreakpoint;\n\n const insertedIdentity = React.useMemo(() => parseFrontendInsertedViewRef(viewRef), [viewRef]);\n\n const resolvedHostResourceType = hostResourceType\n ?? (\n insertedIdentity?.hostKind === FrontendInsertedViewHostKind.RESOURCE\n && insertedIdentity.viewKind === FrontendInsertedViewKind.COMPOSITE_VIEW\n ? insertedIdentity.hostRef\n : undefined\n )\n ?? parentCompositeContext?.hostResourceType;\n\n const resolvedContextResourceIdentifiers = contextResourceIdentifiers\n ?? parentCompositeContext?.contextResourceIdentifiers;\n\n // Resolve document: use provided prop, or resolve from inserted resource host, or resolve from app UIContext.\n // Memoized so the resolved definition keeps a stable identity across renders — it\n // is a field of the CompositeViewProvider value and a dep of several memos below;\n // a fresh object each render would defeat that provider's identity stability and\n // re-render every embedded surface.\n const document = useMemo(\n () => documentProp ?? resolveCompositeViewDefinition({ viewRef, compositeViews, registry }),\n [documentProp, viewRef, compositeViews, registry],\n );\n useEffect(() => {\n if (\n process.env.NODE_ENV === 'production'\n || document\n || !viewRef\n || !resolvedContextResourceIdentifiers\n || Object.keys(resolvedContextResourceIdentifiers).length === 0\n ) {\n return;\n }\n\n console.warn('[CompositeView] Cannot validate explicit view context bindings because the view definition could not be resolved', {\n surfaceName: 'CompositeView',\n surfaceRef: viewRef,\n explicitContextResourceIdentifiers: resolvedContextResourceIdentifiers,\n });\n }, [document, resolvedContextResourceIdentifiers, viewRef]);\n const computedMergedContextResourceIdentifiers = useMemo(() => {\n const primaryScopeInitiatorIds = ScopeUtilsService.buildInitiatorIds({\n userId: appScope?.currentUserId,\n organizationId: appScope?.currentOrganizationId,\n applicationId: appScope?.currentApplicationId,\n anonymousUserId: appScope?.currentAnonymousUserId,\n });\n const primaryScopeContext =\n document?.primaryScope\n ? ScopeUtilsService.primaryScopeToContextIdentifiers(\n primaryScopeInitiatorIds,\n document.primaryScope,\n )\n : {};\n const liveAppScopeContext = appScope?.buildContextResourceIdentifiers() ?? {};\n const customScopeContext = ScopeUtilsService.filterCustomScopeContextResourceIdentifiers(liveAppScopeContext);\n\n if (!document) {\n return ScopeUtilsService.mergeContextResourceIdentifiers(\n primaryScopeContext,\n customScopeContext,\n resolvedContextResourceIdentifiers,\n );\n }\n\n const hostResourceRequirement = (\n document.scope === FrontendView_ScopeMode.RESOURCE\n && resolvedHostResourceType\n )\n ? [{\n resourceType: resolvedHostResourceType,\n requirement: ResourceParentResourceRequirement.OPTIONAL,\n isPrimaryScope: false,\n }]\n : [];\n\n const mergedAdditionalResourceRequirements = [\n ...(document.additionalResourceRequirements ?? []),\n ...hostResourceRequirement,\n ];\n // Drop inherited ancestor keys the composite never scopes by — e.g. a todo\n // opened via `/todo-lists/{list}/todos/{todo}` hands its workspace\n // `todoLists`, but the workspace's contract is {primaryScope, host todo}.\n // The host resource IS in the contract (added via hostResourceRequirement),\n // so the embedded host READ keeps the id it needs; only the dead ancestor is\n // dropped. This keeps the context forwarded to every embedded surface honest\n // and silences the dev \"context bindings outside its declared contract\" warning.\n const allowedBindingKeys = ScopeUtilsService.getAllowedViewBindingKeys({\n primaryScope: document.primaryScope,\n parentResourcesRequirements: document.parentResourcesRequirements,\n additionalResourceRequirements: mergedAdditionalResourceRequirements,\n });\n return ScopeUtilsService.resolveViewContextResourceIdentifiers({\n surfaceName: 'CompositeView',\n surfaceRef: document.ref,\n primaryScope: document.primaryScope,\n parentResourcesRequirements: document.parentResourcesRequirements,\n additionalResourceRequirements: mergedAdditionalResourceRequirements,\n primaryScopeContext,\n customScopeContext,\n explicitContextResourceIdentifiers: ScopeUtilsService.scopeContextToBindingContract(\n resolvedContextResourceIdentifiers,\n allowedBindingKeys,\n ),\n });\n }, [\n appScope,\n appScope?.currentAnonymousUserId,\n appScope?.currentApplicationId,\n appScope?.currentOrganizationId,\n appScope?.currentUserId,\n document,\n resolvedHostResourceType,\n resolvedContextResourceIdentifiers,\n ]);\n /**\n * IDENTITY-STABLE scoped identifiers. The memo above depends on the live\n * `appScope` object, whose identity churns on every AppScope provider render —\n * so it recomputes to a fresh `Record` constantly even when the actual scoped\n * ids are unchanged. That fresh object is the root of the composite re-render\n * loop: it flows into `CompositeViewProvider` and every embedded surface,\n * rebuilding resource-operation contexts (and cloning configs) each render.\n * Keying a passthrough memo on the value-derived identifiers key collapses the\n * identity back to a single reference per distinct value — recomputing only\n * when the scoped ids genuinely change, so no context goes stale.\n */\n const mergedContextResourceIdentifiersKey = FrontendResourceUtils.buildContextResourceIdentifiersKey(\n computedMergedContextResourceIdentifiers,\n );\n const mergedContextResourceIdentifiers = useMemo(\n () => computedMergedContextResourceIdentifiers,\n // eslint-disable-next-line react-hooks/exhaustive-deps -- intentionally keyed by value (key), not by the recomputed-every-render object identity\n [mergedContextResourceIdentifiersKey],\n );\n const resolvedNavigationZone = navigationZone\n ?? parentCompositeContext?.navigationZone\n ?? NavigationZone.PRIMARY;\n const resolvedNavigationInitiator = navigationInitiator ?? parentCompositeContext?.navigationInitiator;\n\n // The linked conversation, for the conversation this view hosts on its record (#4043).\n const outerHostedLinkedConversation = React.useContext(HostedLinkedConversationContext);\n const hostedSystemRef = document?.conversationSystemRef;\n const hostedLinkedConversation = useMemo<HostedLinkedConversation | null>(\n () => (linkedConversation && hostedSystemRef ? { ...linkedConversation, systemRef: hostedSystemRef } : null),\n [linkedConversation, hostedSystemRef],\n );\n // A link nothing here can take is settled at once: the address does not keep a conversation no view will open.\n const unhostedLink = linkedConversation && document && !hostedSystemRef ? linkedConversation : undefined;\n useEffect(() => {\n unhostedLink?.onSettled();\n }, [unhostedLink]);\n\n if (!document) {\n return <ViewNotFound viewKind=\"composite\" viewRef={viewRef} />;\n }\n\n const CompositeComponent: React.ComponentType<CompositeViewComponentProps> = document.viewComponent;\n\n return (\n <CompositeViewProvider\n viewDefinition={document}\n breakpoint={currentBreakpoint}\n navigationZone={resolvedNavigationZone}\n navigationInitiator={resolvedNavigationInitiator}\n hostResourceType={resolvedHostResourceType}\n contextResourceIdentifiers={mergedContextResourceIdentifiers}\n >\n {/* A view holding no link passes the outer one on: a view nested in a hosting view must not hide its link. */}\n <HostedLinkedConversationContext.Provider value={hostedLinkedConversation ?? outerHostedLinkedConversation}>\n <CompositeComponent viewRef={document.ref} viewDefinition={document} />\n </HostedLinkedConversationContext.Provider>\n </CompositeViewProvider>\n );\n};\n\nexport default CompositeView;\n\n"]}
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ import type { FlowsActorsViewDefinition } from '../../../core/config/flows-actors-view.schemas';
3
+ import type { FrontendResourcesRegistry } from '../../../core/resources/resources.frontend.schemas';
4
+ /**
5
+ * Where a link to one conversation leads (#4013, #4043), or `undefined` when the link is incomplete or nothing in this
6
+ * application shows that conversation's system.
7
+ *
8
+ * The backend that sends a notice knows the conversation's system and the context it was opened in, not this
9
+ * frontend's views, so the link names those and this maps them to a page:
10
+ *
11
+ * 1. **On a record.** When the context names a record of a resource whose composite view declares it hosts this
12
+ * system's conversations (`conversationSystemRef`) and has an address of its own, that view on that record: the
13
+ * conversation is listed there and nowhere else. Resources are tried in the registry's order, and the first that
14
+ * matches is taken. The page is addressed by the record and its organization alone, which is all a stored context
15
+ * holds: a record the engine can only open under a parent it names in its route is not reached this way.
16
+ * 2. **Otherwise**, the first flows-actors view configured for the system: its conversations are the ones opened in the
17
+ * organization alone. When several views show the same system, they list the same person's conversations of it.
18
+ *
19
+ * Either page names the conversation in `?conversation=`. The organization is not part of the path: the page switches to
20
+ * it before following the link (see {@link ConversationLinkPage}).
21
+ */
22
+ export declare function conversationLinkTargetOf(params: {
23
+ views: readonly Pick<FlowsActorsViewDefinition, 'ref' | 'systemRef'>[] | undefined;
24
+ resourceConfigurations?: FrontendResourcesRegistry['resourceConfigurations'];
25
+ search: URLSearchParams;
26
+ }): string | undefined;
27
+ /**
28
+ * The conversation a link names on a flows-actors view's page (`?conversation=`, set by {@link ConversationLinkPage}),
29
+ * and the way to drop it from the address once the view has taken it, so a reload or a later visit does not reopen it
30
+ * over the conversation the person moved to. Replaces the history entry: the link is not a step the person took.
31
+ */
32
+ export declare function useLinkedConversationParam(): {
33
+ linkedConversationId: string | undefined;
34
+ dropLinkedConversation: () => void;
35
+ };
36
+ /**
37
+ * The engine page a notice or an email about a conversation opens (`CONVERSATION_LINK_PAGE_PATH`, #4013). It shows
38
+ * nothing of its own: it sends the person on to the page that lists the conversation (see
39
+ * {@link conversationLinkTargetOf}), which opens it if their history holds it.
40
+ *
41
+ * **In the conversation's organization (#4043).** A conversation is listed only in the organization it was opened in,
42
+ * which its context names. When that is not the organization the person is in, the page switches to it first, through
43
+ * `followRouteOrganization`: the link names an organization the way a route does, and the follow admits exactly the
44
+ * organizations a route may take this session into (an active membership, one it loaded, one its access profile
45
+ * confers; never in a one-off session). It does not reset the navigation the way the switcher does, so the person
46
+ * lands on the conversation rather than the home page; like the route follow, it announces the move
47
+ * (`NAVIGATION_ORGANIZATION_FOLLOWED`), so no pane or overlay of the previous organization stays on screen under the
48
+ * new one (#2276). A refusal is held for that organization only, and asked again when what the session holds changes
49
+ * (memberships, access profile) or the link names another one. When the session cannot be in that organization, or the context
50
+ * names several, the page says the conversation cannot be opened here, in the words the view uses for one it cannot
51
+ * open. It decides nothing about access: switching is refused or admitted by the same rules as any route.
52
+ *
53
+ * An application with no page for that system says so, as a view that does not exist does.
54
+ */
55
+ export declare const ConversationLinkPage: React.FC;
56
+ export default ConversationLinkPage;
57
+ //# sourceMappingURL=ConversationLinkPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationLinkPage.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/flows-actors-view/ConversationLinkPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AAM3G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAC;AAgB/G;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,KAAK,EAAE,SAAS,IAAI,CAAC,yBAAyB,EAAE,KAAK,GAAG,WAAW,CAAC,EAAE,GAAG,SAAS,CAAC;IACnF,sBAAsB,CAAC,EAAE,yBAAyB,CAAC,wBAAwB,CAAC,CAAC;IAC7E,MAAM,EAAE,eAAe,CAAC;CACzB,GAAG,MAAM,GAAG,SAAS,CA0BrB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI;IAAE,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,sBAAsB,EAAE,MAAM,IAAI,CAAA;CAAE,CAW7H;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAkCxC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,136 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Navigate, useSearchParams } from 'react-router';
4
+ import { CONVERSATION_LINK_CONTEXT_PARAM, CONVERSATION_LINK_CONVERSATION_PARAM, CONVERSATION_LINK_SYSTEM_PARAM, CoreResourceType, FLOWS_ACTORS_VIEW_CONVERSATION_PARAM, organizationsNamedByFlowsActorsContext, parseFlowsActorsContextRef, } from '@wildo-ai/saas-models';
5
+ import { buildCompositeRouteUrlPath, buildResourceInsertedCompositeIdentity, isStandaloneRoutableInsertedCompositeView, } from '../../../core/config/composite-view.schemas.js';
6
+ import { useResourceRegistry } from '../../../core/resources/useResourceRegistry.js';
7
+ import { useUI } from '../../../core/ui/useUI.js';
8
+ import { useI18n } from '../../../core/i18n/useI18n.js';
9
+ import { useAppScopeSafe } from '../../../core/scope/useAppScope.js';
10
+ import { useUserOrgs } from '../../../core/security/useUserOrgs.js';
11
+ import { useEventBus } from '../../../core/events/useEventBus.js';
12
+ import { FrontendEvents } from '../../../core/events/events.frontend.schemas.js';
13
+ import { FrontendComponentType } from '@wildo-ai/presets-components-models';
14
+ import { ViewNotFound } from '../../../components/views/ViewNotFound.js';
15
+ /** `path` with one more query parameter, whether or not it already has some. */
16
+ function withQueryParam(path, key, value) {
17
+ return `${path}${path.includes('?') ? '&' : '?'}${key}=${encodeURIComponent(value)}`;
18
+ }
19
+ /**
20
+ * Where a link to one conversation leads (#4013, #4043), or `undefined` when the link is incomplete or nothing in this
21
+ * application shows that conversation's system.
22
+ *
23
+ * The backend that sends a notice knows the conversation's system and the context it was opened in, not this
24
+ * frontend's views, so the link names those and this maps them to a page:
25
+ *
26
+ * 1. **On a record.** When the context names a record of a resource whose composite view declares it hosts this
27
+ * system's conversations (`conversationSystemRef`) and has an address of its own, that view on that record: the
28
+ * conversation is listed there and nowhere else. Resources are tried in the registry's order, and the first that
29
+ * matches is taken. The page is addressed by the record and its organization alone, which is all a stored context
30
+ * holds: a record the engine can only open under a parent it names in its route is not reached this way.
31
+ * 2. **Otherwise**, the first flows-actors view configured for the system: its conversations are the ones opened in the
32
+ * organization alone. When several views show the same system, they list the same person's conversations of it.
33
+ *
34
+ * Either page names the conversation in `?conversation=`. The organization is not part of the path: the page switches to
35
+ * it before following the link (see {@link ConversationLinkPage}).
36
+ */
37
+ export function conversationLinkTargetOf(params) {
38
+ const { views, resourceConfigurations, search } = params;
39
+ const systemRef = search.get(CONVERSATION_LINK_SYSTEM_PARAM);
40
+ const conversationId = search.get(CONVERSATION_LINK_CONVERSATION_PARAM);
41
+ if (!systemRef || !conversationId)
42
+ return undefined;
43
+ const context = parseFlowsActorsContextRef(search.get(CONVERSATION_LINK_CONTEXT_PARAM) ?? undefined);
44
+ const organizations = organizationsNamedByFlowsActorsContext(context);
45
+ for (const [resourceType, configuration] of Object.entries(resourceConfigurations ?? {})) {
46
+ const recordId = context[resourceType];
47
+ if (!recordId)
48
+ continue;
49
+ const hosting = configuration?.frontendConfiguration?.compositeViews?.find((view) => (view.conversationSystemRef === systemRef && isStandaloneRoutableInsertedCompositeView(view)));
50
+ if (!hosting)
51
+ continue;
52
+ const viewRef = buildResourceInsertedCompositeIdentity(resourceType, hosting).insertedViewRef;
53
+ const page = buildCompositeRouteUrlPath(viewRef, {
54
+ [resourceType]: recordId,
55
+ ...(organizations.length === 1 ? { [CoreResourceType.ORGANIZATIONS]: organizations[0] } : {}),
56
+ });
57
+ return withQueryParam(page, FLOWS_ACTORS_VIEW_CONVERSATION_PARAM, conversationId);
58
+ }
59
+ const view = views?.find((candidate) => candidate.systemRef === systemRef);
60
+ if (!view)
61
+ return undefined;
62
+ return withQueryParam(`/flows-actors/${encodeURIComponent(view.ref)}`, FLOWS_ACTORS_VIEW_CONVERSATION_PARAM, conversationId);
63
+ }
64
+ /**
65
+ * The conversation a link names on a flows-actors view's page (`?conversation=`, set by {@link ConversationLinkPage}),
66
+ * and the way to drop it from the address once the view has taken it, so a reload or a later visit does not reopen it
67
+ * over the conversation the person moved to. Replaces the history entry: the link is not a step the person took.
68
+ */
69
+ export function useLinkedConversationParam() {
70
+ const [search, setSearch] = useSearchParams();
71
+ const linkedConversationId = search.get(FLOWS_ACTORS_VIEW_CONVERSATION_PARAM) ?? undefined;
72
+ const dropLinkedConversation = React.useCallback(() => {
73
+ setSearch((current) => {
74
+ const next = new URLSearchParams(current);
75
+ next.delete(FLOWS_ACTORS_VIEW_CONVERSATION_PARAM);
76
+ return next;
77
+ }, { replace: true });
78
+ }, [setSearch]);
79
+ return { linkedConversationId, dropLinkedConversation };
80
+ }
81
+ /**
82
+ * The engine page a notice or an email about a conversation opens (`CONVERSATION_LINK_PAGE_PATH`, #4013). It shows
83
+ * nothing of its own: it sends the person on to the page that lists the conversation (see
84
+ * {@link conversationLinkTargetOf}), which opens it if their history holds it.
85
+ *
86
+ * **In the conversation's organization (#4043).** A conversation is listed only in the organization it was opened in,
87
+ * which its context names. When that is not the organization the person is in, the page switches to it first, through
88
+ * `followRouteOrganization`: the link names an organization the way a route does, and the follow admits exactly the
89
+ * organizations a route may take this session into (an active membership, one it loaded, one its access profile
90
+ * confers; never in a one-off session). It does not reset the navigation the way the switcher does, so the person
91
+ * lands on the conversation rather than the home page; like the route follow, it announces the move
92
+ * (`NAVIGATION_ORGANIZATION_FOLLOWED`), so no pane or overlay of the previous organization stays on screen under the
93
+ * new one (#2276). A refusal is held for that organization only, and asked again when what the session holds changes
94
+ * (memberships, access profile) or the link names another one. When the session cannot be in that organization, or the context
95
+ * names several, the page says the conversation cannot be opened here, in the words the view uses for one it cannot
96
+ * open. It decides nothing about access: switching is refused or admitted by the same rules as any route.
97
+ *
98
+ * An application with no page for that system says so, as a view that does not exist does.
99
+ */
100
+ export const ConversationLinkPage = () => {
101
+ const [search] = useSearchParams();
102
+ const { flowsActorsViews } = useUI();
103
+ const { registry } = useResourceRegistry();
104
+ const appScope = useAppScopeSafe();
105
+ const { followRouteOrganization } = useUserOrgs();
106
+ const { emit } = useEventBus();
107
+ const { tComponent } = useI18n({ component: FrontendComponentType.HIGH_LEVEL_VIEWS_FLOWS_ACTORS });
108
+ const organizations = organizationsNamedByFlowsActorsContext(parseFlowsActorsContextRef(search.get(CONVERSATION_LINK_CONTEXT_PARAM) ?? undefined));
109
+ const organizationId = organizations.length === 1 ? organizations[0] : undefined;
110
+ const mustSwitch = organizationId !== undefined && appScope?.currentOrganizationId !== organizationId;
111
+ const [refusedOrganizationId, setRefusedOrganizationId] = React.useState(null);
112
+ const refused = organizationId !== undefined && refusedOrganizationId === organizationId;
113
+ React.useEffect(() => {
114
+ if (!mustSwitch || !organizationId)
115
+ return;
116
+ if (!followRouteOrganization(organizationId)) {
117
+ setRefusedOrganizationId(organizationId);
118
+ return;
119
+ }
120
+ setRefusedOrganizationId(null);
121
+ // In the same effect as the move, as the route follow does: what the previous organization left goes with it (#2276).
122
+ emit(FrontendEvents.NAVIGATION_ORGANIZATION_FOLLOWED, { organizationId });
123
+ }, [mustSwitch, organizationId, followRouteOrganization, emit]);
124
+ if (organizations.length > 1 || refused) {
125
+ return _jsx("p", { role: "status", className: "p-container text-sm text-muted-foreground", children: tComponent(FrontendComponentType.HIGH_LEVEL_VIEWS_FLOWS_ACTORS, 'linkedConversationUnavailable') });
126
+ }
127
+ // Switching: the conversation is followed once the person is in its organization.
128
+ if (mustSwitch)
129
+ return null;
130
+ const target = conversationLinkTargetOf({ views: flowsActorsViews, resourceConfigurations: registry?.resourceConfigurations, search });
131
+ if (!target)
132
+ return _jsx(ViewNotFound, { viewKind: "flows-actors" });
133
+ return _jsx(Navigate, { replace: true, to: target });
134
+ };
135
+ export default ConversationLinkPage;
136
+ //# sourceMappingURL=ConversationLinkPage.js.map