@skyhook-io/radar-app 1.18.2 → 1.20.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 (228) hide show
  1. package/README.md +1 -1
  2. package/package.json +7 -7
  3. package/src/App.tsx +31 -6
  4. package/src/api/application-evidence.ts +63 -0
  5. package/src/api/argoSync.test.ts +22 -0
  6. package/src/api/client.audit-gating.test.tsx +48 -0
  7. package/src/api/client.kueuePosition.test.ts +32 -0
  8. package/src/api/client.kueueQueueWorkloads.test.tsx +71 -0
  9. package/src/api/client.resource-identity.test.ts +3 -0
  10. package/src/api/client.resourceIssues.test.tsx +239 -0
  11. package/src/api/client.resourcePath.test.ts +3 -0
  12. package/src/api/client.ts +285 -55
  13. package/src/api/config.ts +21 -0
  14. package/src/api/diagnose.test.ts +33 -2
  15. package/src/api/diagnose.ts +97 -3
  16. package/src/api/radarFeatures.render.test.tsx +33 -1
  17. package/src/api/radarFeatures.test.ts +47 -0
  18. package/src/api/radarFeatures.ts +41 -1
  19. package/src/api/rbac.settled.test.tsx +42 -0
  20. package/src/api/rbac.test.ts +18 -0
  21. package/src/api/rbac.ts +37 -7
  22. package/src/api/traffic.ts +9 -4
  23. package/src/api/usage-data.fixtures.ts +3 -1
  24. package/src/api/usage-data.test.tsx +134 -0
  25. package/src/api/usage-data.ts +35 -7
  26. package/src/api/workloadPodsPolling.test.ts +26 -0
  27. package/src/components/CloudConnectFlow.test.tsx +86 -0
  28. package/src/components/CloudConnectFlow.tsx +65 -27
  29. package/src/components/CloudFunnelButton.test.tsx +140 -5
  30. package/src/components/CloudFunnelButton.tsx +50 -9
  31. package/src/components/ConnectionErrorView.test.tsx +34 -0
  32. package/src/components/ConnectionErrorView.tsx +35 -11
  33. package/src/components/ContextSwitcher.tsx +5 -2
  34. package/src/components/SwitchAwareConnectionError.test.tsx +43 -0
  35. package/src/components/SwitchAwareConnectionError.tsx +85 -0
  36. package/src/components/application-evidence/ApplicationEvidenceAction.flow.test.tsx +234 -0
  37. package/src/components/application-evidence/ApplicationEvidenceAction.test.tsx +144 -0
  38. package/src/components/application-evidence/ApplicationEvidenceAction.tsx +218 -0
  39. package/src/components/capacity/CapacityDemand.tsx +3 -2
  40. package/src/components/capacity/demandSummary.test.ts +38 -0
  41. package/src/components/capacity/shared.tsx +12 -1
  42. package/src/components/cost/ApplicationCostTab.tsx +4 -0
  43. package/src/components/cost/CostTrendChart.tsx +2 -0
  44. package/src/components/cost/WorkloadCostTab.tsx +4 -0
  45. package/src/components/cost/source.test.ts +5 -0
  46. package/src/components/cost/source.ts +11 -0
  47. package/src/components/diagnose/AIMarkdown.tsx +4 -1
  48. package/src/components/diagnose/ActivityTurn.tsx +34 -14
  49. package/src/components/diagnose/AgentControls.tsx +53 -6
  50. package/src/components/diagnose/AgentSetupNotice.test.tsx +17 -0
  51. package/src/components/diagnose/AgentSetupNotice.tsx +22 -4
  52. package/src/components/diagnose/AgentSigninNotice.test.tsx +98 -0
  53. package/src/components/diagnose/AgentSigninNotice.tsx +61 -0
  54. package/src/components/diagnose/AnalysisStory.test.tsx +22 -0
  55. package/src/components/diagnose/AnalysisStory.tsx +17 -4
  56. package/src/components/diagnose/AssessmentCard.tsx +39 -8
  57. package/src/components/diagnose/ContinueInAgentButton.mounted.test.tsx +182 -0
  58. package/src/components/diagnose/ContinueInAgentButton.test.tsx +128 -0
  59. package/src/components/diagnose/ContinueInAgentButton.tsx +303 -0
  60. package/src/components/diagnose/DiagnoseContext.capacity.test.tsx +113 -0
  61. package/src/components/diagnose/DiagnoseContext.question.test.tsx +245 -0
  62. package/src/components/diagnose/DiagnoseContext.tsx +272 -10
  63. package/src/components/diagnose/DiagnoseSurface.test.tsx +54 -0
  64. package/src/components/diagnose/DiagnoseSurface.tsx +151 -134
  65. package/src/components/diagnose/EvidenceCard.tsx +67 -14
  66. package/src/components/diagnose/ExampleInvestigationLink.tsx +20 -0
  67. package/src/components/diagnose/Home.test.tsx +208 -5
  68. package/src/components/diagnose/Home.tsx +187 -36
  69. package/src/components/diagnose/InvestigationCapacityNotice.test.tsx +246 -0
  70. package/src/components/diagnose/InvestigationCapacityNotice.tsx +241 -0
  71. package/src/components/diagnose/InvestigationEvidencePane.story.test.tsx +97 -6
  72. package/src/components/diagnose/InvestigationEvidencePane.test.tsx +57 -0
  73. package/src/components/diagnose/InvestigationEvidencePane.tsx +59 -11
  74. package/src/components/diagnose/InvestigationEvidenceSections.tsx +50 -23
  75. package/src/components/diagnose/InvestigationView.tsx +249 -54
  76. package/src/components/diagnose/LocalDiagnoseAction.history.test.tsx +450 -0
  77. package/src/components/diagnose/LocalDiagnoseAction.tsx +365 -39
  78. package/src/components/diagnose/NextStepJump.test.tsx +92 -0
  79. package/src/components/diagnose/NextStepJump.tsx +75 -0
  80. package/src/components/diagnose/QuestionComposer.test.tsx +553 -0
  81. package/src/components/diagnose/QuestionComposer.tsx +495 -0
  82. package/src/components/diagnose/QuestionFocus.test.tsx +38 -0
  83. package/src/components/diagnose/QuestionFocus.tsx +123 -0
  84. package/src/components/diagnose/ResourcePicker.tsx +206 -0
  85. package/src/components/diagnose/StoryExcerpt.tsx +12 -3
  86. package/src/components/diagnose/assessmentCopy.ts +5 -0
  87. package/src/components/diagnose/exampleInvestigation.events.json +191 -0
  88. package/src/components/diagnose/exampleInvestigation.loadFailure.test.tsx +94 -0
  89. package/src/components/diagnose/exampleInvestigation.test.tsx +248 -0
  90. package/src/components/diagnose/exampleInvestigation.ts +121 -0
  91. package/src/components/diagnose/investigationCase.runs.test.tsx +328 -0
  92. package/src/components/diagnose/investigationCase.test.tsx +9 -1
  93. package/src/components/diagnose/investigationCase.ts +33 -1
  94. package/src/components/diagnose/investigationEvidence/adapters/applicationFindings.test.ts +739 -0
  95. package/src/components/diagnose/investigationEvidence/adapters/coverage.test.tsx +46 -0
  96. package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +58 -2
  97. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +9 -0
  98. package/src/components/diagnose/investigationEvidence/adapters/posture.ts +29 -1
  99. package/src/components/diagnose/investigationEvidence/adapters/prometheus.test.ts +40 -0
  100. package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +27 -1
  101. package/src/components/diagnose/investigationEvidence/bodies/metrics.test.tsx +111 -0
  102. package/src/components/diagnose/investigationEvidence/bodies/metrics.tsx +67 -16
  103. package/src/components/diagnose/investigationEvidence/builder.ts +30 -0
  104. package/src/components/diagnose/investigationEvidence/excerpt.test.ts +18 -5
  105. package/src/components/diagnose/investigationEvidence/excerpt.ts +22 -11
  106. package/src/components/diagnose/investigationEvidence/index.ts +1 -1
  107. package/src/components/diagnose/investigationEvidence/navigation.tsx +2 -0
  108. package/src/components/diagnose/investigationEvidence/observations.ts +121 -2
  109. package/src/components/diagnose/investigationEvidence/projection.test.ts +85 -3
  110. package/src/components/diagnose/investigationEvidence/types.ts +7 -0
  111. package/src/components/diagnose/investigationEvidencePartition.ts +6 -1
  112. package/src/components/diagnose/investigationFocus.test.ts +271 -0
  113. package/src/components/diagnose/investigationFocus.ts +132 -0
  114. package/src/components/diagnose/investigationState.ts +28 -0
  115. package/src/components/diagnose/lastInvestigation.test.ts +95 -0
  116. package/src/components/diagnose/lastInvestigation.ts +58 -0
  117. package/src/components/diagnose/launch.test.ts +125 -1
  118. package/src/components/diagnose/launch.ts +57 -10
  119. package/src/components/diagnose/parts.test.tsx +20 -0
  120. package/src/components/diagnose/questionSuggestions.test.ts +111 -0
  121. package/src/components/diagnose/questionSuggestions.ts +150 -0
  122. package/src/components/diagnose/storyParts.test.tsx +13 -0
  123. package/src/components/diagnose/target.test.ts +143 -2
  124. package/src/components/diagnose/target.ts +109 -7
  125. package/src/components/diagnose/testdata/story-runs.json +474 -0
  126. package/src/components/diagnose/toolCallLabel.test.ts +10 -4
  127. package/src/components/diagnose/verdictText.test.tsx +87 -0
  128. package/src/components/diagnose/verdictText.ts +68 -0
  129. package/src/components/execution/BatchExecutionView.tsx +24 -11
  130. package/src/components/execution/JobSetAdmission.test.tsx +42 -0
  131. package/src/components/execution/JobSetAdmission.tsx +18 -3
  132. package/src/components/execution/JobSetMemberComparison.tsx +2 -1
  133. package/src/components/execution/runState.test.ts +14 -0
  134. package/src/components/execution/runState.ts +8 -0
  135. package/src/components/gitops/GitOpsView.rollbackGate.test.tsx +202 -0
  136. package/src/components/gitops/GitOpsView.syncRequest.test.tsx +369 -0
  137. package/src/components/gitops/GitOpsView.tsx +86 -17
  138. package/src/components/gitops/RemoteDestinationCloudHint.tsx +2 -3
  139. package/src/components/gitops/destination-toast.test.ts +1 -1
  140. package/src/components/gitops/destination-toast.ts +2 -2
  141. package/src/components/home/ClusterHealthCard.tsx +13 -39
  142. package/src/components/home/HomeAgentBlock.test.tsx +141 -0
  143. package/src/components/home/HomeAgentBlock.tsx +103 -0
  144. package/src/components/home/HomeDiagramCard.tsx +47 -0
  145. package/src/components/home/HomeView.tsx +86 -47
  146. package/src/components/home/MCPSetupDialog.test.tsx +95 -5
  147. package/src/components/home/MCPSetupDialog.tsx +30 -5
  148. package/src/components/home/ProblemsPanel.investigate.test.tsx +171 -0
  149. package/src/components/home/ProblemsPanel.test.tsx +3 -1
  150. package/src/components/home/RadarVersionLine.test.tsx +0 -14
  151. package/src/components/home/RadarVersionLine.tsx +3 -28
  152. package/src/components/home/TopologyPreview.test.tsx +73 -0
  153. package/src/components/home/TopologyPreview.tsx +120 -233
  154. package/src/components/home/TrafficSummary.test.tsx +63 -0
  155. package/src/components/home/TrafficSummary.tsx +135 -138
  156. package/src/components/home/mcpToolCatalog.ts +23 -10
  157. package/src/components/issues/IssuesPane.test.ts +11 -0
  158. package/src/components/issues/IssuesPane.tsx +15 -5
  159. package/src/components/issues/uncheckedSources.test.ts +20 -1
  160. package/src/components/issues/uncheckedSources.ts +18 -0
  161. package/src/components/kueue/KueuePendingPosition.tsx +35 -0
  162. package/src/components/kueue/useRelatedObjects.test.tsx +219 -0
  163. package/src/components/kueue/useRelatedReads.test.ts +56 -0
  164. package/src/components/kueue/useRelatedReads.ts +205 -0
  165. package/src/components/logs/MultiPodLogsTab.test.tsx +93 -0
  166. package/src/components/logs/MultiPodLogsTab.tsx +120 -0
  167. package/src/components/logs/PodLogsUnavailable.test.tsx +18 -0
  168. package/src/components/logs/PodLogsUnavailable.tsx +21 -0
  169. package/src/components/logs/RayClusterLogsTab.reselect.test.tsx +67 -0
  170. package/src/components/logs/RayClusterLogsTab.test.tsx +167 -0
  171. package/src/components/logs/RayClusterLogsTab.tsx +109 -0
  172. package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +3 -2
  173. package/src/components/logs/rayClusterPods.ts +32 -0
  174. package/src/components/outageSince.test.ts +21 -0
  175. package/src/components/outageSince.ts +10 -0
  176. package/src/components/resource/PrometheusCharts.overlays.test.ts +12 -0
  177. package/src/components/resource/PrometheusCharts.tsx +3 -40
  178. package/src/components/resources/crd/CRDSchemaTab.test.tsx +28 -0
  179. package/src/components/resources/crd/CRDSchemaTab.tsx +13 -0
  180. package/src/components/resources/crd/host.tsx +14 -0
  181. package/src/components/resources/renderers/CustomResourceDefinitionRenderer.test.tsx +27 -0
  182. package/src/components/resources/renderers/CustomResourceDefinitionRenderer.tsx +12 -0
  183. package/src/components/resources/renderers/JobAdmissionRenderers.test.tsx +4 -1
  184. package/src/components/resources/renderers/JobAdmissionRenderers.tsx +4 -3
  185. package/src/components/resources/renderers/KueueHostRenderers.test.tsx +117 -0
  186. package/src/components/resources/renderers/KueueQueueRenderers.test.tsx +97 -0
  187. package/src/components/resources/renderers/KueueQueueRenderers.tsx +139 -0
  188. package/src/components/resources/renderers/KueueWorkloadRenderer.test.tsx +7 -1
  189. package/src/components/resources/renderers/KueueWorkloadRenderer.tsx +47 -7
  190. package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.test.tsx +67 -0
  191. package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.tsx +31 -0
  192. package/src/components/resources/renderers/RayClusterRenderer.test.tsx +81 -3
  193. package/src/components/resources/renderers/RayClusterRenderer.tsx +19 -4
  194. package/src/components/traffic/TrafficView.tsx +3 -3
  195. package/src/components/ui/Omnibar.investigate.test.tsx +105 -0
  196. package/src/components/ui/Omnibar.tsx +47 -3
  197. package/src/components/ui/RadarOmnibar.test.tsx +1 -0
  198. package/src/components/ui/RadarOmnibar.tsx +11 -0
  199. package/src/components/ui/command-items-crd.test.tsx +23 -0
  200. package/src/components/ui/command-items.ts +2 -1
  201. package/src/components/useContextSwitchFlow.test.tsx +61 -0
  202. package/src/components/useContextSwitchFlow.tsx +21 -4
  203. package/src/components/whats-new/WhatsNew.test.ts +10 -3
  204. package/src/components/whats-new/WhatsNew.tsx +5 -1
  205. package/src/components/whats-new/WhatsNewDialog.test.tsx +18 -4
  206. package/src/components/whats-new/releaseNotes.ts +136 -4
  207. package/src/components/workload/RelatedFindingsSection.test.tsx +126 -0
  208. package/src/components/workload/RelatedFindingsSection.tsx +80 -0
  209. package/src/components/workload/WorkloadView.test.ts +10 -1
  210. package/src/components/workload/WorkloadView.tsx +85 -98
  211. package/src/components/workload/issueResourceOpener.test.ts +20 -0
  212. package/src/components/workload/issueResourceOpener.ts +17 -0
  213. package/src/context/ConnectionContext.tsx +133 -60
  214. package/src/context/ConnectionProvider.retry.test.tsx +176 -0
  215. package/src/context/ContextSwitchContext.tsx +14 -1
  216. package/src/context/DiagnoseCustomization.tsx +3 -0
  217. package/src/context/clusterConnected.ts +10 -0
  218. package/src/contexts/CapabilitiesContext.tsx +6 -4
  219. package/src/hooks/useAgentSignin.test.tsx +190 -0
  220. package/src/hooks/useAgentSignin.ts +160 -0
  221. package/src/hooks/useApproveAfterSignin.test.tsx +108 -0
  222. package/src/hooks/useElementSize.ts +30 -0
  223. package/src/integrations/resourceHost.test.tsx +1 -0
  224. package/src/integrations/resourceHost.ts +5 -1
  225. package/src/integrations/resourceHosts.test.tsx +21 -4
  226. package/src/integrations/resourceHosts.tsx +12 -0
  227. package/src/main.tsx +5 -0
  228. package/src/utils/related-findings.ts +46 -0
@@ -1,3 +1,4 @@
1
+ import { resourceSearchAliases } from "@skyhook-io/k8s-ui/utils/api-resources";
1
2
  import { useMemo } from "react";
2
3
  import {
3
4
  Home,
@@ -184,7 +185,7 @@ export function useCommandItems(cb: CommandItemCallbacks): CommandItem[] {
184
185
  category: "Resource Kinds",
185
186
  icon: getResourceIcon(r.kind),
186
187
  action: () => cb.onNavigateKind(r.name, r.group),
187
- searchTerms: [r.name, r.kind],
188
+ searchTerms: [r.name, r.kind, ...resourceSearchAliases(r)],
188
189
  priorityBonus: groupPriorityBonus(r.group),
189
190
  });
190
191
  }
@@ -0,0 +1,61 @@
1
+ // @vitest-environment jsdom
2
+ import { act } from 'react'
3
+ import { createRoot, type Root } from 'react-dom/client'
4
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
5
+ import type { ContextInfo } from '../types'
6
+
7
+ const mocks = vi.hoisted(() => ({
8
+ mutateAsync: vi.fn(),
9
+ setFailedSwitch: vi.fn(),
10
+ startSwitch: vi.fn(),
11
+ }))
12
+ vi.mock('../api/client', () => ({
13
+ useSwitchContext: () => ({ mutateAsync: mocks.mutateAsync, isPending: false, isError: false, error: null }),
14
+ fetchSessionCounts: async () => ({ portForwards: 0 }),
15
+ SwitchContextError: class extends Error {},
16
+ }))
17
+ vi.mock('../context/ContextSwitchContext', () => ({
18
+ useContextSwitch: () => ({
19
+ startSwitch: mocks.startSwitch,
20
+ endSwitch: vi.fn(),
21
+ setOpenAfterSwitch: vi.fn(),
22
+ setFailedSwitch: mocks.setFailedSwitch,
23
+ }),
24
+ }))
25
+ vi.mock('./ui/Toast', () => ({ useToast: () => ({ showError: vi.fn() }) }))
26
+ vi.mock('./dock', () => ({ useDock: () => ({ tabs: [] }) }))
27
+
28
+ const { useContextSwitchFlow } = await import('./useContextSwitchFlow')
29
+
30
+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true })
31
+ let root: Root
32
+ const seen = vi.fn<(flow: ReturnType<typeof useContextSwitchFlow>) => void>()
33
+ const flow = () => seen.mock.lastCall![0]
34
+
35
+ function Probe() {
36
+ seen(useContextSwitchFlow())
37
+ return null
38
+ }
39
+
40
+ beforeEach(() => {
41
+ vi.clearAllMocks()
42
+ root = createRoot(document.createElement('div'))
43
+ act(() => root.render(<Probe />))
44
+ })
45
+ afterEach(() => act(() => root.unmount()))
46
+
47
+ const ctx = (name: string, isCurrent: boolean) => ({ name, cluster: name, user: 'u', namespace: '', isCurrent }) as ContextInfo
48
+
49
+ describe('useContextSwitchFlow', () => {
50
+ it('picking the cluster you are still on dismisses a refused switch without switching', async () => {
51
+ await act(() => flow().requestSwitch(ctx('current', true)))
52
+ expect(mocks.setFailedSwitch).toHaveBeenCalledWith(null)
53
+ expect(mocks.startSwitch).not.toHaveBeenCalled()
54
+ expect(mocks.mutateAsync).not.toHaveBeenCalled()
55
+ })
56
+
57
+ it('picking another cluster still switches', async () => {
58
+ await act(() => flow().requestSwitch(ctx('staging', false)))
59
+ expect(mocks.mutateAsync).toHaveBeenCalledWith({ name: 'staging' })
60
+ })
61
+ })
@@ -1,7 +1,7 @@
1
1
  import { useState, type ReactNode } from 'react'
2
2
  import { AlertTriangle } from 'lucide-react'
3
3
  import { pluralize } from '@skyhook-io/k8s-ui'
4
- import { useSwitchContext, fetchSessionCounts, type SessionCounts } from '../api/client'
4
+ import { useSwitchContext, fetchSessionCounts, SwitchContextError, type SessionCounts } from '../api/client'
5
5
  import { useContextSwitch } from '../context/ContextSwitchContext'
6
6
  import { useToast } from './ui/Toast'
7
7
  import { useDock } from './dock'
@@ -13,6 +13,12 @@ function shouldSuppressSwitchErrorToast(error: unknown): boolean {
13
13
  return message.includes('cluster connection failed:')
14
14
  }
15
15
 
16
+ // A switch the server refused before leaving the current cluster, because the
17
+ // new one didn't answer. Those show the full connection error screen.
18
+ function refusedBeforeLeaving(error: unknown): error is SwitchContextError & { errorType: string } {
19
+ return error instanceof SwitchContextError && !!error.errorType
20
+ }
21
+
16
22
  interface PendingSwitch {
17
23
  context: ContextInfo
18
24
  openAfter?: SelectedResource
@@ -24,7 +30,7 @@ interface PendingSwitch {
24
30
  // live. Callers render `confirmDialog`.
25
31
  export function useContextSwitchFlow() {
26
32
  const switchContext = useSwitchContext()
27
- const { startSwitch, endSwitch, setOpenAfterSwitch } = useContextSwitch()
33
+ const { startSwitch, endSwitch, setOpenAfterSwitch, setFailedSwitch } = useContextSwitch()
28
34
  const { showError } = useToast()
29
35
  const { tabs } = useDock()
30
36
  const [pending, setPending] = useState<PendingSwitch | null>(null)
@@ -48,7 +54,9 @@ export function useContextSwitchFlow() {
48
54
  endSwitch()
49
55
  // Backend may not transition to StateDisconnected on client-side errors
50
56
  // (network, timeout) — without this toast the user gets no feedback.
51
- if (!shouldSuppressSwitchErrorToast(error)) {
57
+ if (refusedBeforeLeaving(error)) {
58
+ setFailedSwitch({ context: context.name, error: error.message, errorType: error.errorType })
59
+ } else if (!shouldSuppressSwitchErrorToast(error)) {
52
60
  const message = error instanceof Error ? error.message : 'Unknown error'
53
61
  showError('Failed to switch context', message)
54
62
  }
@@ -56,7 +64,12 @@ export function useContextSwitchFlow() {
56
64
  }
57
65
 
58
66
  const requestSwitch = async (context: ContextInfo, openAfter?: SelectedResource) => {
59
- if (context.isCurrent || switchContext.isPending) return
67
+ if (switchContext.isPending) return
68
+ // Picking the cluster you're still on dismisses a refused switch's screen.
69
+ if (context.isCurrent) {
70
+ setFailedSwitch(null)
71
+ return
72
+ }
60
73
  // Active sessions (port forwards from API + terminal tabs from dock) get
61
74
  // a confirmation prompt — switching contexts kills both.
62
75
  try {
@@ -142,6 +155,10 @@ export function useContextSwitchFlow() {
142
155
  requestSwitch,
143
156
  isPending: switchContext.isPending,
144
157
  error: switchContext.isError ? switchContext.error : null,
158
+ // The picker's inline line is for failures that don't get the full screen.
159
+ errorText: switchContext.isError && switchContext.error && !refusedBeforeLeaving(switchContext.error)
160
+ ? switchContext.error.message
161
+ : null,
145
162
  confirmDialog,
146
163
  }
147
164
  }
@@ -95,17 +95,24 @@ describe('composeReleaseNotes', () => {
95
95
 
96
96
  it('turns highlights past the cards into lines ahead of the improvements, within the line cap', () => {
97
97
  const notes = composeReleaseNotes([
98
- entry('v1.16.0', [7, 7, 7, 7, 7, 2], ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']),
98
+ entry('v1.16.0', [7, 7, 7, 7, 7, 7, 7, 2], ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']),
99
99
  entry('v1.15.0', [1], ['old']),
100
100
  ])
101
101
  expect(notes.highlights).toHaveLength(MAX_CARDS)
102
102
  expect(notes.lines).toHaveLength(MAX_LINES)
103
- expect(notes.lines.slice(0, 2).map(l => l.text)).toEqual(['v1.16.0-5', 'v1.15.0-0'])
103
+ expect(notes.lines.slice(0, 2).map(l => l.text)).toEqual(['v1.16.0-7', 'v1.15.0-0'])
104
104
  expect(notes.lines.map(l => l.text)).not.toContain('old')
105
105
  })
106
106
 
107
- it('scores the dialog by the cards it shows', () => {
107
+ it('scores the dialog by the strongest cards it shows', () => {
108
108
  expect(composeReleaseNotes([entry('v1.16.0', [4, 4, 4, 4, 4, 10])]).score).toBe(10 + 4 * 4)
109
+ expect(composeReleaseNotes([entry('v1.16.0', [5, 3, 3, 3, 3, 3, 3])]).score).toBe(5 + 3 * 4)
110
+ })
111
+
112
+ it("doesn't count cards past the strongest five toward opening", () => {
113
+ const notes = composeReleaseNotes([entry('v1.16.0', [4, 4, 4, 4, 4, 4, 4])])
114
+ expect(notes.highlights).toHaveLength(MAX_CARDS)
115
+ expect(notes.score).toBeLessThan(AUTO_OPEN_SCORE)
109
116
  })
110
117
  })
111
118
 
@@ -19,6 +19,7 @@ import {
19
19
  type ComposedHighlight,
20
20
  type ComposedNotes,
21
21
  type ReleaseNotes,
22
+ MAX_CARDS,
22
23
  } from './releaseNotes'
23
24
  import type { UsageDataStatus } from '../../api/usage-data'
24
25
  import { UsageDataAsk } from '../usage-data/UsageDataAsk'
@@ -276,8 +277,11 @@ export function WhatsNew({ onNavigate, usageData }: WhatsNewProps) {
276
277
 
277
278
  if (isCloud) return null
278
279
 
280
+ // A full grid wraps most descriptions a line longer at the default width.
281
+ const width = view?.notes.highlights.length === MAX_CARDS ? 'w-[840px]' : 'w-[760px]'
282
+
279
283
  return (
280
- <DialogPortal open={open} onClose={close} ariaLabelledBy={titleId} className="w-[760px] max-w-[calc(100vw-2rem)] max-h-[min(840px,calc(100vh-4rem))] flex flex-col overflow-hidden rounded-xl">
284
+ <DialogPortal open={open} onClose={close} ariaLabelledBy={titleId} className={clsx(width, 'max-w-[calc(100vw-2rem)] max-h-[min(980px,calc(100vh-4rem))] flex flex-col overflow-hidden rounded-xl')}>
281
285
  {view && (
282
286
  <WhatsNewContent
283
287
  titleId={titleId}
@@ -7,7 +7,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
7
7
  import { Megaphone } from 'lucide-react'
8
8
  import type { WhatsNewState } from '../../api/client'
9
9
  import { openWhatsNew, useWhatsNewStatus, WhatsNew } from './WhatsNew'
10
- import { RELEASE_NOTES, type ReleaseNotes } from './releaseNotes'
10
+ import { MAX_CARDS, RELEASE_NOTES, type ReleaseNotes } from './releaseNotes'
11
11
 
12
12
  Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true })
13
13
 
@@ -275,6 +275,20 @@ describe('WhatsNew', () => {
275
275
  expect(status.current.unread).toBe(true)
276
276
  })
277
277
 
278
+ it('widens the dialog only for a full set of cards', async () => {
279
+ serverState = { currentVersion: 'v1.15.0', storage: 'server', seenVersion: 'v1.14.1', priorInstall: true }
280
+ await render('/')
281
+ expect(document.querySelector('.w-\\[760px\\]')).not.toBeNull()
282
+ expect(document.querySelector('.w-\\[840px\\]')).toBeNull()
283
+ })
284
+
285
+ it('gives a full set of cards the wider dialog', async () => {
286
+ setCatalog({ ...HEADLINE, highlights: Array.from({ length: MAX_CARDS }, (_, i) => card(`card-${i}`, `Card ${i}`, 9)) })
287
+ serverState = { currentVersion: 'v1.15.0', storage: 'server', seenVersion: 'v1.14.1', priorInstall: true }
288
+ await render('/')
289
+ expect(document.querySelector('.w-\\[840px\\]')).not.toBeNull()
290
+ })
291
+
278
292
  it('composes the releases a user skipped, leading with the strongest', async () => {
279
293
  setCatalog(HEADLINE, QUIET)
280
294
  serverState = { currentVersion: 'v1.16.0', storage: 'server', seenVersion: 'v1.14.1', priorInstall: true }
@@ -300,11 +314,11 @@ describe('WhatsNew', () => {
300
314
  expect(seenPosts).toEqual([])
301
315
  })
302
316
 
303
- it.each(['', '=v1.18', '=1.18', '=v1.18.0'])('previews v1.18 on a Git development build with ?whats-new%s', async suffix => {
317
+ it.each(['', '=v1.20', '=1.20', '=v1.20.0'])('previews v1.20 on a Git development build with ?whats-new%s', async suffix => {
304
318
  setCatalog(...SHIPPED)
305
- serverState = { currentVersion: 'v1.17.0-113-gb49561b78', storage: 'server', seenVersion: 'v1.17.0', priorInstall: true }
319
+ serverState = { currentVersion: 'v1.18.0-113-gb49561b78', storage: 'server', seenVersion: 'v1.18.0', priorInstall: true }
306
320
  await render(`/resources/pods?whats-new${suffix}`)
307
- expect(dialog()?.textContent).toContain("What's new in Radar v1.18")
321
+ expect(dialog()?.textContent).toContain("What's new in Radar v1.20")
308
322
  expect(dialog()?.textContent).toContain(SHIPPED[0].highlights[0].title)
309
323
  await clickGotIt()
310
324
  expect(seenPosts).toEqual([])
@@ -1,5 +1,5 @@
1
1
  import type { LucideIcon } from 'lucide-react'
2
- import { Bot, Database, GitCompareArrows, HardDrive, Hourglass, Layers, Network, RefreshCcw, Scale, ScrollText, Search, SlidersHorizontal, Undo2 } from 'lucide-react'
2
+ import { Activity, BellOff, Bot, Boxes, Braces, Database, GitCompareArrows, HardDrive, Hourglass, Layers, MessageCircleQuestionMark, Network, RefreshCcw, Scale, ScanSearch, ScrollText, Search, ShieldAlert, SlidersHorizontal, Undo2 } from 'lucide-react'
3
3
  import { compareVersions } from '../../utils/version'
4
4
 
5
5
  export interface ReleaseHighlight {
@@ -48,6 +48,135 @@ export const CHANGELOG_URL = 'https://radarhq.io/changelog'
48
48
  // major release must have its own entry: scripts/check-whats-new.sh refuses to
49
49
  // release one without it.
50
50
  export const RELEASE_NOTES: ReleaseNotes[] = [
51
+ {
52
+ version: 'v1.20.0',
53
+ highlights: [
54
+ {
55
+ id: 'crd-schema-browser',
56
+ icon: Braces,
57
+ title: 'Explore CRDs and their schemas',
58
+ description: 'CRDs now have a sidebar row and a schema browser. Search fields, paste a path from an API error, and read types, defaults and validation rules.',
59
+ leadDescription: "CustomResourceDefinitions now have a sidebar row, and typing crd finds them in Cmd-K. The drawer and a full Schema tab show each version's fields in a tree like kubectl explain, with types, defaults and validation rules. Paste a path from an API server error to find the field and see the rules on its parents.",
60
+ importance: 8,
61
+ path: '/resources/customresourcedefinitions?apiGroup=apiextensions.k8s.io',
62
+ cta: 'Open CRDs',
63
+ },
64
+ {
65
+ id: 'rollbacks-safer-syncs',
66
+ icon: Undo2,
67
+ title: 'Reliable rollbacks and safer Argo CD syncs',
68
+ description: "Argo CD rollback works and reports what it deployed; Deployment rollback matches kubectl. Syncs keep the Application's options and leave pruning off.",
69
+ importance: 7,
70
+ path: '/gitops',
71
+ cta: 'Open GitOps',
72
+ },
73
+ {
74
+ id: 'kueue-support',
75
+ icon: Layers,
76
+ title: 'Deep Kueue support',
77
+ description: 'Browse queue Workloads, admission history and Kueue-reported pending positions. Issues flag rejected checks and broken queues, not quota waits.',
78
+ importance: 7,
79
+ },
80
+ {
81
+ id: 'issues-more-failures',
82
+ icon: ShieldAlert,
83
+ title: 'Issues explain more failures',
84
+ description: 'Failed cert-manager renewals, evicted Pods with their node, surge deadlocks on ReadWriteOnce volumes, and webhooks that may block Pod creation.',
85
+ importance: 6,
86
+ path: '/issues',
87
+ cta: 'Open Issues',
88
+ },
89
+ {
90
+ id: 'deeper-operator-support',
91
+ icon: Boxes,
92
+ title: 'Deeper Strimzi, Ray, JobSet and KServe support',
93
+ description: 'See failed connector tasks even when Ready, JobSet members in Topology and current Ray Pod logs. KServe flags failed components, not planned stops.',
94
+ importance: 6,
95
+ },
96
+ {
97
+ id: 'application-evidence',
98
+ icon: Database,
99
+ title: 'Collect RabbitMQ, NATS and Vault evidence locally',
100
+ description: "On local Radar, collect one Pod's RabbitMQ alarms, NATS consumer counters or Vault seal state from a default plaintext endpoint.",
101
+ importance: 6,
102
+ },
103
+ {
104
+ id: 'otel-flagger',
105
+ icon: Activity,
106
+ title: 'Deeper OpenTelemetry and Flagger support',
107
+ description: 'Flagger Issues name missing targets, metric templates and provider Secrets. AI diagnosis reads Collectors and Canaries through current workloads.',
108
+ importance: 5,
109
+ },
110
+ ],
111
+ improvements: [
112
+ // The grid fills row by row: pair lines of similar length.
113
+ 'Switching to an unreachable context keeps your current cluster; Cannot Connect says since when',
114
+ 'Issue rows and Investigate buttons show recent local investigations; see an example before your first',
115
+ 'Limit what Radar can reach with rbac.namespaces, disableExec and --disable-auto-port-forward',
116
+ 'GitOps trees show operator-created workloads; drawers link webhooks, issuers and Secrets',
117
+ 'get_changes includes RBAC and Node edits; search finds resources by a pasted IP or ip:port',
118
+ 'Issues link a missing Secret to its SealedSecret and report missing parent Gateways',
119
+ ],
120
+ },
121
+ {
122
+ version: 'v1.19.0',
123
+ highlights: [
124
+ {
125
+ id: 'investigate-a-question',
126
+ icon: MessageCircleQuestionMark,
127
+ title: 'Start an AI investigation from a question',
128
+ description: 'Describe what you see, like "checkout is slow", with or without a resource, and choose where to start and how far back to look.',
129
+ leadDescription: "When Radar runs locally, investigations no longer need a resource to start. On the Investigations page, describe what you are seeing, choose the namespaces to start in and how far back to look, and optionally pin a resource by typing @. Or type a symptom into the Omnibar to open the composer with your words. Findings now lead with the verdict and show more of the metrics charts the agent cited inline, and Radar's routine read limits no longer crowd out the open questions.",
130
+ importance: 9,
131
+ },
132
+ {
133
+ id: 'mcp-delete-exec-tools',
134
+ icon: Bot,
135
+ title: 'New MCP tools: delete and exec',
136
+ description: "delete_resource previews a deletion's likely impact and requires confirmation before deleting. Opt-in exec_pod runs one command in a container.",
137
+ importance: 7,
138
+ },
139
+ {
140
+ id: 'read-coverage',
141
+ icon: ScanSearch,
142
+ title: "Answers say what Radar couldn't see",
143
+ description: "Resource tables, search and MCP tools say when an answer is partial and why, so neither you nor an agent reads a gap as absence.",
144
+ importance: 6,
145
+ },
146
+ {
147
+ id: 'issues-new-checks',
148
+ icon: ShieldAlert,
149
+ title: 'New issue checks',
150
+ description: 'Issues now flag expired TLS certificates in use, dropped Traefik routes, Pods stuck on readiness gates, blocked Argo CD auto-sync and failed canaries.',
151
+ importance: 6,
152
+ path: '/issues',
153
+ cta: 'Open Issues',
154
+ },
155
+ {
156
+ id: 'issues-fewer-false-alarms',
157
+ icon: BellOff,
158
+ title: 'Fewer false alarms',
159
+ description: 'Issues stop flagging completed Pods, in-budget Deployment rollout dips, expected pause and deletion conditions, and recovered Cluster API Machines.',
160
+ importance: 6,
161
+ },
162
+ {
163
+ id: 'custom-resource-changes',
164
+ icon: GitCompareArrows,
165
+ title: 'Custom-resource history names changed fields',
166
+ description: 'Change history names the custom-resource fields that changed, with values when safe to show. get_changes for a kind also returns creates and deletes.',
167
+ importance: 5,
168
+ },
169
+ ],
170
+ improvements: [
171
+ 'The Delete dialog previews owned objects, GitOps cleanup and storage at risk',
172
+ 'Phone layouts for Home, Issues, Resources, Topology, Helm and Capacity',
173
+ 'Native views for OpenTelemetry Operator collectors and Flagger canaries',
174
+ 'Related Resources and Managed By tell owners apart from GitOps managers',
175
+ 'Investigations check Claude Code and Codex sign-in, and let you stop a run when all slots are busy',
176
+ 'The install script verifies checksums; Helm installs check repository checksums when published',
177
+ 'Windows desktop updates work again; --no-version-check turns off automatic checks',
178
+ ],
179
+ },
51
180
  {
52
181
  version: 'v1.18.0',
53
182
  highlights: [
@@ -315,7 +444,10 @@ export function unreadReleases(
315
444
  // skipped releases sees the best of them, weighted toward the newest; older
316
445
  // releases than this list covers are left to the changelog.
317
446
  export const RELEASE_WEIGHTS = [1, 0.75, 0.5]
318
- export const MAX_CARDS = 5
447
+ export const MAX_CARDS = 7
448
+ // Auto-open weighs only the strongest cards, so a release can't clear the bar
449
+ // on a long list of minor ones.
450
+ export const SCORED_CARDS = 5
319
451
  export const MAX_LINES = 8
320
452
  // A fuller set of useful improvements can merit an announcement even without
321
453
  // a single release-defining feature.
@@ -337,7 +469,7 @@ export interface ComposedNotes {
337
469
  /** The first one leads the dialog at full width. */
338
470
  highlights: ComposedHighlight[]
339
471
  lines: ComposedLine[]
340
- /** Sum of the shown highlights' scores. */
472
+ /** Sum of the strongest shown highlights' scores, up to SCORED_CARDS. */
341
473
  score: number
342
474
  /** False when older unseen releases were left out. */
343
475
  complete: boolean
@@ -360,7 +492,7 @@ export function composeReleaseNotes(releases: ReleaseNotes[]): ComposedNotes {
360
492
  versions: shown.map(notes => notes.version),
361
493
  highlights,
362
494
  lines,
363
- score: highlights.reduce((sum, h) => sum + h.score, 0),
495
+ score: highlights.slice(0, SCORED_CARDS).reduce((sum, h) => sum + h.score, 0),
364
496
  complete: shown.length === releases.length,
365
497
  }
366
498
  }
@@ -0,0 +1,126 @@
1
+ // @vitest-environment jsdom
2
+ import { describe, expect, it, vi } from "vitest";
3
+ import { act } from "react";
4
+ import { createRoot } from "react-dom/client";
5
+ import { renderToString } from "react-dom/server";
6
+ import type { RelatedFindingsGroup } from "@skyhook-io/k8s-ui";
7
+ import { RelatedFindingsSection } from "./RelatedFindingsSection";
8
+
9
+ const cached: RelatedFindingsGroup = {
10
+ associatedVia: {
11
+ group: "kafka.strimzi.io",
12
+ kind: "KafkaConnect",
13
+ namespace: "app",
14
+ name: "connect",
15
+ },
16
+ kinds: {
17
+ count: 1,
18
+ names: [{ group: "kafka.strimzi.io", kind: "KafkaConnector" }],
19
+ },
20
+ checked: 1,
21
+ unknown: 0,
22
+ gaps: [],
23
+ };
24
+
25
+ describe("Related findings coverage", () => {
26
+ it("opens the association anchor using the host's resource navigation", () => {
27
+ const onResourceClick = vi.fn();
28
+ vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
29
+ const host = document.createElement("div");
30
+ const root = createRoot(host);
31
+ try {
32
+ act(() =>
33
+ root.render(
34
+ <RelatedFindingsSection
35
+ data={[{ ...cached, unknown: 1 }]}
36
+ onResourceClick={onResourceClick}
37
+ />,
38
+ ),
39
+ );
40
+ const button = host.querySelector("button")!;
41
+ expect(button.textContent).toBe(
42
+ "KafkaConnect app/connect (kafka.strimzi.io)",
43
+ );
44
+ act(() => button.click());
45
+ expect(onResourceClick).toHaveBeenCalledWith(cached.associatedVia);
46
+ } finally {
47
+ act(() => root.unmount());
48
+ vi.unstubAllGlobals();
49
+ }
50
+ });
51
+ it("hides absent, empty and assessed groups without findings or limitations", () => {
52
+ for (const data of [undefined, [], [cached]])
53
+ expect(renderToString(<RelatedFindingsSection data={data} />)).toBe("");
54
+ });
55
+ it("explains unassessable snapshots from structured fields alone", () => {
56
+ const html = renderToString(
57
+ <RelatedFindingsSection data={[{ ...cached, unknown: 1 }]} />,
58
+ );
59
+ expect(html).toContain("1 of 1 checked resources");
60
+ expect(html).toContain("could not be assessed");
61
+ expect(html).toContain("KafkaConnector (kafka.strimzi.io)");
62
+ expect(html).toContain("status is reported separately");
63
+ expect(html).not.toContain("Operational issues");
64
+ });
65
+ it.each([
66
+ ["radar_kind_not_collected", "Radar doesn&#x27;t collect it"],
67
+ ["kind_sync_pending", "still loading"],
68
+ ])("explains %s using the existing read vocabulary", (code, explanation) => {
69
+ const html = renderToString(
70
+ <RelatedFindingsSection data={[{ ...cached, gaps: [{ code }] }]} />,
71
+ );
72
+ expect(html).toContain(explanation);
73
+ });
74
+ it("keeps input gaps and output omissions distinct", () => {
75
+ const gap = { ...cached, checked: 0, gaps: [{ code: "list_too_large" }] };
76
+ const html = renderToString(<RelatedFindingsSection data={[gap]} />);
77
+ expect(html).toContain("incomplete related inventory");
78
+ expect(html).not.toContain("Additional related findings were omitted");
79
+ const both = renderToString(
80
+ <RelatedFindingsSection data={[{ ...gap, truncated: true }]} />,
81
+ );
82
+ expect(both).toContain("incomplete related inventory");
83
+ expect(both).toContain("Additional related findings were omitted");
84
+ });
85
+ it("keeps independent anchors and counts separate without connector wording", () => {
86
+ const groups: RelatedFindingsGroup[] = [
87
+ {
88
+ ...cached,
89
+ associatedVia: {
90
+ group: "postgresql.cnpg.io",
91
+ kind: "Cluster",
92
+ namespace: "db",
93
+ name: "orders",
94
+ },
95
+ kinds: {
96
+ count: 1,
97
+ names: [{ group: "postgresql.cnpg.io", kind: "Backup" }],
98
+ },
99
+ checked: 2,
100
+ unknown: 1,
101
+ },
102
+ {
103
+ ...cached,
104
+ associatedVia: {
105
+ group: "external-secrets.io",
106
+ kind: "ExternalSecret",
107
+ namespace: "app",
108
+ name: "credentials",
109
+ },
110
+ kinds: {
111
+ count: 1,
112
+ names: [{ group: "external-secrets.io", kind: "ClusterSecretStore" }],
113
+ },
114
+ checked: 3,
115
+ unknown: 2,
116
+ },
117
+ ];
118
+ const html = renderToString(<RelatedFindingsSection data={groups} />);
119
+ expect(html).toContain("db/orders");
120
+ expect(html).toContain("app/credentials");
121
+ expect(html).toContain("1 of 2 checked");
122
+ expect(html).toContain("2 of 3 checked");
123
+ expect(html).not.toContain("3 of 5");
124
+ expect(html).not.toContain("connector");
125
+ });
126
+ });
@@ -0,0 +1,80 @@
1
+ import { Info } from "lucide-react";
2
+ import {
3
+ ResourceIssuesSection,
4
+ type IssueResourceRef,
5
+ type RelatedFindingsGroup,
6
+ } from "@skyhook-io/k8s-ui";
7
+ import { relatedFindingLimitations } from "../../utils/related-findings";
8
+
9
+ export function RelatedFindingsSection({
10
+ data,
11
+ onResourceClick,
12
+ }: {
13
+ data: RelatedFindingsGroup[] | undefined;
14
+ onResourceClick?: (ref: IssueResourceRef) => void;
15
+ }) {
16
+ const groups = data?.filter(
17
+ (group) =>
18
+ group.findings?.length ||
19
+ group.truncated ||
20
+ group.unknown > 0 ||
21
+ group.gaps.length > 0,
22
+ );
23
+ if (!groups?.length) return null;
24
+
25
+ return (
26
+ <div className="space-y-4">
27
+ {groups.map((group, index) => {
28
+ const anchor = group.associatedVia;
29
+ const limits = relatedFindingLimitations(group);
30
+ return (
31
+ <div
32
+ key={`${anchor.group}/${anchor.kind}/${anchor.namespace}/${anchor.name}/${index}`}
33
+ className="space-y-2 border-b border-theme-border pb-4 last:border-0 last:pb-0"
34
+ >
35
+ {group.findings?.length ? (
36
+ <ResourceIssuesSection
37
+ heading="Related findings"
38
+ issues={group.findings}
39
+ onResourceClick={onResourceClick}
40
+ />
41
+ ) : (
42
+ <h3 className="flex items-center gap-2 px-1 text-xs font-semibold uppercase tracking-wide text-theme-text-secondary">
43
+ <Info
44
+ className="h-4 w-4 text-theme-text-tertiary"
45
+ aria-hidden
46
+ />
47
+ Related findings
48
+ </h3>
49
+ )}
50
+ <p className="text-xs text-theme-text-secondary">
51
+ Via{" "}
52
+ {onResourceClick ? (
53
+ <button
54
+ type="button"
55
+ className="text-accent hover:underline"
56
+ onClick={() => onResourceClick(anchor)}
57
+ >
58
+ {`${anchor.kind} ${anchor.namespace ? `${anchor.namespace}/` : ""}${anchor.name}${anchor.group ? ` (${anchor.group})` : ""}`}
59
+ </button>
60
+ ) : (
61
+ `${anchor.kind} ${anchor.namespace ? `${anchor.namespace}/` : ""}${anchor.name}${anchor.group ? ` (${anchor.group})` : ""}`
62
+ )}
63
+ . These findings concern the linked resources; this resource's
64
+ status is reported separately.
65
+ </p>
66
+ {limits.length > 0 && (
67
+ <ul className="text-xs text-theme-text-secondary">
68
+ {limits.map((limit) => (
69
+ <li key={`${limit.kind}/${limit.message}`}>
70
+ {limit.message}
71
+ </li>
72
+ ))}
73
+ </ul>
74
+ )}
75
+ </div>
76
+ );
77
+ })}
78
+ </div>
79
+ );
80
+ }
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
2
2
 
3
3
  import { gitOpsOwnerFromRelationships } from '@skyhook-io/k8s-ui'
4
4
  import type { Relationships } from '../../types'
5
- import { collectServingRefs, supportsBatchExecution } from './WorkloadView'
5
+ import { collectServingRefs, memberOverviewParams, supportsBatchExecution } from './WorkloadView'
6
6
  import { findInheritedGitOpsLookupRef } from '../../hooks/useResolvedGitOpsOwner'
7
7
 
8
8
  describe('findInheritedGitOpsLookupRef', () => {
@@ -84,3 +84,12 @@ describe('collectServingRefs', () => {
84
84
  expect(collectServingRefs({ routedFrom: [broker, broker, other] })).toEqual([broker, other])
85
85
  })
86
86
  })
87
+
88
+ describe('memberOverviewParams', () => {
89
+ it('selects the member and returns to the Overview in one change, keeping other params', () => {
90
+ const next = memberOverviewParams(new URLSearchParams('apiGroup=jobset.x-k8s.io&tab=topology&run=jobs/ml/old'), 'jobs/ml/train-workers-1')
91
+ expect(next.get('run')).toBe('jobs/ml/train-workers-1')
92
+ expect(next.has('tab')).toBe(false)
93
+ expect(next.get('apiGroup')).toBe('jobset.x-k8s.io')
94
+ })
95
+ })