@skyhook-io/radar-app 1.22.1 → 1.23.0

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 (234) hide show
  1. package/package.json +8 -8
  2. package/src/App.tsx +131 -38
  3. package/src/RadarApp.basename.test.tsx +177 -0
  4. package/src/RadarApp.settings.test.tsx +33 -0
  5. package/src/RadarApp.tsx +5 -0
  6. package/src/api/agentSandbox.ts +259 -0
  7. package/src/api/client.autoPromConnect.test.tsx +43 -0
  8. package/src/api/client.metricsRelayCheck.test.tsx +134 -0
  9. package/src/api/client.ts +128 -25
  10. package/src/api/cloudInstallDiscover.test.tsx +76 -0
  11. package/src/api/diagnose.ts +4 -0
  12. package/src/api/kagent.test.ts +82 -0
  13. package/src/api/kagent.ts +230 -0
  14. package/src/api/prometheusCharts.ts +5 -0
  15. package/src/api/radarFeatures.test.ts +9 -0
  16. package/src/api/radarFeatures.ts +13 -0
  17. package/src/api/substrateWorkspace.test.ts +72 -0
  18. package/src/api/substrateWorkspace.ts +1394 -0
  19. package/src/api/vulnerabilities.ts +207 -9
  20. package/src/api/workloadSource.test.tsx +1172 -0
  21. package/src/api/workloadSource.ts +408 -0
  22. package/src/components/APIUnreachableBanner.test.tsx +19 -0
  23. package/src/components/APIUnreachableBanner.tsx +20 -0
  24. package/src/components/CloudConnectFlow.tsx +46 -7
  25. package/src/components/CloudFunnelButton.test.tsx +193 -7
  26. package/src/components/CloudFunnelButton.tsx +127 -32
  27. package/src/components/ConnectionErrorView.test.tsx +63 -2
  28. package/src/components/ConnectionErrorView.tsx +88 -68
  29. package/src/components/SelfManagedStart.tsx +12 -2
  30. package/src/components/agentsandbox/AgentSandboxKindLists.tsx +41 -0
  31. package/src/components/agentsandbox/AgentSandboxLists.test.tsx +410 -0
  32. package/src/components/agentsandbox/AgentSandboxOverview.test.tsx +333 -0
  33. package/src/components/agentsandbox/AgentSandboxOverview.tsx +555 -0
  34. package/src/components/agentsandbox/AgentSandboxSidebar.test.tsx +97 -0
  35. package/src/components/agentsandbox/AgentSandboxSummary.test.tsx +439 -0
  36. package/src/components/agentsandbox/AgentSandboxSummary.tsx +956 -0
  37. package/src/components/agentsandbox/AgentSandboxTables.tsx +966 -0
  38. package/src/components/agentsandbox/AgentSandboxView.tsx +34 -0
  39. package/src/components/agentsandbox/agentsandbox.fixtures.ts +135 -0
  40. package/src/components/agentsandbox/data.ts +135 -0
  41. package/src/components/agentsandbox/host.test.ts +27 -0
  42. package/src/components/agentsandbox/host.tsx +85 -0
  43. package/src/components/agentsandbox/labels.test.ts +42 -0
  44. package/src/components/agentsandbox/labels.ts +146 -0
  45. package/src/components/agentsandbox/listFilters.ts +85 -0
  46. package/src/components/agentsandbox/lists.ts +52 -0
  47. package/src/components/agentsandbox/routes.ts +23 -0
  48. package/src/components/agentsandbox/shared.tsx +321 -0
  49. package/src/components/agentsandbox/useAgentSandboxSidebarWorkspace.ts +69 -0
  50. package/src/components/agentsandbox/workspace.fixtures.ts +125 -0
  51. package/src/components/agentsandbox/workspace.tsx +258 -0
  52. package/src/components/agentsandbox/workspaceRoute.ts +18 -0
  53. package/src/components/applications/ApplicationsView.openResource.test.tsx +248 -3
  54. package/src/components/applications/ApplicationsView.tsx +156 -3
  55. package/src/components/audit/VulnerabilitiesColumns.test.tsx +487 -0
  56. package/src/components/audit/VulnerabilitiesRisk.test.tsx +318 -0
  57. package/src/components/audit/VulnerabilitiesView.test.tsx +458 -13
  58. package/src/components/audit/VulnerabilitiesView.tsx +639 -199
  59. package/src/components/cloudHints/AgentSetupCloudRow.tsx +28 -0
  60. package/src/components/cloudHints/CloudHintLink.tsx +29 -0
  61. package/src/components/cloudHints/SharedInstallAiLine.tsx +36 -0
  62. package/src/components/cloudHints/cloudHints.test.ts +126 -0
  63. package/src/components/cloudHints/cloudHints.ts +131 -0
  64. package/src/components/cloudHints/cloudHintsGate.test.tsx +70 -0
  65. package/src/components/cloudHints/cloudLinks.test.ts +52 -0
  66. package/src/components/cloudHints/cloudLinks.ts +31 -0
  67. package/src/components/cloudHints/hintStorage.ts +28 -0
  68. package/src/components/cnpg/CNPGView.tsx +4 -7
  69. package/src/components/diagnose/ActivityTurn.tsx +6 -4
  70. package/src/components/diagnose/AgentSetupNotice.tsx +5 -0
  71. package/src/components/diagnose/AssessmentCard.tsx +1 -2
  72. package/src/components/diagnose/ContinueInAgentButton.test.tsx +7 -0
  73. package/src/components/diagnose/DiagnoseContext.tsx +7 -0
  74. package/src/components/diagnose/DiagnoseSurface.escape.test.tsx +215 -0
  75. package/src/components/diagnose/DiagnoseSurface.tsx +57 -1
  76. package/src/components/diagnose/Home.test.tsx +6 -0
  77. package/src/components/diagnose/Home.tsx +10 -3
  78. package/src/components/diagnose/InvestigationEvidencePane.story.test.tsx +1 -1
  79. package/src/components/diagnose/InvestigationEvidencePane.tsx +19 -2
  80. package/src/components/diagnose/InvestigationFindingsFooter.test.tsx +413 -0
  81. package/src/components/diagnose/InvestigationView.tsx +120 -23
  82. package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
  83. package/src/components/diagnose/investigationEvidence/projection.test.ts +1 -1
  84. package/src/components/diagnose/investigationState.ts +9 -0
  85. package/src/components/diagnose/parts.test.tsx +11 -3
  86. package/src/components/diagnose/toolCallLabel.ts +3 -0
  87. package/src/components/gitops/RemoteDestinationCloudHint.tsx +6 -14
  88. package/src/components/home/ActivitySummary.tsx +3 -8
  89. package/src/components/home/ClusterHealthCard.tsx +91 -17
  90. package/src/components/home/ClusterHealthCard.utilization.test.tsx +187 -0
  91. package/src/components/home/HomeAgentBlock.tsx +2 -0
  92. package/src/components/home/HomeView.tsx +9 -29
  93. package/src/components/home/MCPSetupDialog.test.tsx +9 -0
  94. package/src/components/home/MCPSetupDialog.tsx +6 -2
  95. package/src/components/home/McpCloudLine.test.tsx +162 -0
  96. package/src/components/home/McpCloudLine.tsx +95 -0
  97. package/src/components/home/ProblemsPanel.investigate.test.tsx +2 -2
  98. package/src/components/home/TopologyPreview.test.tsx +31 -30
  99. package/src/components/home/TopologyPreview.tsx +19 -28
  100. package/src/components/home/mcpToolCatalog.test.ts +10 -0
  101. package/src/components/home/mcpToolCatalog.ts +7 -7
  102. package/src/components/issues/ClusterSchedulingBlockerRow.tsx +35 -0
  103. package/src/components/issues/IssuesPane.render.test.tsx +36 -1
  104. package/src/components/issues/IssuesPane.tsx +181 -23
  105. package/src/components/issues/SinceLastVisitRow.render.test.tsx +302 -0
  106. package/src/components/issues/SinceLastVisitRow.tsx +71 -0
  107. package/src/components/issues/sinceLastVisit.test.ts +266 -0
  108. package/src/components/issues/sinceLastVisit.ts +439 -0
  109. package/src/components/kagent/KagentAgentRenderer.test.ts +32 -0
  110. package/src/components/kagent/KagentAgentRenderer.tsx +87 -0
  111. package/src/components/kagent/KagentAgentSessions.test.tsx +166 -0
  112. package/src/components/kagent/KagentAgentSessions.tsx +124 -0
  113. package/src/components/kagent/KagentDetailPage.tsx +106 -0
  114. package/src/components/kagent/KagentLists.tsx +412 -0
  115. package/src/components/kagent/KagentOverview.tsx +234 -0
  116. package/src/components/kagent/KagentPages.tsx +690 -0
  117. package/src/components/kagent/KagentRuntimeTabs.test.tsx +219 -0
  118. package/src/components/kagent/KagentRuntimeTabs.tsx +283 -0
  119. package/src/components/kagent/KagentSidebar.test.tsx +112 -0
  120. package/src/components/kagent/KagentView.tsx +109 -0
  121. package/src/components/kagent/KagentWorkspace.test.tsx +876 -0
  122. package/src/components/kagent/host.tsx +144 -0
  123. package/src/components/kagent/routes.ts +31 -0
  124. package/src/components/kagent/shared.tsx +336 -0
  125. package/src/components/kagent/useKagentRuntime.test.tsx +77 -0
  126. package/src/components/kagent/useKagentSidebarWorkspace.ts +67 -0
  127. package/src/components/kagent/workspace.fixtures.ts +108 -0
  128. package/src/components/kagent/workspaceRoute.ts +18 -0
  129. package/src/components/resource/MetricsNotConnected.test.tsx +28 -0
  130. package/src/components/resource/MetricsNotConnected.tsx +10 -7
  131. package/src/components/resource/PrometheusCharts.tsx +10 -1
  132. package/src/components/resource/PrometheusChartsGrid.render.test.tsx +9 -0
  133. package/src/components/resource/PrometheusChartsGrid.tsx +3 -3
  134. package/src/components/resource/SubstrateHealthCharts.test.tsx +13 -1
  135. package/src/components/resource/SubstrateHealthCharts.tsx +9 -15
  136. package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
  137. package/src/components/resources/ResourcesView.tsx +2 -6
  138. package/src/components/resources/renderers/JobAdmissionRenderers.tsx +5 -4
  139. package/src/components/resources/renderers/PodRenderer.tsx +8 -2
  140. package/src/components/resources/renderers/RolloutRenderer.tsx +4 -1
  141. package/src/components/resources/renderers/WorkloadRenderer.tsx +4 -1
  142. package/src/components/settings/LocalIntegrationStatus.test.tsx +1 -0
  143. package/src/components/settings/LocalIntegrationStatus.tsx +3 -2
  144. package/src/components/settings/SettingsDialog.tsx +84 -16
  145. package/src/components/settings/SubstrateSettings.lifecycle.test.tsx +210 -0
  146. package/src/components/settings/SubstrateSettings.test.tsx +131 -0
  147. package/src/components/settings/SubstrateSettings.tsx +544 -0
  148. package/src/components/settings/settings-state.test.ts +21 -3
  149. package/src/components/settings/settings-state.ts +13 -3
  150. package/src/components/share/ShareLinkButton.test.tsx +360 -0
  151. package/src/components/share/ShareLinkButton.tsx +391 -0
  152. package/src/components/share/openShareInCloud.test.ts +29 -0
  153. package/src/components/share/openShareInCloud.ts +10 -0
  154. package/src/components/share/shareLink.test.ts +129 -0
  155. package/src/components/share/shareLink.ts +175 -0
  156. package/src/components/substrate/SubstrateActorDrawer.tsx +87 -0
  157. package/src/components/substrate/SubstrateActorOverview.tsx +489 -0
  158. package/src/components/substrate/SubstrateActorPage.tsx +384 -0
  159. package/src/components/substrate/SubstrateActors.test.tsx +1094 -0
  160. package/src/components/substrate/SubstrateActors.tsx +612 -0
  161. package/src/components/substrate/SubstrateAttentionList.tsx +441 -0
  162. package/src/components/substrate/SubstrateConnect.tsx +88 -0
  163. package/src/components/substrate/SubstrateOverview.test.tsx +396 -0
  164. package/src/components/substrate/SubstrateOverview.tsx +575 -0
  165. package/src/components/substrate/SubstratePages.test.tsx +478 -0
  166. package/src/components/substrate/SubstratePool.test.tsx +462 -0
  167. package/src/components/substrate/SubstratePoolPage.tsx +95 -0
  168. package/src/components/substrate/SubstratePoolSummary.tsx +485 -0
  169. package/src/components/substrate/SubstrateSidebar.test.tsx +101 -0
  170. package/src/components/substrate/SubstrateStateBar.tsx +63 -0
  171. package/src/components/substrate/SubstrateTemplates.tsx +376 -0
  172. package/src/components/substrate/SubstrateView.tsx +173 -0
  173. package/src/components/substrate/SubstrateWorkerPodContext.tsx +73 -0
  174. package/src/components/substrate/SubstrateWorkers.tsx +389 -0
  175. package/src/components/substrate/attention.ts +81 -0
  176. package/src/components/substrate/contextPin.tsx +69 -0
  177. package/src/components/substrate/host.tsx +83 -0
  178. package/src/components/substrate/kubectlTarget.test.tsx +77 -0
  179. package/src/components/substrate/readings.test.ts +484 -0
  180. package/src/components/substrate/readings.ts +997 -0
  181. package/src/components/substrate/routes.ts +103 -0
  182. package/src/components/substrate/shared.tsx +426 -0
  183. package/src/components/substrate/substrate.fixtures.ts +325 -0
  184. package/src/components/substrate/useSubstrateSidebarWorkspace.ts +87 -0
  185. package/src/components/substrate/workspaceRoute.ts +23 -0
  186. package/src/components/traffic/TrafficConnectionsTable.test.tsx +9 -0
  187. package/src/components/traffic/TrafficConnectionsTable.tsx +4 -2
  188. package/src/components/traffic/TrafficFilterSidebar.tsx +19 -14
  189. package/src/components/traffic/TrafficFlowList.test.tsx +63 -0
  190. package/src/components/traffic/TrafficFlowList.tsx +9 -5
  191. package/src/components/traffic/TrafficGraph.test.tsx +26 -0
  192. package/src/components/traffic/TrafficGraph.tsx +17 -14
  193. package/src/components/traffic/TrafficGraphTooLarge.tsx +2 -0
  194. package/src/components/traffic/TrafficGraphUnavailable.tsx +3 -1
  195. package/src/components/traffic/TrafficView.tsx +26 -56
  196. package/src/components/traffic/trafficFilters.test.ts +61 -1
  197. package/src/components/traffic/trafficFilters.ts +68 -8
  198. package/src/components/velero/VeleroOverview.tsx +2 -2
  199. package/src/components/velero/VeleroView.tsx +3 -6
  200. package/src/components/vulnerabilities/columns.tsx +132 -0
  201. package/src/components/vulnerabilities/filters.tsx +317 -0
  202. package/src/components/vulnerabilities/owner.test.ts +54 -0
  203. package/src/components/vulnerabilities/owner.tsx +163 -0
  204. package/src/components/vulnerabilities/parts.test.ts +126 -12
  205. package/src/components/vulnerabilities/parts.tsx +612 -52
  206. package/src/components/vulnerabilities/traffic.test.tsx +65 -0
  207. package/src/components/vulnerabilities/traffic.tsx +40 -0
  208. package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
  209. package/src/components/workload/WorkloadView.tsx +119 -14
  210. package/src/components/workload/WorkloadView.workloadSource.test.tsx +121 -0
  211. package/src/components/workspace/layout.tsx +13 -7
  212. package/src/components/workspace/sidebar.test.ts +48 -0
  213. package/src/components/workspace/sidebar.ts +73 -3
  214. package/src/components/workspace/table.ts +2 -1
  215. package/src/context/ConnectionContext.tsx +24 -5
  216. package/src/context/ConnectionProvider.connectionId.test.tsx +14 -0
  217. package/src/context/ConnectionProvider.handover.test.tsx +94 -0
  218. package/src/context/DiagnoseCustomization.tsx +20 -2
  219. package/src/contexts/RegistryAccessMode.test.tsx +51 -0
  220. package/src/contexts/RegistryAccessMode.tsx +25 -0
  221. package/src/hooks/useEventSource.test.tsx +275 -4
  222. package/src/hooks/useEventSource.ts +278 -51
  223. package/src/index.ts +1 -0
  224. package/src/integrations/resourceHost.ts +12 -6
  225. package/src/integrations/resourceHosts.test.tsx +27 -1
  226. package/src/integrations/resourceHosts.tsx +15 -7
  227. package/src/integrations/sidebarWorkspaces.test.tsx +63 -0
  228. package/src/integrations/sidebarWorkspaces.ts +41 -0
  229. package/src/integrations/workspaceRoute.ts +1 -1
  230. package/src/integrations/workspaceRoutes.ts +7 -1
  231. package/src/integrations/workspaceScreens.tsx +6 -0
  232. package/src/utils/navigation.test.ts +1 -6
  233. package/src/utils/navigation.ts +9 -44
  234. package/src/utils/network-policy-navigation.test.ts +21 -36
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyhook-io/radar-app",
3
- "version": "1.22.1",
3
+ "version": "1.23.0",
4
4
  "description": "Radar's full web UI as a reusable React component. Used by Radar's own binary and by external consumers like Radar Cloud.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,13 +37,13 @@
37
37
  "diff": "^9.0.0",
38
38
  "monaco-editor": "0.57.0",
39
39
  "react-markdown": "^10.1.0",
40
- "react-virtuoso": "^4.18.16",
40
+ "react-virtuoso": "^4.18.24",
41
41
  "remark-gfm": "^4.0.1",
42
42
  "shiki": "^4.6.0",
43
43
  "yaml": "^2.9.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "@skyhook-io/k8s-ui": ">=1.21.9",
46
+ "@skyhook-io/k8s-ui": ">=1.22.3",
47
47
  "@tanstack/react-query": ">=5",
48
48
  "@xyflow/react": ">=12.0.0",
49
49
  "clsx": ">=2",
@@ -59,9 +59,9 @@
59
59
  "@playwright/test": "^1.64.1",
60
60
  "@skyhook-io/k8s-ui": "*",
61
61
  "@tailwindcss/vite": "^4.3.5",
62
- "@tanstack/react-query": "^5.105.0",
62
+ "@tanstack/react-query": "^5.108.4",
63
63
  "@types/node": "^26.6.6",
64
- "@types/react": "^19.3.0",
64
+ "@types/react": "^19.3.3",
65
65
  "@types/react-dom": "^19.3.0",
66
66
  "@vitejs/plugin-react": "^6.3.0",
67
67
  "@xyflow/react": "^12.12.0",
@@ -72,10 +72,10 @@
72
72
  "eslint-plugin-react-refresh": "^0.5.7",
73
73
  "globals": "^17.14.0",
74
74
  "lucide-react": "^1.48.0",
75
- "postcss": "^8.5.33",
75
+ "postcss": "^8.5.34",
76
76
  "prettier": "^3.10.1",
77
- "react": "^19.3.0",
78
- "react-dom": "^19.3.0",
77
+ "react": "^19.3.1",
78
+ "react-dom": "^19.3.1",
79
79
  "react-router-dom": "^7.18.5",
80
80
  "tailwind-merge": "^3.7.0",
81
81
  "tailwindcss": "^4.3.5",
package/src/App.tsx CHANGED
@@ -5,6 +5,7 @@ import { startViewTransitionSafe } from '@skyhook-io/k8s-ui/utils/view-transitio
5
5
  import { englishPlural } from '@skyhook-io/k8s-ui/utils/pluralize'
6
6
  import { useQueryClient } from '@tanstack/react-query'
7
7
  import { useNavigate, useLocation, useSearchParams, useNavigationType, NavigationType } from 'react-router-dom'
8
+ import { issueSubjectParams } from './components/share/shareLink'
8
9
  import { HomeView } from './components/home/HomeView'
9
10
  import { DebugOverlay } from './components/DebugOverlay'
10
11
  import { GlobalDiagnoseButton } from './components/diagnose/LocalDiagnoseAction'
@@ -13,7 +14,7 @@ import { connectionHeaderValue } from './api/connectionBinding'
13
14
  import { ContextSwitchActions } from './components/ContextSwitchActions'
14
15
  import { investigationWorkspaceSearch, isInvestigationWorkspacePath, useDiagnoseLayout } from './components/diagnose/DiagnoseContext'
15
16
  import { DiagnoseSurface } from './components/diagnose/DiagnoseSurface'
16
- import { type IssueTimelineEventTarget, TopologyGraph, TopologySearch, TopologyBreadcrumb, TopologyFilterSidebar, TopologyControls, FreshnessControl, gitOpsRouteForKind, gitOpsRouteForResource, ScopePill, PaneLoader, usePhoneLayout, PHONE_MEDIA_QUERY } from '@skyhook-io/k8s-ui'
17
+ import { type IssueTimelineEventTarget, TopologyGraph, TopologySearch, TopologyBreadcrumb, TopologyFilterSidebar, TopologyControls, FreshnessControl, gitOpsRouteForKind, gitOpsRouteForResource, ScopePill, PaneLoader, usePhoneLayout, PHONE_MEDIA_QUERY, passesKindFilter, isStandaloneReplicaSet } from '@skyhook-io/k8s-ui'
17
18
  import { resetNavigationMap } from '@skyhook-io/k8s-ui/utils/navigation'
18
19
  import { topologyNodeResourceKind } from '@skyhook-io/k8s-ui/utils/topology-neighborhood'
19
20
  import { useAPIResources, findAPIResourceForRoute } from './api/apiResources'
@@ -57,7 +58,9 @@ import { ConnectionProvider, useConnection, refreshQueriesAfterReconnect } from
57
58
  import { DisconnectedView, FailedSwitchView } from './components/SwitchAwareConnectionError'
58
59
  import { SyncProgressPanel } from './components/SyncProgressPanel'
59
60
  import { NoClusterAccessBanner } from './components/NoClusterAccessBanner'
61
+ import { APIUnreachableBanner } from './components/APIUnreachableBanner'
60
62
  import { CapabilitiesProvider, useCapabilitiesContext } from './contexts/CapabilitiesContext'
63
+ import { RegistryAccessModeProvider } from './contexts/RegistryAccessMode'
61
64
  import { RadarUpgradeProvider } from './context/RadarUpgrade'
62
65
  import { UserMenu } from './components/UserMenu'
63
66
  import { COMMUNITY_SLACK_URL } from './components/community'
@@ -74,6 +77,7 @@ import { DiagnosticsOverlay, type DiagnosticsFocus } from './components/ui/Diagn
74
77
  import { useEventSource } from './hooks/useEventSource'
75
78
  import { useResetViewsOnContextChange } from './hooks/useResetViewsOnContextChange'
76
79
  import { debugNamespaceLog, refetchOnResourceEvents, resourceEventKey, useNamespaces, useNamespaceScope, useSetActiveNamespace, isAppliedNamespaceSwitch, useAuthMe, useAuditBadges, useClusterInfo, useCapabilities } from './api/client'
80
+ import { createWorkloadSourceInvalidator, type WorkloadSourceInvalidator } from './api/workloadSource'
77
81
  import { buildAuditSeverityMap } from './utils/auditBadges'
78
82
  import { isInNamespaceScope, scopeNodesToNamespaces } from './utils/topology-namespace'
79
83
  import { routePath, apiUrl, getApiBase, getAuthHeaders, getCredentialsMode, stripBasename } from './api/config'
@@ -87,6 +91,7 @@ import { useTheme } from './context/ThemeContext'
87
91
  import { Tooltip } from './components/ui/Tooltip'
88
92
  import { LargeClusterNamespacePicker } from './components/shared/LargeClusterNamespacePicker'
89
93
  import { SettingsDialog, type SettingsSectionId } from './components/settings/SettingsDialog'
94
+
90
95
  import type { APIResource, TopologyNode, GroupingMode, MainView, SelectedResource, SelectedHelmRelease, NodeKind, TopologyMode, Topology, K8sEvent } from './types'
91
96
  import { createViewMemory } from './utils/viewMemory'
92
97
  import { createKindFilterStore } from './utils/kindFilterStore'
@@ -143,12 +148,12 @@ const FLEET_MODE_KINDS = new Set<NodeKind>([
143
148
 
144
149
  // Convert API resource name back to topology node ID prefix
145
150
  // Extended MainView type that includes traffic and cost
146
- type ExtendedMainView = MainView | 'traffic' | 'cost' | 'capacity' | 'cnpg' | 'velero' | 'workload' | 'checks' | 'gitops' | 'compare' | 'helmCompare' | 'issues' | 'applications' | 'investigations'
151
+ type ExtendedMainView = MainView | 'traffic' | 'cost' | 'capacity' | 'cnpg' | 'velero' | 'substrate' | 'agent-sandbox' | 'kagent' | 'workload' | 'checks' | 'gitops' | 'compare' | 'helmCompare' | 'issues' | 'applications' | 'investigations'
147
152
 
148
153
  // Views that have been laid out for phone width (640px and below). The rest
149
154
  // keep their desktop width on a phone and scroll sideways; add a view here in
150
155
  // the PR that gives it a phone layout.
151
- const PHONE_READY_VIEWS: ReadonlySet<ExtendedMainView> = new Set<ExtendedMainView>(['issues', 'resources', 'helm', 'home', 'topology', 'capacity'])
156
+ const PHONE_READY_VIEWS: ReadonlySet<ExtendedMainView> = new Set<ExtendedMainView>(['issues', 'resources', 'helm', 'home', 'topology', 'capacity', 'investigations'])
152
157
 
153
158
  // Extract view from URL path
154
159
  function getViewFromPath(pathname: string): ExtendedMainView {
@@ -383,6 +388,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
383
388
  dismissForNavigation: dismissDiagnoseForNavigation,
384
389
  contentGutter,
385
390
  maximized: diagnoseMaximized,
391
+ fullWidthForced: diagnoseFillsViewport,
386
392
  } = useDiagnoseLayout()
387
393
  // Hand off to a host-owned URL. The host's `onHostNavigate` (Radar Cloud's
388
394
  // cross-tree swap) navigates same-document so the chrome morphs instead of
@@ -637,6 +643,10 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
637
643
  const [showPolicyEffect, setShowPolicyEffect] = useState(false)
638
644
  // Topology filter state
639
645
  const [visibleKinds, setVisibleKinds] = useState<Set<NodeKind>>(() => new Set(DEFAULT_VISIBLE_KINDS))
646
+ // Whether the user has chosen for ReplicaSets (their toggle, Show all, Hide
647
+ // all). Until then the kind stays off, hiding the ReplicaSets that collapse
648
+ // into a Deployment or Rollout, but standalone ones show.
649
+ const [replicaSetsChosen, setReplicaSetsChosen] = useState(false)
640
650
  // Phones start with the filters collapsed to their icon rail: expanded, the
641
651
  // panel took two thirds of the width from the graph.
642
652
  const [filterSidebarCollapsed, setFilterSidebarCollapsed] = useState(
@@ -717,6 +727,11 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
717
727
  // Views with a deliberate phone layout. On a phone every other view keeps
718
728
  // its desktop width and scrolls sideways rather than squeezing.
719
729
  const phoneScroll = isMobile && !PHONE_READY_VIEWS.has(mainView)
730
+ // Investigations own their responsive panes. A narrow embedded window can
731
+ // have a fine pointer (or a tablet keyboard); the host width is the boundary.
732
+ const investigationFillsHost = embedded && (
733
+ mainView === 'investigations' || (diagnoseOpen && (diagnoseMaximized || diagnoseFillsViewport))
734
+ )
720
735
 
721
736
  // On a history Pop (back/forward) the URL is authoritative. The URL-write
722
737
  // effect, running with not-yet-synced state, would otherwise write the stale
@@ -733,6 +748,12 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
733
748
  // Owner-key (pathname + ?app) a non-URL-backed peek was opened on; see
734
749
  // navigateToResource and peekOwnerKey.
735
750
  const peekOwnerKeyRef = useRef<string | null>(null)
751
+ // The router's location, readable from memoized callbacks. Never use
752
+ // window.location for route comparisons: under a host basename (Radar Hub's
753
+ // /c/<id>) it carries the prefix the router strips, and under the memory
754
+ // router it is the host page's URL.
755
+ const locationRef = useRef(location)
756
+ locationRef.current = location
736
757
  const currentResourceKindSlug = normalizedResourcesKindSlug.toLowerCase()
737
758
  const currentResourceGroup = searchParams.get('apiGroup') ?? ''
738
759
  const selectedResourceKindSlug = selectedResource ? kindToPluralWithGroup(selectedResource.kind, selectedResource.group ?? '').toLowerCase() : ''
@@ -767,6 +788,14 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
767
788
  ? null
768
789
  : selectedResource
769
790
 
791
+ // Clear orphaned peek state after hiding it at render time, so browser
792
+ // Forward back to the old owner URL doesn't revive a dismissed peek drawer.
793
+ useEffect(() => {
794
+ if (!peekRouteOrphaned) return
795
+ peekOwnerKeyRef.current = null
796
+ setSelectedResource(null)
797
+ }, [peekRouteOrphaned])
798
+
770
799
  useEffect(() => {
771
800
  if (mainView !== 'resources') {
772
801
  prevResourcesKindKeyRef.current = null
@@ -816,10 +845,9 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
816
845
  // Record the page this peek was opened on. Outside /resources the drawer is
817
846
  // not URL-backed, so this ref is what lets the render-time gate below close
818
847
  // the peek when the page under it changes (e.g. browser Back off a GitOps
819
- // detail page, or Applications detail → list via ?app). window.location is
820
- // read (not the `location` closure) so the value is always current
821
- // regardless of this callback's memoization.
822
- peekOwnerKeyRef.current = peekOwnerKey(window.location.pathname, window.location.search)
848
+ // detail page, or Applications detail → list via ?app). Read through the
849
+ // ref so the value is current regardless of this callback's memoization.
850
+ peekOwnerKeyRef.current = peekOwnerKey(locationRef.current.pathname, locationRef.current.search)
823
851
  const update = () => { setDrawerInitialTab(tab); setSelectedResource(res) }
824
852
  // Skip the cross-fade animation entirely on first open (no
825
853
  // `selectedResource`); otherwise route through
@@ -955,7 +983,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
955
983
  gitops: 'g o', checks: 'g u', cost: 'g c', capacity: 'g p',
956
984
  // Non-rail views (reachable via deep links / actions, not the rail) get no
957
985
  // dedicated mnemonic — listed for exhaustiveness so the type stays total.
958
- workload: '', compare: '', helmCompare: '', investigations: '', cnpg: '', velero: '',
986
+ workload: '', compare: '', helmCompare: '', investigations: '', cnpg: '', velero: '', substrate: '', 'agent-sandbox': '', kagent: '',
959
987
  }
960
988
  const views = Object.keys(VIEW_SHORTCUT_KEYS).filter(
961
989
  (v): v is ExtendedMainView => VIEW_SHORTCUT_KEYS[v as ExtendedMainView] !== '',
@@ -1165,6 +1193,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1165
1193
  }>({ changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null })
1166
1194
  const cnpgInvalidationPendingRef = useRef(false)
1167
1195
  const veleroInvalidationPendingRef = useRef(false)
1196
+ const kagentInvalidationPendingRef = useRef(false)
1168
1197
  // Traefik route facts scan every visible IngressRoute per request, so an open
1169
1198
  // drawer refreshes at most once per batch of this length.
1170
1199
  const traefikInvalidationRef = useRef<{ timer: number | null }>({ timer: null })
@@ -1175,6 +1204,10 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1175
1204
  timer: number | null
1176
1205
  }>({ updatedKinds: new Set(), gitopsRowsChanged: false, gitopsCountsChanged: false, timer: null })
1177
1206
  const timelineInvalidationRef = useRef<{ timer: number | null }>({ timer: null })
1207
+ const workloadSourceInvalidatorRef = useRef<WorkloadSourceInvalidator | null>(null)
1208
+ if (!workloadSourceInvalidatorRef.current) {
1209
+ workloadSourceInvalidatorRef.current = createWorkloadSourceInvalidator()
1210
+ }
1178
1211
 
1179
1212
  const handleK8sEvent = useCallback((event: K8sEvent) => {
1180
1213
  // The timeline consumes every frame — including the K8s Event kind the
@@ -1197,12 +1230,15 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1197
1230
  // Skip K8s Event kind — informational, not resource mutations
1198
1231
  if (event.kind === 'Event') return
1199
1232
 
1233
+ workloadSourceInvalidatorRef.current?.handleEvent(queryClient, event)
1234
+
1200
1235
  const kind = kindToPluralWithGroup(event.kind, event.group ?? '')
1201
1236
  const structural = event.operation === 'add' || event.operation === 'delete'
1202
1237
  const applicationWorkload = ['deployments', 'statefulsets', 'daemonsets', 'rollouts'].includes(kind)
1203
1238
 
1204
1239
  if (event.group?.endsWith('.cnpg.io')) cnpgInvalidationPendingRef.current = true
1205
1240
  if (event.group === 'velero.io') veleroInvalidationPendingRef.current = true
1241
+ if (event.group === 'api.kagent.dev' || event.kind === 'Namespace') kagentInvalidationPendingRef.current = true
1206
1242
 
1207
1243
  const fast = fastInvalidationRef.current
1208
1244
  fast.changedKinds.add(kind)
@@ -1265,6 +1301,11 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1265
1301
  queryClient.invalidateQueries({ queryKey: ['velero', 'workspace'] })
1266
1302
  queryClient.invalidateQueries({ queryKey: ['velero', 'schedule-activity'] })
1267
1303
  }
1304
+ if (kagentInvalidationPendingRef.current) {
1305
+ kagentInvalidationPendingRef.current = false
1306
+ queryClient.invalidateQueries({ queryKey: ['kagent', 'workspace'] })
1307
+ queryClient.invalidateQueries({ queryKey: ['substrate', getApiBase()], predicate: q => q.queryKey[3] === 'kagent-summary' })
1308
+ }
1268
1309
  fastInvalidationRef.current = { changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null }
1269
1310
  }, 3000)
1270
1311
  }
@@ -1310,6 +1351,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1310
1351
  fastInvalidationRef.current = { changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null }
1311
1352
  slowInvalidationRef.current = { updatedKinds: new Set(), gitopsRowsChanged: false, gitopsCountsChanged: false, timer: null }
1312
1353
  timelineInvalidationRef.current = { timer: null }
1354
+ workloadSourceInvalidatorRef.current?.reset()
1313
1355
  }, [])
1314
1356
 
1315
1357
  // SSE connection for real-time updates — no namespace filter for small/medium clusters (frontend filters).
@@ -1318,7 +1360,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1318
1360
  const sseMode = topologyMode === 'fleet' ? 'resources' : topologyMode
1319
1361
  // The context this tab's views were last reset for.
1320
1362
  const shownContextRef = useRef<string | null>(null)
1321
- const { topology, connected: eventStreamConnected, connecting: eventStreamConnecting, reconnect: reconnectEventStream, applyContextChange } = useEventSource(namespaces, sseMode as 'resources' | 'traffic', {
1363
+ const { topology, topologyStatus, connected: eventStreamConnected, connecting: eventStreamConnecting, reconnect: reconnectEventStream, applyContextChange } = useEventSource(namespaces, sseMode as 'resources' | 'traffic', {
1322
1364
  onContextSwitchComplete: endSwitch,
1323
1365
  onContextSwitchProgress: updateProgress,
1324
1366
  onContextChanged: (context) => {
@@ -1335,6 +1377,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1335
1377
  fastInvalidationRef.current = { changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null }
1336
1378
  slowInvalidationRef.current = { updatedKinds: new Set(), gitopsRowsChanged: false, gitopsCountsChanged: false, timer: null }
1337
1379
  timelineInvalidationRef.current = { timer: null }
1380
+ workloadSourceInvalidatorRef.current?.reset()
1338
1381
 
1339
1382
  // Close any open drawers/overlays — old cluster's resources don't exist on the new one
1340
1383
  // (?full=1 is cleared by the URL reset below).
@@ -1380,11 +1423,13 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1380
1423
  onConnectionStateChange: updateConnectionFromSSE,
1381
1424
  onDeferredReady: () => {
1382
1425
  // Deferred informers (secrets, events, configmaps, etc.) have finished syncing.
1383
- // Refetch dashboard so counts, warning events, and cert health fill in.
1426
+ // Refetch dashboard so counts, warning events, and cert health fill in, and
1427
+ // fetched graphs, which only the Topology screen gets streamed.
1384
1428
  queryClient.invalidateQueries({ queryKey: ['dashboard'] })
1429
+ queryClient.invalidateQueries({ queryKey: ['topology'] })
1385
1430
  },
1386
1431
  onK8sEvent: handleK8sEvent,
1387
- }, forceNamespaceFilter, showPolicyEffect)
1432
+ }, forceNamespaceFilter, showPolicyEffect, mainView === 'topology')
1388
1433
 
1389
1434
  useContextSwitchOutcome(applyContextChange)
1390
1435
  useResetViewsOnContextChange(connection.state, connection.context, shownContextRef, applyContextChange)
@@ -1395,7 +1440,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1395
1440
  // to a stale namespace while sidebar/topology show a different one. Small
1396
1441
  // clusters never set forceNamespaceFilter and skip this path entirely.
1397
1442
  useEffect(() => {
1398
- const isLarge = forceNamespaceFilter !== undefined || topology?.requiresNamespaceFilter === true
1443
+ const isLarge = forceNamespaceFilter !== undefined || topologyStatus?.requiresNamespaceFilter === true
1399
1444
  if (!isLarge) return
1400
1445
  if (namespaces.length === 0) {
1401
1446
  setForceNamespaceFilter(prev => (prev === undefined ? prev : undefined))
@@ -1407,14 +1452,15 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1407
1452
  if (cur.length === next.length && cur.every((ns, i) => ns === next[i])) return prev
1408
1453
  return [...namespaces]
1409
1454
  })
1410
- }, [namespaces, forceNamespaceFilter, topology?.requiresNamespaceFilter])
1455
+ }, [namespaces, forceNamespaceFilter, topologyStatus?.requiresNamespaceFilter])
1411
1456
 
1412
1457
  // Apply live topology updates only when not paused. While paused, buffer the
1413
- // latest snapshot so we can apply it instantly when the user resumes.
1458
+ // latest snapshot so we can apply it instantly when the user resumes. Leaving
1459
+ // the Topology screen clears the stream's graph; a paused one keeps its buffer.
1414
1460
  useEffect(() => {
1415
1461
  if (!topologyPaused) {
1416
1462
  setDisplayedTopology(topology)
1417
- } else {
1463
+ } else if (topology) {
1418
1464
  pendingTopologyRef.current = topology
1419
1465
  }
1420
1466
  }, [topology, topologyPaused])
@@ -1430,9 +1476,20 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1430
1476
  })
1431
1477
  }, [])
1432
1478
 
1433
- // Track CRD discovery status from topology (more direct than cluster-info)
1434
- // When discovery completes, topology will auto-update via SSE with new CRD nodes
1435
- const crdDiscoveryStatus = topology?.crdDiscoveryStatus
1479
+ // CRD discovery status arrives with every topology cycle, as topology_status
1480
+ // on screens that don't draw the graph.
1481
+ const crdDiscoveryStatus = topologyStatus?.crdDiscoveryStatus
1482
+ // Finished discovery adds custom resources to fetched graphs (Timeline,
1483
+ // Applications, a workload's page); only the Topology screen gets its graph
1484
+ // pushed.
1485
+ const previousDiscoveryRef = useRef(crdDiscoveryStatus)
1486
+ useEffect(() => {
1487
+ // Starting discovery isn't broadcast, so a tab may see idle go straight to ready.
1488
+ if ((previousDiscoveryRef.current === 'idle' || previousDiscoveryRef.current === 'discovering') && crdDiscoveryStatus === 'ready') {
1489
+ queryClient.invalidateQueries({ queryKey: ['topology'] })
1490
+ }
1491
+ previousDiscoveryRef.current = crdDiscoveryStatus
1492
+ }, [crdDiscoveryStatus, queryClient])
1436
1493
  const clusterConnectionState = connection.state
1437
1494
  const clusterConnected = clusterConnectionState === 'connected'
1438
1495
  const liveUpdatesDisconnected = clusterConnected && !eventStreamConnected && !eventStreamConnecting
@@ -1442,9 +1499,11 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1442
1499
  const syncProgressLabel = connection.syncStatus
1443
1500
  ? `Loading cluster data — ${connection.syncStatus.criticalSynced + connection.syncStatus.deferredSynced} of ${connection.syncStatus.criticalTotal + connection.syncStatus.deferredTotal} ready`
1444
1501
  : 'Connecting'
1502
+ const apiUnreachable = clusterConnected && Boolean(connection.apiUnreachableSince)
1445
1503
  const headerConnectionLabel =
1446
1504
  clusterConnectionState === 'disconnected' ? 'Disconnected' :
1447
1505
  clusterConnectionState === 'connecting' ? syncProgressLabel :
1506
+ apiUnreachable ? "Can't reach the API server" :
1448
1507
  liveUpdatesDisconnected ? 'Live updates disconnected' :
1449
1508
  clusterLoadState.loading ? `Connected — ${clusterLoadState.message}` :
1450
1509
  crdDiscoveryStatus === 'discovering' ? 'Connected — discovering Custom Resources...' :
@@ -1452,6 +1511,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1452
1511
  const headerConnectionDisplayLabel =
1453
1512
  clusterConnectionState === 'disconnected' ? 'Disconnected' :
1454
1513
  clusterConnectionState === 'connecting' ? syncProgressLabel :
1514
+ apiUnreachable ? 'API server unreachable' :
1455
1515
  liveUpdatesDisconnected ? 'Live updates disconnected' :
1456
1516
  showClusterWarmupLabel ? clusterLoadState.message :
1457
1517
  crdDiscoveryStatus === 'discovering' ? 'Discovering Custom Resources…' :
@@ -1826,7 +1886,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1826
1886
  // Filter by namespace (client-side) and by visible kinds
1827
1887
  const nsSet = namespaces.length > 0 ? new Set(namespaces) : null
1828
1888
  const filteredNodes = displayedTopology.nodes.filter(node =>
1829
- effectiveKinds.has(node.kind) && isInNamespaceScope(node, nsSet)
1889
+ (topologyMode === 'fleet' ? effectiveKinds.has(node.kind) : passesKindFilter(node, effectiveKinds, !replicaSetsChosen)) && isInNamespaceScope(node, nsSet)
1830
1890
  )
1831
1891
  const filteredNodeIds = new Set(filteredNodes.map(n => n.id))
1832
1892
 
@@ -1849,7 +1909,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1849
1909
  nodes: filteredNodes,
1850
1910
  edges: filteredEdges,
1851
1911
  }
1852
- }, [displayedTopology, visibleKinds, namespaces, topologyMode])
1912
+ }, [displayedTopology, visibleKinds, namespaces, topologyMode, replicaSetsChosen])
1853
1913
 
1854
1914
  // Namespace-scoped but NOT kind-filtered: the sidebar derives its kind list
1855
1915
  // and visible/hidden footer counts from this prop, so handing it the
@@ -1861,6 +1921,21 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1861
1921
  return scopeNodesToNamespaces(displayedTopology.nodes, namespaces)
1862
1922
  }, [displayedTopology, namespaces])
1863
1923
 
1924
+ // ReplicaSets are on screen when the kind is on, or by default when some
1925
+ // are standalone. The sidebar's toggle shows that: it reads "on" when every
1926
+ // ReplicaSet in view is standalone and so shown, keeping Show all available
1927
+ // while any other ReplicaSet (a Rollout's during a transition) is hidden.
1928
+ const replicaSetsShown = useMemo(() => {
1929
+ if (visibleKinds.has('ReplicaSet')) return true
1930
+ if (replicaSetsChosen || topologyMode === 'fleet') return false
1931
+ const inView = filterSidebarNodes.filter(n => n.kind === 'ReplicaSet')
1932
+ return inView.length > 0 && inView.every(isStandaloneReplicaSet)
1933
+ }, [visibleKinds, replicaSetsChosen, topologyMode, filterSidebarNodes])
1934
+ const sidebarKinds = useMemo(
1935
+ () => (replicaSetsShown && !visibleKinds.has('ReplicaSet') ? new Set<NodeKind>([...visibleKinds, 'ReplicaSet']) : visibleKinds),
1936
+ [replicaSetsShown, visibleKinds],
1937
+ )
1938
+
1864
1939
  // Cluster Audit findings, joined onto topology nodes by the audit key the
1865
1940
  // backend stamps on each node (data.auditKey). Only badge-worthy findings
1866
1941
  // reach the graph; the raw auditDanger/auditWarning property names remain at
@@ -1892,12 +1967,24 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1892
1967
  // collisions — rebuilding the string can't match those reliably.
1893
1968
  const selectedNodeId = useMemo(() => {
1894
1969
  if (!selectedResource) return undefined
1895
- const match = findSelectedTopologyNode(topology, selectedResource)
1970
+ const match = findSelectedTopologyNode(displayedTopology, selectedResource)
1896
1971
  return match?.id
1897
- }, [selectedResource, topology])
1972
+ }, [selectedResource, displayedTopology])
1898
1973
 
1899
1974
  // Filter handlers
1900
1975
  const handleToggleKind = useCallback((kind: NodeKind) => {
1976
+ if (kind === 'ReplicaSet') {
1977
+ // The toggle shows what's on screen: on while standalone ReplicaSets
1978
+ // show by default, so the first click hides them.
1979
+ setReplicaSetsChosen(true)
1980
+ setVisibleKinds(prev => {
1981
+ const next = new Set(prev)
1982
+ if (replicaSetsShown) next.delete(kind)
1983
+ else next.add(kind)
1984
+ return next
1985
+ })
1986
+ return
1987
+ }
1901
1988
  setVisibleKinds(prev => {
1902
1989
  const next = new Set(prev)
1903
1990
  if (next.has(kind)) {
@@ -1907,20 +1994,22 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1907
1994
  }
1908
1995
  return next
1909
1996
  })
1910
- }, [])
1997
+ }, [replicaSetsShown])
1911
1998
 
1912
1999
  const handleShowAllKinds = useCallback(() => {
1913
2000
  // Include all static kinds plus any dynamic CRD kinds from the topology
1914
2001
  const allKinds = new Set<NodeKind>(ALL_NODE_KINDS)
1915
- if (topology?.nodes) {
1916
- for (const node of topology.nodes) {
2002
+ if (displayedTopology?.nodes) {
2003
+ for (const node of displayedTopology.nodes) {
1917
2004
  allKinds.add(node.kind)
1918
2005
  }
1919
2006
  }
2007
+ setReplicaSetsChosen(true)
1920
2008
  setVisibleKinds(allKinds)
1921
- }, [topology])
2009
+ }, [displayedTopology])
1922
2010
 
1923
2011
  const handleHideAllKinds = useCallback(() => {
2012
+ setReplicaSetsChosen(true)
1924
2013
  setVisibleKinds(new Set())
1925
2014
  }, [])
1926
2015
 
@@ -1939,8 +2028,8 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
1939
2028
  scroll sideways at desktop width instead (see PHONE_READY_VIEWS). */}
1940
2029
  <div
1941
2030
  className={`relative flex bg-theme-base ${navCustomization.embedded ? 'h-full min-h-0' : 'h-screen'}`}
1942
- style={{ minWidth: isMobile && mainView === 'issues'
1943
- ? 0 // Issue rows adapt to the space beside the rail, even on a 360px phone.
2031
+ style={{ minWidth: investigationFillsHost || (isMobile && mainView === 'issues')
2032
+ ? 0 // Embedded investigations fill the host; mobile issue rows adapt beside the rail.
1944
2033
  : (isMobile ? 360 : 800) + (showNavRail ? (navRailEffectivePinned ? 176 : 56) : 0) }}
1945
2034
  >
1946
2035
  {showNavRail && (
@@ -2004,7 +2093,9 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2004
2093
  className={`block w-2.5 h-2.5 shrink-0 rounded-full ${
2005
2094
  clusterConnectionState === 'disconnected' || liveUpdatesDisconnected
2006
2095
  ? 'bg-red-500'
2007
- : clusterConnectionState === 'connecting' || crdDiscoveryStatus === 'discovering' || clusterLoadState.loading
2096
+ : apiUnreachable
2097
+ ? 'bg-amber-400'
2098
+ : clusterConnectionState === 'connecting' || crdDiscoveryStatus === 'discovering' || clusterLoadState.loading
2008
2099
  ? 'bg-amber-400 animate-pulse'
2009
2100
  : 'bg-green-500'
2010
2101
  }`}
@@ -2214,6 +2305,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2214
2305
 
2215
2306
  {dismissed && <p className="m-auto text-sm text-theme-text-secondary">{contextSwitch?.phase === 'stopping' ? 'Stopping the switch…' : 'The switch is still running. Resources will appear when the cluster is ready.'}</p>}
2216
2307
  {contentReady && <NoClusterAccessBanner />}
2308
+ {contentReady && connection.apiUnreachableSince && <APIUnreachableBanner since={connection.apiUnreachableSince} />}
2217
2309
  {/* Main content - only show when connected and authenticated */}
2218
2310
  {/* inert while a fullscreen detail overlay covers the views — keeps the
2219
2311
  retained background list out of the focus order + a11y tree (the visual
@@ -2241,10 +2333,9 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2241
2333
  {!viewsSyncGated && mainView === 'home' && (
2242
2334
  <HomeView
2243
2335
  namespaces={namespaces}
2244
- topology={topology}
2245
2336
  fallbackClusterLoadState={showHomeClusterLoadFallback ? clusterLoadState : undefined}
2246
2337
  onNavigateToView={setMainView}
2247
- onNavigateToIssue={takeover.issues ? undefined : (id) => setMainView('issues', { issue: id })}
2338
+ onNavigateToIssue={takeover.issues ? undefined : (issue) => setMainView('issues', { issue: issue.id, ...issueSubjectParams(issue) })}
2248
2339
  onNavigateToHelmRelease={navCustomization.embedded ? undefined : navigateToHelmRelease}
2249
2340
  onNavigateToManagerPath={navCustomization.embedded || takeover.gitops ? undefined : navigateToPath}
2250
2341
  // Upgrade impact lives under /checks, which a Cloud host takes
@@ -2300,7 +2391,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2300
2391
  {/* Topology view */}
2301
2392
  {!viewsSyncGated && mainView === 'topology' && (
2302
2393
  <>
2303
- {topology?.requiresNamespaceFilter && namespaces.length === 0 ? (
2394
+ {topologyStatus?.requiresNamespaceFilter && namespaces.length === 0 ? (
2304
2395
  /* Large cluster: prompt user to select a namespace */
2305
2396
  <div className="flex-1 flex items-center justify-center">
2306
2397
  <div className="max-w-md w-full mx-4 text-center">
@@ -2339,7 +2430,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2339
2430
  <div className={isMobile && !filterSidebarCollapsed ? 'absolute inset-y-0 left-0 z-20 flex shadow-theme-lg' : 'contents'}>
2340
2431
  <TopologyFilterSidebar
2341
2432
  nodes={filterSidebarNodes}
2342
- visibleKinds={visibleKinds}
2433
+ visibleKinds={sidebarKinds}
2343
2434
  onToggleKind={handleToggleKind}
2344
2435
  onShowAll={handleShowAllKinds}
2345
2436
  onHideAll={handleHideAllKinds}
@@ -2384,7 +2475,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2384
2475
  )}
2385
2476
  <TopologySearch
2386
2477
  nodes={filteredTopology?.nodes ?? []}
2387
- allNodes={topology?.nodes}
2478
+ allNodes={displayedTopology?.nodes}
2388
2479
  viewModeLabel={topologyMode === 'fleet' ? 'Fleet' : topologyMode === 'traffic' ? 'Network Flow' : 'Resources'}
2389
2480
  onNodeSelect={handleNodeClick}
2390
2481
  onZoomToNode={(id) => setTopologyFocus((prev) => ({ id, nonce: (prev?.nonce ?? 0) + 1 }))}
@@ -2449,7 +2540,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2449
2540
  initialViewMode={(searchParams.get('view') as 'list' | 'swimlane') || undefined}
2450
2541
  initialFilter={(searchParams.get('filter') as 'all' | 'changes' | 'k8s_events' | 'warnings' | 'unhealthy') || undefined}
2451
2542
  initialTimeRange={(searchParams.get('time') as '5m' | '30m' | '1h' | '6h' | '24h' | 'all') || undefined}
2452
- requiresNamespaceFilter={topology?.requiresNamespaceFilter && namespaces.length === 0}
2543
+ requiresNamespaceFilter={topologyStatus?.requiresNamespaceFilter && namespaces.length === 0}
2453
2544
  availableNamespaces={availableNamespaces}
2454
2545
  availableNamespacesError={availableNamespacesError?.message}
2455
2546
  onNamespaceSelect={(ns) => {
@@ -2499,12 +2590,12 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2499
2590
  // the inline workload selection so the app graph (not a second
2500
2591
  // detail panel) sits behind the peek. Search-only change keeps the
2501
2592
  // pathname — and thus the peek's owner-path — intact.
2502
- const params = new URLSearchParams(window.location.search)
2593
+ const params = new URLSearchParams(locationRef.current.search)
2503
2594
  if (params.has('workload') || params.has('tab') || params.has('run')) {
2504
2595
  params.delete('workload')
2505
2596
  params.delete('tab')
2506
2597
  params.delete('run')
2507
- navigate({ pathname: window.location.pathname, search: params.toString() }, { replace: true })
2598
+ navigate({ pathname: locationRef.current.pathname, search: params.toString() }, { replace: true })
2508
2599
  }
2509
2600
  navigateToResource(resource)
2510
2601
  }}
@@ -2602,7 +2693,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
2602
2693
  onNavigate={(res) => navigateToResource(res)}
2603
2694
  canCollapseToDrawer={!isMobile}
2604
2695
  onExpand={(res, opts) => {
2605
- const detailPath = resourceExpandedPath(res, connection.context || undefined, opts?.yaml ? 'yaml' : undefined)
2696
+ const detailPath = resourceExpandedPath(res, connection.context || undefined, opts?.yaml ? 'yaml' : undefined, { substrateWorkspace: hostFeatures.substrateWorkspace, kagentWorkspace: hostFeatures.kagentWorkspace })
2606
2697
  if (detailPath) {
2607
2698
  navigate(
2608
2699
  detailPath,
@@ -2786,6 +2877,7 @@ function App({ manageDocumentTitle = false, documentTitleSuffix, onClusterLoadSt
2786
2877
  <TerminalPreferences>
2787
2878
  <ConnectionProvider>
2788
2879
  <CapabilitiesProvider>
2880
+ <RegistryAccessModeProvider>
2789
2881
  <RadarUpgradeProvider>
2790
2882
  <ContextSwitchProvider>
2791
2883
  <DockProvider connectionId={connectionHeaderValue}>
@@ -2799,6 +2891,7 @@ function App({ manageDocumentTitle = false, documentTitleSuffix, onClusterLoadSt
2799
2891
  </DockProvider>
2800
2892
  </ContextSwitchProvider>
2801
2893
  </RadarUpgradeProvider>
2894
+ </RegistryAccessModeProvider>
2802
2895
  </CapabilitiesProvider>
2803
2896
  </ConnectionProvider>
2804
2897
  </TerminalPreferences>