@skyhook-io/radar-app 1.22.2 → 1.23.1

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 (228) hide show
  1. package/package.json +8 -8
  2. package/src/App.tsx +49 -13
  3. package/src/RadarApp.basename.test.tsx +177 -0
  4. package/src/RadarApp.settings.test.tsx +33 -0
  5. package/src/api/agentSandbox.ts +259 -0
  6. package/src/api/client.autoPromConnect.test.tsx +43 -0
  7. package/src/api/client.metricsRelayCheck.test.tsx +134 -0
  8. package/src/api/client.ts +151 -27
  9. package/src/api/client.updateResource.secretExpiry.test.tsx +47 -0
  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/poll.ts +78 -0
  15. package/src/api/prometheusCharts.ts +5 -0
  16. package/src/api/radarFeatures.test.ts +9 -0
  17. package/src/api/radarFeatures.ts +16 -0
  18. package/src/api/substrateWorkspace.test.ts +72 -0
  19. package/src/api/substrateWorkspace.ts +1394 -0
  20. package/src/api/vulnerabilities.ts +207 -9
  21. package/src/api/workloadSource.test.tsx +315 -0
  22. package/src/api/workloadSource.ts +128 -12
  23. package/src/components/CloudConnectFlow.tsx +46 -7
  24. package/src/components/CloudFunnelButton.test.tsx +193 -7
  25. package/src/components/CloudFunnelButton.tsx +128 -32
  26. package/src/components/SelfManagedStart.tsx +12 -2
  27. package/src/components/agentsandbox/AgentSandboxKindLists.tsx +41 -0
  28. package/src/components/agentsandbox/AgentSandboxLists.test.tsx +410 -0
  29. package/src/components/agentsandbox/AgentSandboxOverview.test.tsx +333 -0
  30. package/src/components/agentsandbox/AgentSandboxOverview.tsx +555 -0
  31. package/src/components/agentsandbox/AgentSandboxSidebar.test.tsx +97 -0
  32. package/src/components/agentsandbox/AgentSandboxSummary.test.tsx +439 -0
  33. package/src/components/agentsandbox/AgentSandboxSummary.tsx +956 -0
  34. package/src/components/agentsandbox/AgentSandboxTables.tsx +966 -0
  35. package/src/components/agentsandbox/AgentSandboxView.tsx +34 -0
  36. package/src/components/agentsandbox/agentsandbox.fixtures.ts +135 -0
  37. package/src/components/agentsandbox/data.ts +135 -0
  38. package/src/components/agentsandbox/host.test.ts +27 -0
  39. package/src/components/agentsandbox/host.tsx +85 -0
  40. package/src/components/agentsandbox/labels.test.ts +42 -0
  41. package/src/components/agentsandbox/labels.ts +146 -0
  42. package/src/components/agentsandbox/listFilters.ts +85 -0
  43. package/src/components/agentsandbox/lists.ts +52 -0
  44. package/src/components/agentsandbox/routes.ts +23 -0
  45. package/src/components/agentsandbox/shared.tsx +321 -0
  46. package/src/components/agentsandbox/useAgentSandboxSidebarWorkspace.ts +69 -0
  47. package/src/components/agentsandbox/workspace.fixtures.ts +125 -0
  48. package/src/components/agentsandbox/workspace.tsx +258 -0
  49. package/src/components/agentsandbox/workspaceRoute.ts +18 -0
  50. package/src/components/applications/ApplicationsView.openResource.test.tsx +248 -3
  51. package/src/components/applications/ApplicationsView.tsx +156 -3
  52. package/src/components/audit/VulnerabilitiesColumns.test.tsx +487 -0
  53. package/src/components/audit/VulnerabilitiesRisk.test.tsx +318 -0
  54. package/src/components/audit/VulnerabilitiesView.test.tsx +458 -13
  55. package/src/components/audit/VulnerabilitiesView.tsx +639 -199
  56. package/src/components/cloudHints/AgentSetupCloudRow.tsx +28 -0
  57. package/src/components/cloudHints/CloudHintLink.tsx +29 -0
  58. package/src/components/cloudHints/SharedInstallAiLine.tsx +36 -0
  59. package/src/components/cloudHints/cloudHints.test.ts +126 -0
  60. package/src/components/cloudHints/cloudHints.ts +131 -0
  61. package/src/components/cloudHints/cloudHintsGate.test.tsx +70 -0
  62. package/src/components/cloudHints/cloudLinks.test.ts +52 -0
  63. package/src/components/cloudHints/cloudLinks.ts +31 -0
  64. package/src/components/cloudHints/hintStorage.ts +28 -0
  65. package/src/components/cnpg/CNPGView.tsx +4 -7
  66. package/src/components/diagnose/AgentSetupNotice.tsx +5 -0
  67. package/src/components/diagnose/DiagnoseContext.tsx +7 -0
  68. package/src/components/diagnose/DiagnoseSurface.escape.test.tsx +215 -0
  69. package/src/components/diagnose/DiagnoseSurface.tsx +57 -1
  70. package/src/components/gitops/RemoteDestinationCloudHint.tsx +6 -14
  71. package/src/components/helm/HelmDrawerRouting.test.tsx +34 -1
  72. package/src/components/helm/HelmReleaseDrawer.tsx +6 -4
  73. package/src/components/helm/HelmView.tsx +4 -3
  74. package/src/components/helm/ObservedHelmNotice.tsx +39 -17
  75. package/src/components/helm/ObservedHelmRelease.test.tsx +62 -3
  76. package/src/components/helm/ObservedHelmReleaseDrawer.test.tsx +18 -0
  77. package/src/components/helm/ObservedHelmReleaseDrawer.tsx +4 -2
  78. package/src/components/home/HomeAgentBlock.tsx +2 -0
  79. package/src/components/home/HomeView.tsx +3 -3
  80. package/src/components/home/MCPSetupDialog.test.tsx +9 -0
  81. package/src/components/home/MCPSetupDialog.tsx +6 -2
  82. package/src/components/home/McpCloudLine.test.tsx +162 -0
  83. package/src/components/home/McpCloudLine.tsx +95 -0
  84. package/src/components/home/ProblemsPanel.investigate.test.tsx +2 -2
  85. package/src/components/home/mcpToolCatalog.test.ts +10 -0
  86. package/src/components/home/mcpToolCatalog.ts +4 -4
  87. package/src/components/issues/ClusterSchedulingBlockerRow.tsx +35 -0
  88. package/src/components/issues/IssuesPane.render.test.tsx +36 -1
  89. package/src/components/issues/IssuesPane.tsx +181 -23
  90. package/src/components/issues/SinceLastVisitRow.render.test.tsx +302 -0
  91. package/src/components/issues/SinceLastVisitRow.tsx +71 -0
  92. package/src/components/issues/sinceLastVisit.test.ts +266 -0
  93. package/src/components/issues/sinceLastVisit.ts +439 -0
  94. package/src/components/issues/uncheckedSources.test.ts +8 -0
  95. package/src/components/issues/uncheckedSources.ts +3 -0
  96. package/src/components/kagent/KagentAgentRenderer.test.ts +32 -0
  97. package/src/components/kagent/KagentAgentRenderer.tsx +87 -0
  98. package/src/components/kagent/KagentAgentSessions.test.tsx +166 -0
  99. package/src/components/kagent/KagentAgentSessions.tsx +124 -0
  100. package/src/components/kagent/KagentDetailPage.tsx +106 -0
  101. package/src/components/kagent/KagentLists.tsx +412 -0
  102. package/src/components/kagent/KagentOverview.tsx +234 -0
  103. package/src/components/kagent/KagentPages.tsx +690 -0
  104. package/src/components/kagent/KagentRuntimeTabs.test.tsx +219 -0
  105. package/src/components/kagent/KagentRuntimeTabs.tsx +283 -0
  106. package/src/components/kagent/KagentSidebar.test.tsx +112 -0
  107. package/src/components/kagent/KagentView.tsx +109 -0
  108. package/src/components/kagent/KagentWorkspace.test.tsx +876 -0
  109. package/src/components/kagent/host.tsx +144 -0
  110. package/src/components/kagent/routes.ts +31 -0
  111. package/src/components/kagent/shared.tsx +336 -0
  112. package/src/components/kagent/useKagentRuntime.test.tsx +77 -0
  113. package/src/components/kagent/useKagentSidebarWorkspace.ts +67 -0
  114. package/src/components/kagent/workspace.fixtures.ts +108 -0
  115. package/src/components/kagent/workspaceRoute.ts +18 -0
  116. package/src/components/nudges/activeNudges.test.ts +39 -0
  117. package/src/components/nudges/activeNudges.ts +76 -0
  118. package/src/components/poll/OssPoll.tsx +871 -0
  119. package/src/components/poll/mount.test.ts +12 -0
  120. package/src/components/poll/pollCloud.test.ts +23 -0
  121. package/src/components/poll/pollCloud.ts +6 -0
  122. package/src/components/poll/pollDefinition.ts +93 -0
  123. package/src/components/poll/pollFlow.test.ts +140 -0
  124. package/src/components/poll/pollFlow.ts +137 -0
  125. package/src/components/poll/pollSender.test.ts +137 -0
  126. package/src/components/poll/pollSender.ts +76 -0
  127. package/src/components/poll/pollStorage.test.ts +53 -0
  128. package/src/components/poll/pollStorage.ts +77 -0
  129. package/src/components/poll/round.json +350 -0
  130. package/src/components/product-hunt/ProductHuntNotice.tsx +2 -0
  131. package/src/components/resource/MetricsNotConnected.test.tsx +28 -0
  132. package/src/components/resource/MetricsNotConnected.tsx +10 -7
  133. package/src/components/resource/PrometheusCharts.tsx +10 -1
  134. package/src/components/resource/PrometheusChartsGrid.render.test.tsx +9 -0
  135. package/src/components/resource/PrometheusChartsGrid.tsx +3 -3
  136. package/src/components/resource/SubstrateHealthCharts.test.tsx +13 -1
  137. package/src/components/resource/SubstrateHealthCharts.tsx +9 -15
  138. package/src/components/resources/ImageFilesystemModal.test.tsx +21 -1
  139. package/src/components/resources/ImageFilesystemModal.tsx +42 -3
  140. package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
  141. package/src/components/resources/ResourcesView.tsx +24 -11
  142. package/src/components/resources/renderers/PodRenderer.tsx +8 -2
  143. package/src/components/settings/LocalIntegrationStatus.test.tsx +1 -0
  144. package/src/components/settings/LocalIntegrationStatus.tsx +3 -2
  145. package/src/components/settings/SettingsDialog.tsx +84 -16
  146. package/src/components/settings/SubstrateSettings.lifecycle.test.tsx +210 -0
  147. package/src/components/settings/SubstrateSettings.test.tsx +131 -0
  148. package/src/components/settings/SubstrateSettings.tsx +544 -0
  149. package/src/components/settings/settings-state.test.ts +21 -3
  150. package/src/components/settings/settings-state.ts +13 -3
  151. package/src/components/share/ShareLinkButton.test.tsx +360 -0
  152. package/src/components/share/ShareLinkButton.tsx +391 -0
  153. package/src/components/share/openShareInCloud.test.ts +29 -0
  154. package/src/components/share/openShareInCloud.ts +10 -0
  155. package/src/components/share/shareLink.test.ts +129 -0
  156. package/src/components/share/shareLink.ts +175 -0
  157. package/src/components/substrate/SubstrateActorDrawer.tsx +87 -0
  158. package/src/components/substrate/SubstrateActorOverview.tsx +489 -0
  159. package/src/components/substrate/SubstrateActorPage.tsx +384 -0
  160. package/src/components/substrate/SubstrateActors.test.tsx +1094 -0
  161. package/src/components/substrate/SubstrateActors.tsx +612 -0
  162. package/src/components/substrate/SubstrateAttentionList.tsx +441 -0
  163. package/src/components/substrate/SubstrateConnect.tsx +88 -0
  164. package/src/components/substrate/SubstrateOverview.test.tsx +396 -0
  165. package/src/components/substrate/SubstrateOverview.tsx +575 -0
  166. package/src/components/substrate/SubstratePages.test.tsx +478 -0
  167. package/src/components/substrate/SubstratePool.test.tsx +462 -0
  168. package/src/components/substrate/SubstratePoolPage.tsx +95 -0
  169. package/src/components/substrate/SubstratePoolSummary.tsx +485 -0
  170. package/src/components/substrate/SubstrateSidebar.test.tsx +101 -0
  171. package/src/components/substrate/SubstrateStateBar.tsx +63 -0
  172. package/src/components/substrate/SubstrateTemplates.tsx +376 -0
  173. package/src/components/substrate/SubstrateView.tsx +173 -0
  174. package/src/components/substrate/SubstrateWorkerPodContext.tsx +73 -0
  175. package/src/components/substrate/SubstrateWorkers.tsx +389 -0
  176. package/src/components/substrate/attention.ts +81 -0
  177. package/src/components/substrate/contextPin.tsx +69 -0
  178. package/src/components/substrate/host.tsx +83 -0
  179. package/src/components/substrate/kubectlTarget.test.tsx +77 -0
  180. package/src/components/substrate/readings.test.ts +484 -0
  181. package/src/components/substrate/readings.ts +997 -0
  182. package/src/components/substrate/routes.ts +103 -0
  183. package/src/components/substrate/shared.tsx +426 -0
  184. package/src/components/substrate/substrate.fixtures.ts +325 -0
  185. package/src/components/substrate/useSubstrateSidebarWorkspace.ts +87 -0
  186. package/src/components/substrate/workspaceRoute.ts +23 -0
  187. package/src/components/traffic/TrafficConnectionsTable.test.tsx +9 -0
  188. package/src/components/traffic/TrafficConnectionsTable.tsx +4 -2
  189. package/src/components/traffic/TrafficFilterSidebar.tsx +19 -14
  190. package/src/components/traffic/TrafficFlowList.test.tsx +63 -0
  191. package/src/components/traffic/TrafficFlowList.tsx +9 -5
  192. package/src/components/traffic/TrafficGraph.test.tsx +26 -0
  193. package/src/components/traffic/TrafficGraph.tsx +17 -14
  194. package/src/components/traffic/TrafficGraphTooLarge.tsx +2 -0
  195. package/src/components/traffic/TrafficGraphUnavailable.tsx +3 -1
  196. package/src/components/traffic/TrafficView.tsx +26 -56
  197. package/src/components/traffic/trafficFilters.test.ts +61 -1
  198. package/src/components/traffic/trafficFilters.ts +68 -8
  199. package/src/components/ui/UpdateNotification.tsx +2 -0
  200. package/src/components/usage-data/UsageDataPrompt.tsx +2 -0
  201. package/src/components/velero/VeleroOverview.tsx +2 -2
  202. package/src/components/velero/VeleroView.tsx +3 -6
  203. package/src/components/vulnerabilities/columns.tsx +132 -0
  204. package/src/components/vulnerabilities/filters.tsx +317 -0
  205. package/src/components/vulnerabilities/owner.test.ts +54 -0
  206. package/src/components/vulnerabilities/owner.tsx +163 -0
  207. package/src/components/vulnerabilities/parts.test.ts +126 -12
  208. package/src/components/vulnerabilities/parts.tsx +612 -52
  209. package/src/components/vulnerabilities/traffic.test.tsx +65 -0
  210. package/src/components/vulnerabilities/traffic.tsx +40 -0
  211. package/src/components/whats-new/WhatsNew.tsx +2 -0
  212. package/src/components/whats-new/releaseNotes.ts +75 -1
  213. package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
  214. package/src/components/workload/WorkloadView.tsx +52 -13
  215. package/src/components/workspace/layout.tsx +13 -7
  216. package/src/components/workspace/sidebar.test.ts +48 -0
  217. package/src/components/workspace/sidebar.ts +73 -3
  218. package/src/components/workspace/table.ts +2 -1
  219. package/src/contexts/RegistryAccessMode.test.tsx +51 -0
  220. package/src/contexts/RegistryAccessMode.tsx +25 -0
  221. package/src/integrations/resourceHost.ts +12 -6
  222. package/src/integrations/resourceHosts.test.tsx +27 -1
  223. package/src/integrations/resourceHosts.tsx +15 -7
  224. package/src/integrations/sidebarWorkspaces.test.tsx +63 -0
  225. package/src/integrations/sidebarWorkspaces.ts +41 -0
  226. package/src/integrations/workspaceRoute.ts +1 -1
  227. package/src/integrations/workspaceRoutes.ts +7 -1
  228. package/src/integrations/workspaceScreens.tsx +6 -0
@@ -6,6 +6,14 @@ import { DialogPortal } from '@skyhook-io/k8s-ui/components/ui/DialogPortal'
6
6
  import { Tooltip } from './ui/Tooltip'
7
7
  import { CloudConnectFlow } from './CloudConnectFlow'
8
8
  import { SelfManagedStart } from './SelfManagedStart'
9
+ import {
10
+ type CloudHintEntry,
11
+ type CloudHintSubject,
12
+ OPEN_CLOUD_FUNNEL_EVENT,
13
+ readOpenRequest,
14
+ withCloudHintEntry,
15
+ } from './cloudHints/cloudHints'
16
+ import { cloudResourceUrl } from './cloudHints/cloudLinks'
9
17
  import {
10
18
  type Handoff,
11
19
  exitFor,
@@ -64,15 +72,8 @@ const DEFAULT_ASSURANCES = [
64
72
  'SOC 2 Type II · SSO & SCIM on Enterprise',
65
73
  '3 clusters free, no card required',
66
74
  ]
67
- // Other OSS surfaces (a GitOps app that deploys to another cluster, say)
68
- // point at Radar Cloud by asking this button to open its dialog, so there
69
- // is one pitch and one flow. The button is mounted whenever Radar runs
70
- // standalone; embedded hosts never mount it and never dispatch this.
71
- const OPEN_EVENT = 'radar:open-cloud-funnel'
72
-
73
- export function openCloudFunnel() {
74
- window.dispatchEvent(new Event(OPEN_EVENT))
75
- }
75
+ // Other surfaces open this dialog through openCloudFunnel (see cloudHints).
76
+ export { openCloudFunnel } from './cloudHints/cloudHints'
76
77
  const ABOUT_URL = 'https://radarhq.io/about'
77
78
  const BENCHMARK_URL = 'https://radarhq.io/benchmark'
78
79
  const PRICING_URL = 'https://radarhq.io/pricing'
@@ -126,6 +127,11 @@ export function CloudFunnelButton() {
126
127
  // and is reset below when the kubeconfig context changes — it must never
127
128
  // describe a cluster the user has switched away from.
128
129
  const [handoff, setHandoff] = useState<Handoff | null>(null)
130
+ // Which in-context hint opened the dialog, and for a share the resource it
131
+ // was about. Both last for one open: the globe button, or the next hint,
132
+ // starts clean.
133
+ const [entry, setEntry] = useState<CloudHintEntry | null>(null)
134
+ const [subject, setSubject] = useState<CloudHintSubject | null>(null)
129
135
  const prepareFailed = handoff?.retryable ?? false
130
136
 
131
137
  const capabilities = useCapabilities()
@@ -138,7 +144,8 @@ export function CloudFunnelButton() {
138
144
  // the user opens; Radar sends nothing on its own. Only the blocked card may
139
145
  // deep-link the install page (see exitFor); the pitch buttons and the
140
146
  // footer link go to signup.
141
- const signupUrl = buildSignupUrl(appUrl, 'wizard-signup-button')
147
+ const tag = (url: string) => withCloudHintEntry(url, entry)
148
+ const signupUrl = tag(buildSignupUrl(appUrl, 'wizard-signup-button'))
142
149
 
143
150
  // Only while the dialog is open — never on the capabilities poll. The Hub
144
151
  // learns that someone opened it, which is congruent with what the dialog is
@@ -146,6 +153,7 @@ export function CloudFunnelButton() {
146
153
  const connectInfo = useCloudConnectInfo(capabilities.data?.cloudConnect?.apiUrl, open, {
147
154
  lane: pitchLane,
148
155
  mode: capabilities.data?.deployment?.mode,
156
+ entry,
149
157
  })
150
158
 
151
159
  // In-cluster Radar can't install its own connection, but it knows exactly
@@ -225,9 +233,12 @@ export function CloudFunnelButton() {
225
233
  // a running install. Toast explicitly on the paths that are failures.
226
234
  })
227
235
 
228
- const openModal = () => {
236
+ const openModal = (event?: Event) => {
237
+ const request = event ? readOpenRequest(event) : { entry: null, subject: null, view: 'pitch' }
238
+ setEntry(request.entry)
239
+ setSubject(request.subject)
229
240
  setOpen(true)
230
- setSelfManaged(false)
241
+ setSelfManaged(request.view === 'self-managed')
231
242
  setSeen(true)
232
243
  markSeen()
233
244
  // Re-open lands on a live flow if one is running.
@@ -284,8 +295,8 @@ export function CloudFunnelButton() {
284
295
  }
285
296
 
286
297
  useEffect(() => {
287
- window.addEventListener(OPEN_EVENT, openModal)
288
- return () => window.removeEventListener(OPEN_EVENT, openModal)
298
+ window.addEventListener(OPEN_CLOUD_FUNNEL_EVENT, openModal)
299
+ return () => window.removeEventListener(OPEN_CLOUD_FUNNEL_EVENT, openModal)
289
300
  })
290
301
 
291
302
  // Re-attach to a server-owned flow whenever one is observed while the modal
@@ -312,6 +323,28 @@ export function CloudFunnelButton() {
312
323
  // flashing at a connected cluster's operator before that answer arrives.
313
324
  if (!capabilities.data?.cloudConnect) return null
314
325
 
326
+ const tagExit = (exit: ReturnType<typeof exitFor>) => ({ ...exit, href: tag(exit.href) })
327
+ // Opened to share one resource: once Radar knows the Radar Cloud cluster
328
+ // (already connected, or connected just now), the main action goes straight
329
+ // to that resource in Cloud instead of the cluster's front page. Only when
330
+ // that Cloud cluster is the subject's own: the same name on another cluster
331
+ // is a different resource. clusterContext is where clusterUrl came from:
332
+ // discovery runs on the current context, but an install flow keeps the
333
+ // context it started on across a switch.
334
+ const intentAction = (
335
+ clusterUrl: string | undefined,
336
+ clusterContext: string | undefined,
337
+ ): { label: string; href: string } | null => {
338
+ if (!subject || !clusterUrl || !clusterContext) return null
339
+ if (subject.context !== clusterContext) return null
340
+ const href = cloudResourceUrl(clusterUrl, subject)
341
+ return href ? { label: `Open ${subject.name} in Radar Cloud`, href: tag(href) } : null
342
+ }
343
+ const connectedIntent = intentAction(alreadyConnected?.clusterUrl, contextName)
344
+ // The share body describes the subject's cluster while the footer connects
345
+ // the current one, so after a switch the dialog falls back to the pitch.
346
+ const shareSubject = subject && subject.context === contextName ? subject : null
347
+
315
348
  const showFlow = inFlowView && (blocked !== null || prepare.isPending || flowLive)
316
349
  // The prepare POST can take tens of seconds (chart download + preflight);
317
350
  // until the status poll observes the server-side flow, synthesize the
@@ -340,9 +373,10 @@ export function CloudFunnelButton() {
340
373
  disabled={open}
341
374
  >
342
375
  <button
343
- onClick={openModal}
376
+ onClick={() => openModal()}
344
377
  aria-label="Radar Cloud"
345
378
  aria-haspopup="dialog"
379
+ data-radar-cloud-button
346
380
  className="relative p-1.5 rounded-md bg-theme-elevated hover:bg-theme-hover text-theme-text-secondary hover:text-theme-text-primary transition-colors"
347
381
  >
348
382
  <Cloud className="w-4 h-4" />
@@ -375,7 +409,9 @@ export function CloudFunnelButton() {
375
409
  {/* Only the body scrolls on short viewports — the close control and
376
410
  the footer CTA stay pinned so they never scroll away. This matters
377
411
  more with the connect flow, whose plan card is the tallest state. */}
378
- {showFlow && flowForView ? (
412
+ {/* A request for the Self-Managed view wins over a hosted install in
413
+ progress; that install continues, and Back returns to it. */}
414
+ {!selfManaged && showFlow && flowForView ? (
379
415
  <div className="min-h-0 overflow-y-auto">
380
416
  <div className="px-8 pt-7">
381
417
  <Eyebrow />
@@ -383,7 +419,9 @@ export function CloudFunnelButton() {
383
419
  <CloudConnectFlow
384
420
  status={flowForView}
385
421
  blocked={blocked}
386
- exit={exitFor(appUrl, 'driver-blocked-card-browser-link', outcomeOf(flowForView), clusterInfo.data?.context)}
422
+ exit={tagExit(exitFor(appUrl, 'driver-blocked-card-browser-link', outcomeOf(flowForView), clusterInfo.data?.context))}
423
+ tagUrl={tag}
424
+ connectedAction={(connected) => intentAction(connected.clusterUrl, flowForView.plan?.contextName)}
387
425
  where={{ context: clusterInfo.data?.context, cluster: clusterInfo.data?.cluster }}
388
426
  onStatus={applyStatus}
389
427
  onExit={() => exitFlow(outcomeOf(flowForView))}
@@ -394,12 +432,16 @@ export function CloudFunnelButton() {
394
432
  <div className="shrink-0 px-8 pt-7">
395
433
  <Eyebrow />
396
434
  </div>
397
- <SelfManagedStart appUrl={appUrl} onBack={() => setSelfManaged(false)} />
435
+ <SelfManagedStart appUrl={appUrl} tagUrl={tag} onBack={() => setSelfManaged(false)} />
398
436
  </>
399
437
  ) : (
400
438
  <>
401
439
  <div className="min-h-0 overflow-y-auto">
402
- <PitchBody lane={pitchLane} freeTier={connectInfo.data?.freeTier} />
440
+ {shareSubject ? (
441
+ <ShareBody subject={shareSubject} connected={lane === 'driver' && !!alreadyConnected} />
442
+ ) : (
443
+ <PitchBody lane={pitchLane} freeTier={connectInfo.data?.freeTier} />
444
+ )}
403
445
  </div>
404
446
  <ModalFooter
405
447
  lane={lane}
@@ -407,18 +449,20 @@ export function CloudFunnelButton() {
407
449
  signupUrl={signupUrl}
408
450
  // One link name whether or not an attempt preceded the click; the
409
451
  // outcome, when present, is what says an attempt happened.
410
- driverBrowserUrl={buildSignupUrl(appUrl, 'driver-footer-browser-link', handoff)}
452
+ driverBrowserUrl={tag(buildSignupUrl(appUrl, 'driver-footer-browser-link', handoff))}
411
453
  prepareFailed={prepareFailed}
412
454
  // A prepare error's reason, kept on the pitch after its toast is gone.
413
455
  prepareError={handoff?.detail}
414
456
  assurances={connectInfo.data?.assurances}
415
457
  notice={connectInfo.data?.notice}
416
- self={inCluster ? self.data : undefined}
458
+ self={inCluster && self.data ? { ...self.data, wizardUrl: self.data.wizardUrl && tag(self.data.wizardUrl) } : undefined}
417
459
  clusterName={clusterInfo.data?.context}
418
- alreadyConnected={alreadyConnected}
460
+ alreadyConnected={alreadyConnected && { ...alreadyConnected, clusterUrl: alreadyConnected.clusterUrl && tag(alreadyConnected.clusterUrl) }}
461
+ connectedIntent={connectedIntent}
462
+ quiet={!!shareSubject}
419
463
  connectedCount={alreadyConnected ? (discovered.data?.connected.length ?? 0) : 0}
420
464
  discoverPending={discoverPending}
421
- clustersUrl={`${appUrl}/clusters`}
465
+ clustersUrl={tag(`${appUrl}/clusters`)}
422
466
  // Also covers the capabilities query: until it resolves, lane
423
467
  // defaults to wizard and Radar does not yet know it is
424
468
  // in-cluster, so the CTA would escape before classification.
@@ -481,6 +525,8 @@ function ModalFooter({
481
525
  connectedCount = 0,
482
526
  discoverPending = false,
483
527
  clustersUrl,
528
+ connectedIntent,
529
+ quiet = false,
484
530
  onConnect,
485
531
  onSelfManaged,
486
532
  onLater,
@@ -514,6 +560,12 @@ function ModalFooter({
514
560
  // The configured Hub's clusters list — where to look when an install's
515
561
  // settings say it is connected but not where.
516
562
  clustersUrl?: string
563
+ // Opened to share a resource and this cluster is already in Radar Cloud: go
564
+ // straight to that resource there.
565
+ connectedIntent?: { label: string; href: string } | null
566
+ // Opened to share one resource: the dialog stays about that, so it carries
567
+ // no assurance ticks.
568
+ quiet?: boolean
517
569
  onConnect: () => void
518
570
  onSelfManaged: () => void
519
571
  onLater: () => void
@@ -606,12 +658,12 @@ function ModalFooter({
606
658
  // Another Hub is named, not linked: the link would open ours.
607
659
  !alreadyConnected.hubHost && (
608
660
  <a
609
- href={alreadyConnected.clusterUrl || clustersUrl}
661
+ href={connectedIntent?.href ?? (alreadyConnected.clusterUrl || clustersUrl)}
610
662
  target="_blank"
611
663
  rel="noopener noreferrer"
612
664
  className="whitespace-nowrap px-6 py-2.5 rounded-[10px] bg-emerald-500 hover:bg-emerald-400 text-emerald-950 text-[14px] font-bold shadow-[0_0_22px_rgba(16,185,129,0.35)] hover:shadow-[0_0_30px_rgba(16,185,129,0.5)] hover:-translate-y-px transition-all"
613
665
  >
614
- {alreadyConnected.clusterUrl ? 'Open in Radar Cloud' : 'Open Radar Cloud'}
666
+ {connectedIntent?.label ?? (alreadyConnected.clusterUrl ? 'Open in Radar Cloud' : 'Open Radar Cloud')}
615
667
  </a>
616
668
  )
617
669
  ) : lane === 'driver' && clusterConnected ? (
@@ -688,14 +740,58 @@ function ModalFooter({
688
740
  share a single row with the other three at this width, and flex
689
741
  wrapping strands it as a 3+1 orphan. Two balanced columns read as a
690
742
  designed layout at any chip length the Hub sends. */}
691
- <div className="mt-5 grid grid-cols-2 gap-x-3 gap-y-2 text-[11px] text-theme-text-tertiary">
692
- {assuranceItems(assurances).map((item) => (
693
- <span key={item} className="flex items-center gap-1">
694
- <Check className="w-3 h-3 shrink-0 text-emerald-600 dark:text-emerald-400" />
695
- {item}
696
- </span>
697
- ))}
743
+ {!quiet && (
744
+ <div className="mt-5 grid grid-cols-2 gap-x-3 gap-y-2 text-[11px] text-theme-text-tertiary">
745
+ {assuranceItems(assurances).map((item) => (
746
+ <span key={item} className="flex items-center gap-1">
747
+ <Check className="w-3 h-3 shrink-0 text-emerald-600 dark:text-emerald-400" />
748
+ {item}
749
+ </span>
750
+ ))}
751
+ </div>
752
+ )}
753
+ </div>
754
+ )
755
+ }
756
+
757
+ // Opened to share one resource: the same dialog and footer, with a body about
758
+ // sharing it instead of the general pitch. It says where the link works and
759
+ // for whom, and nothing about how the connection works; the footer carries
760
+ // that for the lane.
761
+ function ShareBody({ subject, connected }: { subject: CloudHintSubject; connected: boolean }) {
762
+ const chips = [
763
+ `${subject.kind} ${subject.name}`,
764
+ subject.namespace ? `namespace ${subject.namespace}` : undefined,
765
+ subject.context,
766
+ ].filter((c): c is string => !!c)
767
+ return (
768
+ <div className="px-8 pt-7 pb-4">
769
+ <Eyebrow />
770
+ <h3 className="flex items-center gap-2.5 text-[20px] font-semibold leading-tight tracking-tight text-theme-text-primary mb-4">
771
+ <Users className="w-5 h-5 shrink-0 text-emerald-600 dark:text-emerald-400" />
772
+ {`Share ${subject.name} with your team`}
773
+ </h3>
774
+ <div className="card-inner p-3 mb-4">
775
+ <div className="text-[10.5px] font-semibold uppercase tracking-[0.08em] text-theme-text-tertiary mb-2">Resource</div>
776
+ <div className="flex flex-wrap gap-1.5">
777
+ {chips.map((chip) => (
778
+ <span key={chip} className="rounded-md bg-theme-elevated px-2 py-0.5 text-[12px] text-theme-text-primary">
779
+ {chip}
780
+ </span>
781
+ ))}
782
+ </div>
698
783
  </div>
784
+ <p className="text-[13.5px] leading-relaxed text-theme-text-secondary">
785
+ In <b className="font-semibold text-theme-text-primary">Radar Cloud</b>, anyone on your team can open this link. They see what
786
+ their RBAC allows.
787
+ </p>
788
+ {/* Sharing starts by connecting the whole cluster, so say what that keeps,
789
+ as the general pitch does. */}
790
+ {!connected && (
791
+ <p className="mt-2.5 text-[12.5px] leading-relaxed text-theme-text-tertiary">
792
+ Connecting the cluster lets Radar Cloud store its event history, changes and investigation results.
793
+ </p>
794
+ )}
699
795
  </div>
700
796
  )
701
797
  }
@@ -8,8 +8,18 @@ import { SELF_HOSTED_DOCS_URL, signupUrlFor } from './cloudConnectHandoff'
8
8
  // it themselves. The link carries intent=self-hosting: the Hub's sign-in page
9
9
  // repeats the steps and, after sign-up or sign-in, continues on its
10
10
  // Self-hosting page, where the trial, the license and the install command are.
11
- export function SelfManagedStart({ appUrl, onBack }: { appUrl: string; onBack: () => void }) {
12
- const signupUrl = `${signupUrlFor(appUrl, 'self-managed-signup')}&intent=self-hosting`
11
+ export function SelfManagedStart({
12
+ appUrl,
13
+ tagUrl = (url) => url,
14
+ onBack,
15
+ }: {
16
+ appUrl: string
17
+ // The dialog's own link tagging (which hint opened it), so this link says
18
+ // the same as the pitch's.
19
+ tagUrl?: (url: string) => string
20
+ onBack: () => void
21
+ }) {
22
+ const signupUrl = tagUrl(`${signupUrlFor(appUrl, 'self-managed-signup')}&intent=self-hosting`)
13
23
  const steps = [
14
24
  {
15
25
  title: 'Create your Radar Cloud account',
@@ -0,0 +1,41 @@
1
+ import { useMemo, type ComponentType } from 'react'
2
+ import type { HostKind, KindListProps } from '../../integrations/resourceHost'
3
+ import { useAPIResources } from '../../api/apiResources'
4
+ import { useRadarFeature } from '../../api/client'
5
+ import { useAgentSandboxWorkspace } from '../../api/agentSandbox'
6
+ import { serverReadings, type ServerReadings } from './labels'
7
+ import { agentSandboxDiscovered, useAgentSandboxLists, type AgentSandboxListKey } from './data'
8
+ import { SANDBOX_CLAIM_KIND, SANDBOX_KIND, SANDBOX_WARM_POOL_KIND } from './routes'
9
+ import { AgentSandboxGate, type AgentSandboxScreenProps } from './shared'
10
+ import { ClaimsScreen, SandboxesScreen, WarmPoolsScreen } from './AgentSandboxTables'
11
+
12
+ /**
13
+ * An Agent Sandbox kind's list on its Resources route, as Radar reads it
14
+ * rather than as a bare table, with the namespace filter applied. Rows open
15
+ * the Resources page's drawer.
16
+ */
17
+ function kindList(Screen: ComponentType<AgentSandboxScreenProps & { onCreate?: () => void; server?: ServerReadings }>, kind: HostKind, keys: readonly AgentSandboxListKey[]) {
18
+ return function AgentSandboxKindList({ namespaces, inspected, onInspect, onClearNamespaces, onCreate }: KindListProps) {
19
+ const { data: apiResources, isPending, isError } = useAPIResources()
20
+ const discovered = agentSandboxDiscovered(apiResources) || isError
21
+ const query = useAgentSandboxLists({ namespaces, apiResources, enabled: discovered })
22
+ // The server's summary (shared with the sidebar's badges) colors each row
23
+ // as its Needs attention row does and says which warm pools can't schedule
24
+ // their sandboxes; an older Radar has none, and the readings stand.
25
+ const { support } = useRadarFeature('agentSandboxWorkspace')
26
+ const summary = useAgentSandboxWorkspace(namespaces, { enabled: discovered && support !== 'unsupported' })
27
+ const attentionPending = support !== 'unsupported' && summary.isPending
28
+ const server = useMemo(() => serverReadings(summary.data), [summary.data])
29
+ return (
30
+ <div className="flex min-h-0 min-w-0 flex-1 flex-col bg-theme-base">
31
+ <AgentSandboxGate data={query.data} keys={keys} discoveryPending={isPending} discovered={discovered} isFetching={query.isFetching} refetch={query.refetch} refreshQueries={query.refreshQueries}>
32
+ <Screen data={query.data} namespaces={namespaces} onClearNamespaces={onClearNamespaces} onInspect={onInspect} inspected={inspected} onCreate={() => onCreate(kind)} server={server} attentionPending={attentionPending} />
33
+ </AgentSandboxGate>
34
+ </div>
35
+ )
36
+ }
37
+ }
38
+
39
+ export const SandboxesKindList = kindList(SandboxesScreen, SANDBOX_KIND, ['sandboxes'])
40
+ export const SandboxClaimsKindList = kindList(ClaimsScreen, SANDBOX_CLAIM_KIND, ['claims'])
41
+ export const SandboxWarmPoolsKindList = kindList(WarmPoolsScreen, SANDBOX_WARM_POOL_KIND, ['warmPools'])