@skyhook-io/radar-app 1.19.0 → 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 (173) hide show
  1. package/README.md +1 -1
  2. package/package.json +5 -5
  3. package/src/App.tsx +31 -5
  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.ts +4 -0
  15. package/src/api/radarFeatures.render.test.tsx +33 -1
  16. package/src/api/radarFeatures.test.ts +47 -0
  17. package/src/api/radarFeatures.ts +40 -1
  18. package/src/api/rbac.settled.test.tsx +42 -0
  19. package/src/api/rbac.test.ts +18 -0
  20. package/src/api/rbac.ts +37 -7
  21. package/src/api/traffic.ts +9 -4
  22. package/src/api/usage-data.fixtures.ts +3 -1
  23. package/src/api/usage-data.test.tsx +134 -0
  24. package/src/api/usage-data.ts +35 -7
  25. package/src/api/workloadPodsPolling.test.ts +26 -0
  26. package/src/components/CloudConnectFlow.test.tsx +86 -0
  27. package/src/components/CloudConnectFlow.tsx +65 -27
  28. package/src/components/CloudFunnelButton.test.tsx +140 -5
  29. package/src/components/CloudFunnelButton.tsx +50 -9
  30. package/src/components/ConnectionErrorView.test.tsx +34 -0
  31. package/src/components/ConnectionErrorView.tsx +35 -11
  32. package/src/components/ContextSwitcher.tsx +5 -2
  33. package/src/components/SwitchAwareConnectionError.test.tsx +43 -0
  34. package/src/components/SwitchAwareConnectionError.tsx +85 -0
  35. package/src/components/application-evidence/ApplicationEvidenceAction.flow.test.tsx +234 -0
  36. package/src/components/application-evidence/ApplicationEvidenceAction.test.tsx +144 -0
  37. package/src/components/application-evidence/ApplicationEvidenceAction.tsx +218 -0
  38. package/src/components/capacity/CapacityDemand.tsx +3 -2
  39. package/src/components/capacity/demandSummary.test.ts +38 -0
  40. package/src/components/capacity/shared.tsx +12 -1
  41. package/src/components/cost/ApplicationCostTab.tsx +4 -0
  42. package/src/components/cost/CostTrendChart.tsx +2 -0
  43. package/src/components/cost/WorkloadCostTab.tsx +4 -0
  44. package/src/components/cost/source.test.ts +5 -0
  45. package/src/components/cost/source.ts +11 -0
  46. package/src/components/diagnose/AIMarkdown.tsx +3 -0
  47. package/src/components/diagnose/AgentSetupNotice.test.tsx +17 -0
  48. package/src/components/diagnose/AgentSetupNotice.tsx +21 -3
  49. package/src/components/diagnose/ContinueInAgentButton.mounted.test.tsx +182 -0
  50. package/src/components/diagnose/ContinueInAgentButton.test.tsx +128 -0
  51. package/src/components/diagnose/ContinueInAgentButton.tsx +303 -0
  52. package/src/components/diagnose/DiagnoseContext.question.test.tsx +1 -1
  53. package/src/components/diagnose/DiagnoseContext.tsx +68 -2
  54. package/src/components/diagnose/DiagnoseSurface.tsx +58 -113
  55. package/src/components/diagnose/ExampleInvestigationLink.tsx +20 -0
  56. package/src/components/diagnose/Home.test.tsx +26 -0
  57. package/src/components/diagnose/Home.tsx +20 -1
  58. package/src/components/diagnose/InvestigationEvidenceSections.tsx +45 -22
  59. package/src/components/diagnose/InvestigationView.tsx +94 -26
  60. package/src/components/diagnose/LocalDiagnoseAction.history.test.tsx +450 -0
  61. package/src/components/diagnose/LocalDiagnoseAction.tsx +354 -35
  62. package/src/components/diagnose/NextStepJump.test.tsx +92 -0
  63. package/src/components/diagnose/NextStepJump.tsx +75 -0
  64. package/src/components/diagnose/QuestionComposer.tsx +8 -0
  65. package/src/components/diagnose/exampleInvestigation.events.json +191 -0
  66. package/src/components/diagnose/exampleInvestigation.loadFailure.test.tsx +94 -0
  67. package/src/components/diagnose/exampleInvestigation.test.tsx +248 -0
  68. package/src/components/diagnose/exampleInvestigation.ts +121 -0
  69. package/src/components/diagnose/investigationCase.test.tsx +9 -1
  70. package/src/components/diagnose/investigationEvidence/adapters/applicationFindings.test.ts +739 -0
  71. package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +50 -2
  72. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +9 -0
  73. package/src/components/diagnose/investigationEvidence/builder.ts +30 -0
  74. package/src/components/diagnose/investigationEvidence/observations.ts +121 -2
  75. package/src/components/diagnose/investigationEvidence/projection.test.ts +85 -3
  76. package/src/components/diagnose/investigationEvidence/types.ts +5 -0
  77. package/src/components/diagnose/investigationState.ts +28 -0
  78. package/src/components/diagnose/lastInvestigation.test.ts +95 -0
  79. package/src/components/diagnose/lastInvestigation.ts +58 -0
  80. package/src/components/diagnose/launch.test.ts +125 -1
  81. package/src/components/diagnose/launch.ts +57 -10
  82. package/src/components/diagnose/toolCallLabel.test.ts +10 -4
  83. package/src/components/execution/BatchExecutionView.tsx +24 -11
  84. package/src/components/execution/JobSetAdmission.test.tsx +42 -0
  85. package/src/components/execution/JobSetAdmission.tsx +18 -3
  86. package/src/components/execution/JobSetMemberComparison.tsx +2 -1
  87. package/src/components/execution/runState.test.ts +14 -0
  88. package/src/components/execution/runState.ts +8 -0
  89. package/src/components/gitops/GitOpsView.rollbackGate.test.tsx +202 -0
  90. package/src/components/gitops/GitOpsView.syncRequest.test.tsx +369 -0
  91. package/src/components/gitops/GitOpsView.tsx +86 -17
  92. package/src/components/gitops/RemoteDestinationCloudHint.tsx +2 -3
  93. package/src/components/gitops/destination-toast.test.ts +1 -1
  94. package/src/components/gitops/destination-toast.ts +2 -2
  95. package/src/components/home/ClusterHealthCard.tsx +1 -1
  96. package/src/components/home/HomeAgentBlock.test.tsx +31 -3
  97. package/src/components/home/HomeAgentBlock.tsx +13 -4
  98. package/src/components/home/HomeDiagramCard.tsx +47 -0
  99. package/src/components/home/HomeView.tsx +81 -41
  100. package/src/components/home/MCPSetupDialog.test.tsx +95 -5
  101. package/src/components/home/MCPSetupDialog.tsx +30 -5
  102. package/src/components/home/ProblemsPanel.investigate.test.tsx +171 -0
  103. package/src/components/home/ProblemsPanel.test.tsx +3 -1
  104. package/src/components/home/TopologyPreview.test.tsx +73 -0
  105. package/src/components/home/TopologyPreview.tsx +120 -233
  106. package/src/components/home/TrafficSummary.test.tsx +63 -0
  107. package/src/components/home/TrafficSummary.tsx +135 -138
  108. package/src/components/home/mcpToolCatalog.ts +23 -10
  109. package/src/components/issues/IssuesPane.test.ts +11 -0
  110. package/src/components/issues/IssuesPane.tsx +15 -5
  111. package/src/components/issues/uncheckedSources.test.ts +20 -1
  112. package/src/components/issues/uncheckedSources.ts +18 -0
  113. package/src/components/kueue/KueuePendingPosition.tsx +35 -0
  114. package/src/components/kueue/useRelatedObjects.test.tsx +219 -0
  115. package/src/components/kueue/useRelatedReads.test.ts +56 -0
  116. package/src/components/kueue/useRelatedReads.ts +205 -0
  117. package/src/components/logs/MultiPodLogsTab.test.tsx +93 -0
  118. package/src/components/logs/MultiPodLogsTab.tsx +120 -0
  119. package/src/components/logs/PodLogsUnavailable.test.tsx +18 -0
  120. package/src/components/logs/PodLogsUnavailable.tsx +21 -0
  121. package/src/components/logs/RayClusterLogsTab.reselect.test.tsx +67 -0
  122. package/src/components/logs/RayClusterLogsTab.test.tsx +167 -0
  123. package/src/components/logs/RayClusterLogsTab.tsx +109 -0
  124. package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +3 -2
  125. package/src/components/logs/rayClusterPods.ts +32 -0
  126. package/src/components/outageSince.test.ts +21 -0
  127. package/src/components/outageSince.ts +10 -0
  128. package/src/components/resource/PrometheusCharts.overlays.test.ts +12 -0
  129. package/src/components/resource/PrometheusCharts.tsx +3 -40
  130. package/src/components/resources/crd/CRDSchemaTab.test.tsx +28 -0
  131. package/src/components/resources/crd/CRDSchemaTab.tsx +13 -0
  132. package/src/components/resources/crd/host.tsx +14 -0
  133. package/src/components/resources/renderers/CustomResourceDefinitionRenderer.test.tsx +27 -0
  134. package/src/components/resources/renderers/CustomResourceDefinitionRenderer.tsx +12 -0
  135. package/src/components/resources/renderers/JobAdmissionRenderers.test.tsx +4 -1
  136. package/src/components/resources/renderers/JobAdmissionRenderers.tsx +4 -3
  137. package/src/components/resources/renderers/KueueHostRenderers.test.tsx +117 -0
  138. package/src/components/resources/renderers/KueueQueueRenderers.test.tsx +97 -0
  139. package/src/components/resources/renderers/KueueQueueRenderers.tsx +139 -0
  140. package/src/components/resources/renderers/KueueWorkloadRenderer.test.tsx +7 -1
  141. package/src/components/resources/renderers/KueueWorkloadRenderer.tsx +47 -7
  142. package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.test.tsx +67 -0
  143. package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.tsx +31 -0
  144. package/src/components/resources/renderers/RayClusterRenderer.test.tsx +81 -3
  145. package/src/components/resources/renderers/RayClusterRenderer.tsx +19 -4
  146. package/src/components/traffic/TrafficView.tsx +3 -3
  147. package/src/components/ui/command-items-crd.test.tsx +23 -0
  148. package/src/components/ui/command-items.ts +2 -1
  149. package/src/components/useContextSwitchFlow.test.tsx +61 -0
  150. package/src/components/useContextSwitchFlow.tsx +21 -4
  151. package/src/components/whats-new/WhatsNew.test.ts +10 -3
  152. package/src/components/whats-new/WhatsNew.tsx +5 -1
  153. package/src/components/whats-new/WhatsNewDialog.test.tsx +17 -3
  154. package/src/components/whats-new/releaseNotes.ts +77 -4
  155. package/src/components/workload/RelatedFindingsSection.test.tsx +126 -0
  156. package/src/components/workload/RelatedFindingsSection.tsx +80 -0
  157. package/src/components/workload/WorkloadView.test.ts +10 -1
  158. package/src/components/workload/WorkloadView.tsx +85 -98
  159. package/src/components/workload/issueResourceOpener.test.ts +20 -0
  160. package/src/components/workload/issueResourceOpener.ts +17 -0
  161. package/src/context/ConnectionContext.tsx +133 -60
  162. package/src/context/ConnectionProvider.retry.test.tsx +176 -0
  163. package/src/context/ContextSwitchContext.tsx +14 -1
  164. package/src/context/DiagnoseCustomization.tsx +3 -0
  165. package/src/context/clusterConnected.ts +10 -0
  166. package/src/contexts/CapabilitiesContext.tsx +6 -4
  167. package/src/hooks/useElementSize.ts +30 -0
  168. package/src/integrations/resourceHost.test.tsx +1 -0
  169. package/src/integrations/resourceHost.ts +5 -1
  170. package/src/integrations/resourceHosts.test.tsx +21 -4
  171. package/src/integrations/resourceHosts.tsx +12 -0
  172. package/src/main.tsx +5 -0
  173. package/src/utils/related-findings.ts +46 -0
@@ -1,154 +1,151 @@
1
+ import { useId } from 'react'
1
2
  import type { DashboardTrafficSummary } from '../../api/client'
2
- import { Activity, ArrowRight, ArrowRightLeft } from 'lucide-react'
3
+ import { Activity } from 'lucide-react'
4
+ import { useElementSize } from '../../hooks/useElementSize'
5
+ import { NAMESPACE_PALETTE } from '../../utils/traffic-colors'
6
+ import { HomeDiagramCard } from './HomeDiagramCard'
3
7
 
4
8
  interface TrafficSummaryProps {
5
9
  data: DashboardTrafficSummary | null
6
10
  onNavigate: () => void
7
11
  }
8
12
 
9
- /**
10
- * Static schematic SVG mimicking the real traffic view layout:
11
- * vertical spine on the left, Internet node, chunky arrows branching
12
- * right to colored service nodes, some with further connections.
13
- */
14
- function TrafficSchematic() {
15
- // Service node colors matching the real traffic view
16
- const green = '#22c55e' // skyhook-connector style
17
- const blue = '#3b82f6' // dev services
18
- const brown = '#a3734c' // staging services
19
- const teal = '#14b8a6' // keda style
20
- const red = '#ef4444' // unhealthy / alert
21
- const purple = '#a855f7' // envoy / system
22
- const inet = '#93c5fd' // light blue — Internet node bg
23
- const inetBorder = '#60a5fa'
24
-
25
- // Edge color
26
- const ec = '#6b7280' // gray-500
13
+ const SOURCE_NAMES: Record<string, string> = {
14
+ hubble: 'Hubble',
15
+ beyla: 'Beyla',
16
+ caretta: 'Caretta',
17
+ istio: 'Istio',
18
+ }
19
+
20
+ export function trafficSourceName(source: string): string {
21
+ return SOURCE_NAMES[source] ?? source.charAt(0).toUpperCase() + source.slice(1)
22
+ }
23
+
24
+ // The drawing's height in its own units. Its width follows the card, up to a
25
+ // limit, so the picture fills a wide card instead of floating in the middle.
26
+ const SKETCH_H = 128
27
+ const SKETCH_MIN_W = 296
28
+ const SKETCH_MAX_W = 560
29
+ const NODE_W = 58
30
+ const NODE_H = 24
31
+
32
+ // Example namespaces shared with the Topology card's picture, coloured from the
33
+ // Traffic view's own palette.
34
+ const NAMESPACES = {
35
+ storefront: NAMESPACE_PALETTE[1],
36
+ payments: NAMESPACE_PALETTE[3],
37
+ }
38
+
39
+ type Column = 0 | 1 | 2 | 3
40
+ interface SketchNode { col: Column; y: number; name: string; namespace: keyof typeof NAMESPACES; port: number }
41
+
42
+ const NODES: Record<string, SketchNode> = {
43
+ frontend: { col: 1, y: 64, name: 'frontend', namespace: 'storefront', port: 8080 },
44
+ cart: { col: 2, y: 22, name: 'cart', namespace: 'storefront', port: 7070 },
45
+ catalog: { col: 2, y: 64, name: 'catalog', namespace: 'storefront', port: 3550 },
46
+ checkout: { col: 2, y: 106, name: 'checkout', namespace: 'payments', port: 5050 },
47
+ redis: { col: 3, y: 22, name: 'redis', namespace: 'storefront', port: 6379 },
48
+ payment: { col: 3, y: 106, name: 'payment', namespace: 'payments', port: 50051 },
49
+ }
50
+
51
+ const EDGES: [from: string, to: string, count: number][] = [
52
+ ['internet', 'frontend', 182],
53
+ ['frontend', 'cart', 72],
54
+ ['frontend', 'catalog', 32],
55
+ ['frontend', 'checkout', 28],
56
+ ['cart', 'redis', 49],
57
+ ['checkout', 'payment', 10],
58
+ ]
59
+
60
+ const INTERNET = { x: 4, y: 64, w: 44 }
61
+
62
+ // A right-angled route with rounded corners, the shape the Traffic view draws.
63
+ function route(x1: number, y1: number, x2: number, y2: number): string {
64
+ if (y1 === y2) return `M ${x1} ${y1} H ${x2}`
65
+ const mx = (x1 + x2) / 2
66
+ const r = Math.min(3, Math.abs(y2 - y1) / 2)
67
+ const dy = y2 > y1 ? r : -r
68
+ return `M ${x1} ${y1} H ${mx - r} Q ${mx} ${y1} ${mx} ${y1 + dy} V ${y2 - dy} Q ${mx} ${y2} ${mx + r} ${y2} H ${x2}`
69
+ }
70
+
71
+ // A static picture of what Live Traffic draws: services as boxes in their
72
+ // namespace's colour, reached on a port, with connection counts on the lines.
73
+ // It is a hint at the view, not this cluster's traffic, so it never moves and
74
+ // carries no health colour.
75
+ function TrafficSketch() {
76
+ const arrow = `${useId()}-arrow`
77
+ const [ref, size] = useElementSize<HTMLDivElement>({ width: SKETCH_MIN_W, height: SKETCH_H })
78
+ const width = Math.min(SKETCH_MAX_W, Math.max(SKETCH_MIN_W, (SKETCH_H * size.width) / size.height))
79
+ // Extra width spreads the columns apart rather than stretching the boxes.
80
+ const extra = width - SKETCH_MIN_W
81
+ const colX = (c: Column) => [66, 146, 226][c - 1] + (extra * c) / 3
82
+
83
+ const anchor = (key: string) => key === 'internet'
84
+ ? { left: INTERNET.x, right: INTERNET.x + INTERNET.w, y: INTERNET.y }
85
+ : { left: colX(NODES[key].col), right: colX(NODES[key].col) + NODE_W, y: NODES[key].y }
27
86
 
28
87
  return (
29
- <svg viewBox="0 0 160 120" className="w-full h-auto max-h-full" aria-hidden="true">
30
- <defs>
31
- <marker id="trf-a" viewBox="0 0 10 8" refX="9" refY="4"
32
- markerWidth="7" markerHeight="6" orient="auto">
33
- <path d="M 0 0 L 10 4 L 0 8 z" fill={ec} opacity="0.55" />
34
- </marker>
35
- <marker id="trf-a2" viewBox="0 0 10 8" refX="9" refY="4"
36
- markerWidth="7" markerHeight="6" orient="auto">
37
- <path d="M 0 0 L 10 4 L 0 8 z" fill={ec} opacity="0.35" />
38
- </marker>
39
- </defs>
40
-
41
- {/* Vertical spine */}
42
- <line x1="38" y1="6" x2="38" y2="114" stroke={ec} strokeWidth="2.5" opacity="0.3" strokeLinecap="round" />
43
-
44
- {/* Internet node — rounded rect with light fill */}
45
- <rect x="3" y="43" width="24" height="16" rx="5" fill={inet} opacity="0.35" stroke={inetBorder} strokeWidth="0.8" />
46
- <circle cx="12" cy="51" r="2.5" fill={inetBorder} opacity="0.6" />
47
-
48
- {/* Arrow: Internet → spine */}
49
- <line x1="27" y1="51" x2="36" y2="51" stroke={ec} strokeWidth="2.5" opacity="0.45" markerEnd="url(#trf-a)" />
50
-
51
- {/* === Branch 1: green service (top) === */}
52
- <line x1="39" y1="14" x2="56" y2="14" stroke={ec} strokeWidth="2" opacity="0.4" markerEnd="url(#trf-a)" />
53
- <rect x="58" y="8" width="28" height="12" rx="3" fill={green} opacity="0.85" />
54
- {/* status dot */}
55
- <circle cx="62" cy="14" r="1.5" fill="#fbbf24" opacity="0.9" />
56
-
57
- {/* === Branch 2: blue service → right node === */}
58
- <line x1="39" y1="33" x2="56" y2="33" stroke={ec} strokeWidth="1.8" opacity="0.4" markerEnd="url(#trf-a)" />
59
- <rect x="58" y="27" width="28" height="12" rx="3" fill={blue} opacity="0.85" />
60
- <circle cx="62" cy="33" r="1.5" fill={green} opacity="0.9" />
61
- {/* → right node (external) */}
62
- <line x1="86" y1="33" x2="108" y2="24" stroke={ec} strokeWidth="1.2" opacity="0.35" markerEnd="url(#trf-a2)" />
63
- <rect x="110" y="18" width="28" height="12" rx="3" fill={red} opacity="0.7" />
64
-
65
- {/* === Branch 3: brown service === */}
66
- <line x1="39" y1="51" x2="56" y2="51" stroke={ec} strokeWidth="2.2" opacity="0.45" markerEnd="url(#trf-a)" />
67
- <rect x="58" y="45" width="28" height="12" rx="3" fill={brown} opacity="0.85" />
68
- <circle cx="62" cy="51" r="1.5" fill={green} opacity="0.9" />
69
-
70
- {/* === Branch 4: teal service → right node === */}
71
- <line x1="39" y1="69" x2="56" y2="69" stroke={ec} strokeWidth="1.5" opacity="0.38" markerEnd="url(#trf-a)" />
72
- <rect x="58" y="63" width="28" height="12" rx="3" fill={teal} opacity="0.85" />
73
- <circle cx="62" cy="69" r="1.5" fill={green} opacity="0.9" />
74
- {/* → right node */}
75
- <line x1="86" y1="69" x2="108" y2="76" stroke={ec} strokeWidth="1.2" opacity="0.35" markerEnd="url(#trf-a2)" />
76
- <rect x="110" y="70" width="28" height="12" rx="3" fill={blue} opacity="0.7" />
77
-
78
- {/* === Branch 5: purple service (bottom) === */}
79
- <line x1="39" y1="87" x2="56" y2="87" stroke={ec} strokeWidth="1.3" opacity="0.35" markerEnd="url(#trf-a)" />
80
- <rect x="58" y="81" width="28" height="12" rx="3" fill={purple} opacity="0.85" />
81
- <circle cx="62" cy="87" r="1.5" fill={green} opacity="0.9" />
82
-
83
- {/* === Branch 6: small red service === */}
84
- <line x1="39" y1="103" x2="56" y2="103" stroke={ec} strokeWidth="1" opacity="0.3" markerEnd="url(#trf-a)" />
85
- <rect x="58" y="97" width="28" height="12" rx="3" fill={red} opacity="0.65" />
86
- <circle cx="62" cy="103" r="1.5" fill={red} opacity="0.9" />
87
- </svg>
88
+ <div ref={ref} className="w-full h-full">
89
+ <svg viewBox={`0 0 ${width} ${SKETCH_H}`} className="w-full h-full" preserveAspectRatio="xMidYMid meet" aria-hidden="true">
90
+ <defs>
91
+ <marker id={arrow} viewBox="0 0 8 6" refX="7" refY="3" markerWidth="5" markerHeight="4" orient="auto">
92
+ <path d="M 0 0 L 8 3 L 0 6 z" fill="var(--text-tertiary)" />
93
+ </marker>
94
+ </defs>
95
+
96
+ {EDGES.map(([from, to, count]) => {
97
+ const a = anchor(from)
98
+ const b = anchor(to)
99
+ const x1 = a.right
100
+ const x2 = b.left - 1.5
101
+ // The count sits on the destination's run, past any fan-out bend,
102
+ // where the Traffic view puts it.
103
+ const labelX = ((x1 + x2) / 2 + x2) / 2
104
+ const labelW = 3 + String(count).length * 2.8
105
+ return (
106
+ <g key={`${from}-${to}`}>
107
+ <path d={route(x1, a.y, x2, b.y)} fill="none" stroke="var(--text-tertiary)" strokeOpacity={0.7}
108
+ strokeWidth={0.6 + count / 182} markerEnd={`url(#${arrow})`} />
109
+ <rect x={labelX - labelW / 2} y={b.y - 3.5} width={labelW} height={7} rx={1.5} className="fill-gray-800/90" />
110
+ <text x={labelX} y={b.y + 1.6} textAnchor="middle" fontSize={4.6} className="fill-gray-300">{count}</text>
111
+ </g>
112
+ )
113
+ })}
114
+
115
+ <rect x={INTERNET.x} y={INTERNET.y - NODE_H / 2} width={INTERNET.w} height={NODE_H} rx={4}
116
+ className="fill-sky-500/20 stroke-sky-500/50" strokeWidth={0.6} />
117
+ <text x={INTERNET.x + 5} y={INTERNET.y - 1.5} fontSize={5.6} fontWeight={600} className="fill-sky-700 dark:fill-sky-300">Internet</text>
118
+ <text x={INTERNET.x + 5} y={INTERNET.y + 5} fontSize={4.4} className="fill-sky-700/70 dark:fill-sky-300/70">inbound</text>
119
+
120
+ {Object.entries(NODES).map(([key, n]) => {
121
+ const x = colX(n.col)
122
+ const top = n.y - NODE_H / 2
123
+ return (
124
+ <g key={key}>
125
+ <rect x={x} y={top} width={NODE_W} height={NODE_H} rx={4} fill={NAMESPACES[n.namespace]} />
126
+ <text x={x + 5} y={top + 7.6} fontSize={5.6} fontWeight={600} className="fill-white">{n.name}</text>
127
+ <text x={x + 5} y={top + 13.4} fontSize={4.4} className="fill-white/70">{n.namespace}</text>
128
+ <text x={x + 5} y={top + 20} fontSize={4.4} fontFamily="var(--font-mono, monospace)" className="fill-cyan-300">:{n.port}</text>
129
+ </g>
130
+ )
131
+ })}
132
+ </svg>
133
+ </div>
88
134
  )
89
135
  }
90
136
 
91
137
  export function TrafficSummary({ data, onNavigate }: TrafficSummaryProps) {
92
- const hasFlows = data && data.flowCount > 0
93
-
138
+ // The server names a source only once Radar has detected one, so no
139
+ // name means "not known yet", never "none installed".
94
140
  return (
95
- <button
96
- onClick={onNavigate}
97
- className="group h-[260px] rounded-xl bg-theme-surface shadow-theme-sm hover:-translate-y-1 hover:shadow-theme-md transition-all duration-200 text-left overflow-hidden"
98
- >
99
- <div className="flex flex-col h-full w-full">
100
- <div className="flex items-center justify-between px-5 py-3 border-b border-theme-border/50">
101
- <div className="flex items-center gap-2">
102
- <Activity className="w-4 h-4 text-theme-text-tertiary" />
103
- <span className="text-xs font-semibold uppercase tracking-wider text-theme-text-secondary">Live Traffic</span>
104
- </div>
105
- {hasFlows && (
106
- <span className="text-[11px] text-theme-text-tertiary">
107
- {data.source} &middot; {data.flowCount} flows
108
- </span>
109
- )}
110
- </div>
111
-
112
- <div className="flex-1 min-h-0 overflow-hidden">
113
- {hasFlows ? (
114
- /* Real data: show top flows */
115
- <div className="px-4 py-2 space-y-1.5">
116
- {data.topFlows.map((flow, i) => (
117
- <div key={i} className="flex items-center gap-2 text-xs">
118
- <span className="text-theme-text-primary truncate">{flow.src}</span>
119
- <ArrowRightLeft className="w-3 h-3 text-theme-text-tertiary shrink-0" />
120
- <span className="text-theme-text-primary truncate">{flow.dst}</span>
121
- <span className="text-xs text-theme-text-tertiary shrink-0 ml-auto">
122
- {flow.connections} conn
123
- </span>
124
- </div>
125
- ))}
126
- </div>
127
- ) : (
128
- /* No data yet: schematic + description */
129
- <div className="flex items-stretch gap-2 px-3 py-1.5 h-full">
130
- <div className="flex flex-col justify-center gap-1.5 w-[105px] shrink-0">
131
- <p className="text-[11px] leading-snug text-theme-text-secondary">
132
- Visualize live service-to-service network flows and external dependencies
133
- </p>
134
- {data && (
135
- <span className="text-[10px] text-theme-text-tertiary">
136
- Source: {data.source}
137
- </span>
138
- )}
139
- </div>
140
- <div className="flex-1 min-w-0 overflow-hidden">
141
- <TrafficSchematic />
142
- </div>
143
- </div>
144
- )}
145
- </div>
146
-
147
- <div className="px-4 py-1.5 border-t border-theme-border/50 flex items-center justify-end gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-theme-text-secondary group-hover:text-theme-text-primary transition-colors">
148
- Open Live Traffic
149
- <ArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-0.5" />
150
- </div>
151
- </div>
152
- </button>
141
+ <HomeDiagramCard
142
+ icon={Activity}
143
+ title="Live Traffic"
144
+ fact={data ? trafficSourceName(data.source) : undefined}
145
+ drawing={<TrafficSketch />}
146
+ caption="Which services talk to each other, on which ports, and how much."
147
+ footer="Open Live Traffic"
148
+ onNavigate={onNavigate}
149
+ />
153
150
  )
154
151
  }
@@ -20,6 +20,7 @@ export interface MCPToolParam {
20
20
  export interface MCPToolInfo {
21
21
  name: string
22
22
  write?: boolean
23
+ localOnly?: boolean
23
24
  desc: string
24
25
  params: MCPToolParam[]
25
26
  }
@@ -67,7 +68,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
67
68
  desc: 'Topology graph of relationships between resources — Services, workloads, Pods, Ingresses, owners. Use traffic view for network flow or resources view for ownership hierarchy.',
68
69
  params: [
69
70
  { arg: 'namespace', desc: 'filter to a specific namespace' },
70
- { arg: 'view', desc: 'traffic or resources' },
71
+ { arg: 'view', desc: 'resources (default) or traffic' },
71
72
  { arg: 'format', desc: 'graph (default) or summary (text)' },
72
73
  ],
73
74
  },
@@ -109,17 +110,17 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
109
110
  },
110
111
  {
111
112
  name: 'diagnose',
112
- desc: 'Bounded, point-in-time evidence bundle for one narrowed target — not an agent run and not an authoritative root-cause verdict. For workloads, including Argo Rollout, Radar attempts selected, capped current and previous logs where available, alongside resource context, a capped warning-event sample, and startup blockers; GitOps reconcilers, including Flux HelmRelease, get status summary + parsed related issues; network entry kinds (Service / Ingress / HTTPRoute / GRPCRoute / Gateway) get a coverage-honest path trace that identifies a broken hop only when the evidence establishes one, with an optional one-shot reachability test.',
113
+ desc: 'Bounded, point-in-time evidence bundle for one narrowed target — not an agent run and not an authoritative root-cause verdict. Batch targets return cached context, Issues and events without runtime logs or metrics. For pod-backed workloads, including Argo Rollout, Radar attempts selected, capped current and previous logs where available, alongside resource context, a capped warning-event sample, and startup blockers; GitOps reconcilers, including Flux HelmRelease, get status summary + parsed related issues; network entry kinds (Service / Ingress / HTTPRoute / GRPCRoute / Gateway) get a coverage-honest path trace that identifies a broken hop only when the evidence establishes one, with an optional one-shot reachability test.',
113
114
  params: [
114
- { arg: 'kind', required: true, desc: 'pod, deployment, statefulset, daemonset, Argo Rollout, application, kustomization, Flux HelmRelease, service, ingress, httproute, grpcroute, or gateway' },
115
+ { arg: 'kind', required: true, desc: 'pod, deployment, statefulset, daemonset, Argo Rollout, Job, JobSet, RayJob, Kueue Workload, application, kustomization, Flux HelmRelease, service, ingress, httproute, grpcroute, or gateway' },
115
116
  { arg: 'group', desc: 'API group for CRDs or kind collisions (for example argoproj.io for Rollout); built-ins are inferred' },
116
117
  { arg: 'namespace', required: true, desc: 'resource namespace' },
117
118
  { arg: 'name', required: true, desc: 'resource name' },
118
119
  { arg: 'probe', desc: 'network kinds only: add active DNS/TCP/TLS/HTTP probes against the declared path (0-3s wall time)' },
119
120
  { arg: 'in_cluster', desc: 'network kinds: run the probe from inside the cluster via short-lived self-destructing pods (real dataplane) - confirms a route the apiserver proxy could only reach indirectly. Creates up to 5 short-lived probe pods (one per dialed target) under your RBAC' },
120
- { arg: 'container', desc: 'workload kinds: specific container (defaults to all)' },
121
- { arg: 'tail_lines', desc: 'workload kinds: lines per pod/stream (default 100)' },
122
- { arg: 'since', desc: 'workload kinds: only logs newer than this duration' },
121
+ { arg: 'container', desc: 'log-collecting targets only: specific container (defaults to all)' },
122
+ { arg: 'tail_lines', desc: 'log-collecting targets only: lines per pod/stream (default 100)' },
123
+ { arg: 'since', desc: 'log-collecting targets only: only logs newer than this duration' },
123
124
  ],
124
125
  },
125
126
  {
@@ -208,7 +209,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
208
209
  },
209
210
  {
210
211
  name: 'search',
211
- desc: 'Find resources by content/term match — config keys, env refs, images, label values, ConfigMap data, CRD fields, status messages. Secret values are never indexed.',
212
+ desc: 'Find resources by content/term match — config keys, env refs, images, label values, ConfigMap data, CRD fields, status messages, or an IP/ip:port to find the Pod, Service or Node holding it. Secret values are never indexed.',
212
213
  params: [
213
214
  { arg: 'query', required: true, desc: 'tokens AND\'d; modifiers kind:, ns:, label:, image:' },
214
215
  { arg: 'limit', desc: 'max hits (default 50, max 500)' },
@@ -297,7 +298,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
297
298
  name: 'get_workload_logs',
298
299
  desc: 'Aggregated logs across all pods of a workload. Without grep, filters for diagnostic relevance; grep returns only matching timestamp-prefixed lines instead.',
299
300
  params: [
300
- { arg: 'kind', desc: 'deployment (default), statefulset, daemonset, job, or workflow' },
301
+ { arg: 'kind', desc: 'deployment (default), statefulset, daemonset, rollout, job, or workflow' },
301
302
  { arg: 'namespace', required: true, desc: 'workload namespace' },
302
303
  { arg: 'name', required: true, desc: 'workload name' },
303
304
  { arg: 'container', desc: 'specific container (defaults to all)' },
@@ -320,6 +321,18 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
320
321
  { arg: 'timeout_seconds', desc: 'one deadline for resolution and execution; default 30, max 45 seconds; 64 KiB per output stream' },
321
322
  ],
322
323
  },
324
+ {
325
+ name: 'collect_application_evidence',
326
+ localOnly: true,
327
+ desc: 'Read one Pod’s RabbitMQ alarms/resource values, NATS JetStream observations or Vault node state. Local only, with operator approval and Pod-read/port-forward permissions. Unavailable evidence is not a health verdict.',
328
+ params: [
329
+ { arg: 'application', required: true, desc: 'rabbitmq, nats, or vault' },
330
+ { arg: 'namespace', required: true, desc: 'Pod namespace' },
331
+ { arg: 'pod', required: true, desc: 'one explicitly selected Pod' },
332
+ { arg: 'pod_uid', desc: 'expected Pod UID from a diagnosis suggestion' },
333
+ { arg: 'confirm_network_access', required: true, desc: 'true after operator authorization to collect endpoint evidence' },
334
+ ],
335
+ },
323
336
  {
324
337
  name: 'manage_workload',
325
338
  write: true,
@@ -356,13 +369,13 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
356
369
  {
357
370
  name: 'manage_gitops',
358
371
  write: true,
359
- desc: 'Operate on GitOps resources. ArgoCD: sync, refresh, terminate, rollback, suspend, resume. FluxCD: reconcile, sync-with-source, suspend, resume.',
372
+ desc: 'Operate on GitOps resources. Argo CD: sync, refresh, terminate, rollback, suspend, resume. Flux: reconcile, sync-with-source, suspend, resume.',
360
373
  params: [
361
374
  { arg: 'action', required: true, desc: 'sync/reconcile, refresh, terminate, rollback, suspend, or resume' },
362
375
  { arg: 'tool', required: true, desc: 'argocd or fluxcd' },
363
376
  { arg: 'namespace', required: true, desc: 'resource namespace' },
364
377
  { arg: 'name', required: true, desc: 'resource name' },
365
- { arg: 'kind', desc: 'FluxCD resource kind (e.g. kustomization, helmrelease)' },
378
+ { arg: 'kind', desc: 'Flux resource kind (e.g. kustomization, helmrelease)' },
366
379
  ],
367
380
  },
368
381
  {
@@ -191,6 +191,17 @@ describe('issueSubjectState', () => {
191
191
  it('reads an empty answer as unconfirmed when RBAC withheld issues about it', () => {
192
192
  expect(issueSubjectState(subject, [], loaded({ withheld: { issues: 2 } }))).toEqual({ state: 'unconfirmed', why: 'your permissions withhold 2 issues about it' })
193
193
  })
194
+ it('reads an empty answer as unconfirmed when a check about it could not be made for the caller', () => {
195
+ const unchecked = [{ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }] }]
196
+ expect(issueSubjectState(subject, [], loaded({ unchecked_sources: unchecked }))).toEqual({ state: 'unconfirmed', why: "you can't read ClusterQueues, which this check needs" })
197
+ })
198
+ it('keeps unchecked evidence alongside findings and withheld issue counts', () => {
199
+ const found = issue({ kind: 'Job', namespace: 'pg', name: 'main' })
200
+ const unchecked = [{ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }] }]
201
+ expect(issueSubjectState(subject, [], loaded({ issues: [found], withheld: { issues: 1 }, unchecked_sources: unchecked }))).toEqual({
202
+ state: 'found', issues: [found], withheld: 1, uncheckedWhy: "you can't read ClusterQueues, which this check needs",
203
+ })
204
+ })
194
205
  it('reads an empty answer under limited visibility as unconfirmed, never none', () => {
195
206
  expect(issueSubjectState(subject, [], loaded({ visibility: { state: 'degraded', impact: 'Pods are not readable.' } }))).toEqual({ state: 'unconfirmed', why: "some evidence isn't readable (Pods are not readable)" })
196
207
  expect(issueSubjectState(subject, [], loaded({ visibility: { state: 'limited' } }))).toEqual({ state: 'unconfirmed', why: "some evidence isn't readable" })
@@ -25,7 +25,8 @@ import {
25
25
  import { builtinGroupForKind } from "@skyhook-io/k8s-ui/utils/api-resources";
26
26
  import { AlertTriangle } from "lucide-react";
27
27
  import { IssueDiagnoseButton } from "../diagnose/LocalDiagnoseAction";
28
- import { uncheckedSourceLines } from "./uncheckedSources";
28
+ import { recordUsageEvent } from "../../api/usage-data";
29
+ import { uncheckedSourceLines, uncheckedSubjectWhy } from "./uncheckedSources";
29
30
  import { UncheckedSourceHelp } from "./UncheckedSourceHelp";
30
31
 
31
32
  // A capacity-relevant issue links to its Karpenter diagnosis. Karpenter is
@@ -114,7 +115,7 @@ export type IssueSubjectState =
114
115
  | { state: "hidden" }
115
116
  | { state: "checking" }
116
117
  | { state: "unconfirmed"; why: string }
117
- | { state: "found"; issues: Issue[]; withheld: number }
118
+ | { state: "found"; issues: Issue[]; withheld: number; uncheckedWhy?: string }
118
119
  | { state: "none" };
119
120
 
120
121
  /**
@@ -137,7 +138,8 @@ export function issueSubjectState(
137
138
  }
138
139
  const data = related.data;
139
140
  if (related.isLoading || !data) return { state: "checking" };
140
- if (data.issues.length > 0) return { state: "found", issues: data.issues, withheld: data.withheld?.issues ?? 0 };
141
+ const uncheckedWhy = uncheckedSubjectWhy(data.unchecked_sources);
142
+ if (data.issues.length > 0) return { state: "found", issues: data.issues, withheld: data.withheld?.issues ?? 0, ...(uncheckedWhy ? { uncheckedWhy } : {}) };
141
143
  if (data.coverage === "unknownKind") return { state: "unconfirmed", why: "this cluster has no such kind" };
142
144
  if (data.coverage === "notWatched") return { state: "unconfirmed", why: `Radar isn't watching ${subject.kind}` };
143
145
  if (data.coverage === "syncing") return { state: "unconfirmed", why: `Radar is still loading ${subject.kind}` };
@@ -145,6 +147,7 @@ export function issueSubjectState(
145
147
  if (withheld > 0) {
146
148
  return { state: "unconfirmed", why: `your permissions withhold ${withheld} ${withheld === 1 ? "issue" : "issues"} about it` };
147
149
  }
150
+ if (uncheckedWhy) return { state: "unconfirmed", why: uncheckedWhy };
148
151
  const visibility = data.visibility;
149
152
  if (visibility?.state === "degraded" || visibility?.state === "limited") {
150
153
  return {
@@ -235,13 +238,15 @@ export function IssuesPane({
235
238
  return next;
236
239
  });
237
240
 
238
- const onResourceClick = (ref: IssueResourceRef) =>
241
+ const onResourceClick = (ref: IssueResourceRef) => {
242
+ recordUsageEvent({ type: "ui", name: "issue_action:open" });
239
243
  onNavigateToResource({
240
244
  kind: ref.kind,
241
245
  namespace: ref.namespace ?? "",
242
246
  name: ref.name,
243
247
  group: ref.group ?? "",
244
248
  });
249
+ };
245
250
 
246
251
  if (!subject && isLoading) {
247
252
  return <PaneLoader label="Loading issues…" className="flex-1" />;
@@ -373,6 +378,8 @@ export function IssuesPane({
373
378
  {subjectState.state === "unconfirmed" && ` — can't confirm: ${subjectState.why}`}
374
379
  {subjectState.state === "found" && subjectState.withheld > 0 &&
375
380
  ` — your permissions withhold ${subjectState.withheld} more`}
381
+ {subjectState.state === "found" && subjectState.uncheckedWhy &&
382
+ ` — some checks are unconfirmed: ${subjectState.uncheckedWhy}`}
376
383
  </span>
377
384
  )}
378
385
  <button type="button" onClick={clearSubject} className="text-accent-text hover:underline">
@@ -424,7 +431,10 @@ export function IssuesPane({
424
431
  {capacityHref && (
425
432
  <button
426
433
  type="button"
427
- onClick={() => navigate(capacityHref)}
434
+ onClick={() => {
435
+ recordUsageEvent({ type: "ui", name: "issue_action:capacity" });
436
+ navigate(capacityHref);
437
+ }}
428
438
  className="rounded-md border border-theme-border px-2 py-1 text-xs font-medium text-accent-text transition-colors hover:bg-theme-hover"
429
439
  >
430
440
  View in Capacity →
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest'
2
- import { UNKNOWN_SOURCE_LINE, uncheckedSourceLines } from './uncheckedSources'
2
+ import { UNKNOWN_SOURCE_LINE, uncheckedSourceLines, uncheckedSubjectWhy } from './uncheckedSources'
3
3
 
4
4
  describe('uncheckedSourceLines', () => {
5
5
  it('names the kinds still loading', () => {
@@ -32,6 +32,25 @@ describe('uncheckedSourceLines', () => {
32
32
  .toEqual(["Helm releases couldn't be checked because Radar's service account isn't allowed to impersonate users, so failed or stuck releases may be missing."])
33
33
  })
34
34
 
35
+ it('says a Kueue queue check was skipped because the caller cannot read ClusterQueues', () => {
36
+ expect(uncheckedSourceLines([{
37
+ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }],
38
+ }])).toEqual(["You can't read ClusterQueues, so Radar can't tell you whether a queue your runs wait on is stopped on purpose or broken."])
39
+ })
40
+
41
+ it('explains a per-resource gap with or without kinds', () => {
42
+ expect(uncheckedSubjectWhy([{ source: 'kueue', reason: 'caller_access_denied' }])).toBe("you can't read what this check needs")
43
+ expect(uncheckedSubjectWhy([{ source: 'kueue', reason: 'read_failed' }])).toBe("some checks couldn't run")
44
+ expect(uncheckedSubjectWhy(undefined)).toBeUndefined()
45
+ })
46
+
47
+ it('names Kueue kinds Radar could not load', () => {
48
+ expect(uncheckedSourceLines([{ source: 'kueue', reason: 'kind_sync_pending', kinds: [{ group: 'kueue.x-k8s.io', kind: 'LocalQueue' }] }]))
49
+ .toEqual(['Still loading LocalQueues, so their issues may be missing.'])
50
+ expect(uncheckedSourceLines([{ source: 'kueue', reason: 'read_failed' }]))
51
+ .toEqual(["Kueue resources couldn't be checked, so blocked runs and broken queues may be missing."])
52
+ })
53
+
35
54
  it('falls back to the source line for a reason this version does not know', () => {
36
55
  expect(uncheckedSourceLines([{ source: 'karpenter', reason: 'something_new' }]))
37
56
  .toEqual(["Karpenter resources couldn't be checked, so NodePool and NodeClaim issues may be missing."])
@@ -8,6 +8,7 @@ const SOURCE_LINES: Record<string, string> = {
8
8
  resources: "Some resources couldn't be checked, so their issues may be missing.",
9
9
  custom_resources: "Custom resources couldn't be checked, so failing ones may be missing.",
10
10
  karpenter: "Karpenter resources couldn't be checked, so NodePool and NodeClaim issues may be missing.",
11
+ kueue: "Kueue resources couldn't be checked, so blocked runs and broken queues may be missing.",
11
12
  };
12
13
 
13
14
  // For a source this version doesn't know, sent by a newer Radar.
@@ -46,6 +47,11 @@ function kindsLine(source: UncheckedSource): string | undefined {
46
47
  }
47
48
  const names = nameList(kinds);
48
49
  switch (source.reason) {
50
+ case "caller_access_denied":
51
+ if (source.source === "kueue") {
52
+ return `You can't read ${names}, so Radar can't tell you whether a queue your runs wait on is stopped on purpose or broken.`;
53
+ }
54
+ return `You can't read ${names}, so Radar didn't check the issues that depend on them.`;
49
55
  case "kind_sync_pending":
50
56
  return `Still loading ${names}, so their issues may be missing.`;
51
57
  case "kind_sync_failed":
@@ -72,3 +78,15 @@ export function uncheckedSourceLines(sources: IssuesResponse["unchecked_sources"
72
78
  }
73
79
  return unknown ? [...known, UNKNOWN_SOURCE_LINE] : [...known];
74
80
  }
81
+
82
+ /** Why an empty per-resource answer can't be read as "none", for the gaps that name the resource. */
83
+ export function uncheckedSubjectWhy(sources: UncheckedSource[] | undefined): string | undefined {
84
+ const first = sources?.[0];
85
+ if (!first) return undefined;
86
+ const plural = [...new Set((first.kinds ?? []).map((k) => englishPlural(k.kind)))];
87
+ const kinds = plural.length > 0 ? nameList(plural) : undefined;
88
+ if (first.reason === "caller_access_denied") {
89
+ return kinds ? `you can't read ${kinds}, which this check needs` : "you can't read what this check needs";
90
+ }
91
+ return kinds ? `${kinds} couldn't be checked` : "some checks couldn't run";
92
+ }
@@ -0,0 +1,35 @@
1
+ import { KueuePendingPositionValue } from '@skyhook-io/k8s-ui/components/resources/KueuePendingPosition'
2
+ import { getRadarUpgradeRequirement } from '@skyhook-io/k8s-ui'
3
+ import { useKueuePendingPosition } from '../../api/client'
4
+
5
+ interface Props {
6
+ namespace: string
7
+ name: string
8
+ uid?: string
9
+ /** Cache invalidation input; the endpoint reads the current spec.queueName. */
10
+ queueName?: string
11
+ requeueAt?: string
12
+ }
13
+
14
+ /**
15
+ * Kueue's reported position for a Workload eligible for a visibility lookup.
16
+ * Callers render it only for such a Workload; an answer that belongs
17
+ * to another incarnation of the name, or that the server judged ineligible,
18
+ * is never shown.
19
+ */
20
+ export function KueuePendingPosition({ namespace, name, uid, queueName, requeueAt }: Props) {
21
+ const query = useKueuePendingPosition(namespace, name, uid, queueName, true)
22
+ const current = query.data?.uid === uid && query.data?.eligible ? query.data : undefined
23
+ const upgrade = getRadarUpgradeRequirement(query.error) ?? undefined
24
+ const ineligible = query.data?.uid === uid && query.data?.eligible === false
25
+ if (ineligible) return <span className="text-theme-text-tertiary">No pending position to look up for the current Workload state.</span>
26
+ return <KueuePendingPositionValue
27
+ position={current?.position}
28
+ loading={query.isPending}
29
+ error={current ? undefined : query.error?.message}
30
+ refreshFailed={Boolean(current && query.isRefetchError)}
31
+ upgrade={upgrade}
32
+ onRetry={() => { void query.refetch() }}
33
+ requeueAt={requeueAt}
34
+ />
35
+ }