@skyhook-io/radar-app 1.17.0 → 1.18.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 (347) hide show
  1. package/README.md +1 -1
  2. package/package.json +11 -11
  3. package/src/App.tsx +138 -116
  4. package/src/api/actions.errorCode.test.ts +40 -0
  5. package/src/api/actions.test.ts +48 -0
  6. package/src/api/actions.ts +79 -0
  7. package/src/api/apiResources.navigation.test.tsx +232 -0
  8. package/src/api/apiResources.ts +46 -3
  9. package/src/api/client.gitopsPoll.test.ts +99 -0
  10. package/src/api/client.helmPreview.test.tsx +48 -0
  11. package/src/api/client.helmSource.test.ts +39 -0
  12. package/src/api/client.namespaceSwitch.hook.test.tsx +54 -0
  13. package/src/api/client.namespaceSwitch.test.ts +107 -0
  14. package/src/api/client.resourceAvailability.test.ts +24 -0
  15. package/src/api/client.ts +580 -103
  16. package/src/api/client.workloadRuns.test.ts +53 -0
  17. package/src/api/cnpg-ha.live.test.ts +140 -0
  18. package/src/api/cnpg-ha.test.ts +78 -0
  19. package/src/api/cnpg-ha.ts +19 -0
  20. package/src/api/cnpg-history.ts +123 -0
  21. package/src/api/cnpg-inspect.ts +102 -0
  22. package/src/api/cnpg-protection.ts +112 -0
  23. package/src/api/cnpg-recovery.test.tsx +60 -0
  24. package/src/api/cnpg-recovery.ts +262 -0
  25. package/src/api/cnpg-sessions.ts +175 -0
  26. package/src/api/cnpg-storage.ts +138 -0
  27. package/src/api/cnpg.legacy-reads.test.ts +43 -0
  28. package/src/api/cnpg.pooler-runtime.test.ts +15 -0
  29. package/src/api/cnpg.ts +428 -10
  30. package/src/api/config.test.ts +23 -1
  31. package/src/api/config.ts +7 -3
  32. package/src/api/diagnose.ts +4 -1
  33. package/src/api/drain-plan.test.ts +70 -40
  34. package/src/api/policy.ts +5 -5
  35. package/src/api/radarFeatures.render.test.tsx +47 -3
  36. package/src/api/radarFeatures.ts +5 -1
  37. package/src/api/reviewedActionMutation.test.tsx +164 -0
  38. package/src/api/reviewedActionMutation.ts +66 -0
  39. package/src/api/timelineSource.test.ts +9 -0
  40. package/src/api/timelineSource.ts +8 -0
  41. package/src/api/traffic.scope.render.test.tsx +60 -0
  42. package/src/api/traffic.ts +3 -1
  43. package/src/components/audit/AuditView.tsx +9 -0
  44. package/src/components/capacity/CapacityActivity.tsx +3 -31
  45. package/src/components/capacity/CapacityDemand.tsx +4 -36
  46. package/src/components/capacity/CapacityOverview.tsx +217 -56
  47. package/src/components/capacity/CapacityPoolDetail.tsx +6 -55
  48. package/src/components/capacity/CapacityView.test.tsx +323 -0
  49. package/src/components/capacity/ClusterSchedulingCard.tsx +2 -10
  50. package/src/components/capacity/certaintyGlyph.test.tsx +2 -9
  51. package/src/components/capacity/routes.ts +42 -0
  52. package/src/components/capacity/shared.tsx +11 -129
  53. package/src/components/capacity/workspaceRoute.ts +18 -0
  54. package/src/components/cnpg/CNPGActionHost.compatibility.test.tsx +30 -0
  55. package/src/components/cnpg/CNPGArchivingRepair.tsx +191 -0
  56. package/src/components/cnpg/CNPGBlockingSessions.test.tsx +50 -0
  57. package/src/components/cnpg/CNPGBlockingSessions.tsx +333 -0
  58. package/src/components/cnpg/CNPGClusterActivity.test.tsx +11 -0
  59. package/src/components/cnpg/CNPGClusterActivity.tsx +18 -9
  60. package/src/components/cnpg/CNPGClusterLogs.compatibility.test.tsx +130 -0
  61. package/src/components/cnpg/CNPGClusterLogs.empty.test.tsx +29 -0
  62. package/src/components/cnpg/CNPGClusterLogs.test.ts +9 -0
  63. package/src/components/cnpg/CNPGClusterLogs.tsx +81 -24
  64. package/src/components/cnpg/CNPGClusterTabs.test.tsx +152 -0
  65. package/src/components/cnpg/CNPGClusterTabs.tsx +187 -0
  66. package/src/components/cnpg/CNPGClustersKindView.tsx +46 -0
  67. package/src/components/cnpg/CNPGConfiguration.test.tsx +223 -0
  68. package/src/components/cnpg/CNPGConfiguration.tsx +190 -0
  69. package/src/components/cnpg/CNPGCreateClusterDialog.test.tsx +113 -0
  70. package/src/components/cnpg/CNPGCreateClusterDialog.tsx +74 -0
  71. package/src/components/cnpg/CNPGDeclarations.test.ts +107 -0
  72. package/src/components/cnpg/CNPGDeclarations.tsx +236 -78
  73. package/src/components/cnpg/CNPGDetailPage.test.tsx +62 -0
  74. package/src/components/cnpg/CNPGDetailPage.tsx +159 -98
  75. package/src/components/cnpg/CNPGDrawerTrail.tsx +2 -2
  76. package/src/components/cnpg/CNPGInvestigationAction.test.tsx +30 -0
  77. package/src/components/cnpg/CNPGOperator.test.tsx +34 -0
  78. package/src/components/cnpg/CNPGOperator.tsx +78 -30
  79. package/src/components/cnpg/CNPGOperatorBanner.tsx +39 -0
  80. package/src/components/cnpg/CNPGOperatorConditions.test.tsx +45 -0
  81. package/src/components/cnpg/CNPGOperatorConditions.tsx +16 -0
  82. package/src/components/cnpg/CNPGOperatorConfig.test.tsx +27 -0
  83. package/src/components/cnpg/CNPGOperatorDiagnosis.tsx +247 -0
  84. package/src/components/cnpg/CNPGOverview.test.tsx +171 -0
  85. package/src/components/cnpg/CNPGOverview.tsx +238 -63
  86. package/src/components/cnpg/CNPGParametersInEffect.test.tsx +51 -0
  87. package/src/components/cnpg/CNPGParametersInEffect.tsx +120 -0
  88. package/src/components/cnpg/CNPGPerformance.prerequisite.test.tsx +48 -0
  89. package/src/components/cnpg/CNPGPerformance.test.tsx +73 -0
  90. package/src/components/cnpg/CNPGPerformance.tsx +477 -0
  91. package/src/components/cnpg/CNPGPooling.test.tsx +89 -0
  92. package/src/components/cnpg/CNPGPooling.tsx +97 -40
  93. package/src/components/cnpg/CNPGProtection.test.tsx +145 -0
  94. package/src/components/cnpg/CNPGProtection.tsx +228 -122
  95. package/src/components/cnpg/CNPGReplicationTab.test.tsx +87 -0
  96. package/src/components/cnpg/CNPGReplicationTab.tsx +212 -0
  97. package/src/components/cnpg/CNPGReplicationView.tsx +264 -0
  98. package/src/components/cnpg/CNPGStorage.test.tsx +140 -0
  99. package/src/components/cnpg/CNPGStorage.tsx +619 -0
  100. package/src/components/cnpg/CNPGSummaryHost.overview.test.tsx +44 -0
  101. package/src/components/cnpg/CNPGSummaryHost.test.tsx +23 -0
  102. package/src/components/cnpg/CNPGSummaryHost.tsx +230 -55
  103. package/src/components/cnpg/CNPGTrends.denied.test.tsx +33 -0
  104. package/src/components/cnpg/CNPGTrends.missing.test.tsx +69 -0
  105. package/src/components/cnpg/CNPGTrends.test.ts +38 -0
  106. package/src/components/cnpg/CNPGTrends.tsx +702 -0
  107. package/src/components/cnpg/CNPGView.tsx +34 -21
  108. package/src/components/cnpg/CNPGWorkspace.compatibility.test.tsx +90 -0
  109. package/src/components/cnpg/actions/CNPGClusterActions.dialog.test.tsx +79 -0
  110. package/src/components/cnpg/actions/CNPGClusterActions.test.tsx +142 -0
  111. package/src/components/cnpg/actions/CNPGClusterActions.tsx +853 -0
  112. package/src/components/cnpg/actions/CNPGConnectButton.read.test.tsx +40 -0
  113. package/src/components/cnpg/actions/CNPGConnectButton.test.ts +25 -0
  114. package/src/components/cnpg/actions/CNPGConnectButton.tsx +131 -0
  115. package/src/components/cnpg/actions/CNPGDestroyInstanceDialog.tsx +185 -0
  116. package/src/components/cnpg/actions/CNPGInstanceActions.test.tsx +38 -0
  117. package/src/components/cnpg/actions/CNPGInstanceActions.tsx +74 -0
  118. package/src/components/cnpg/actions/CNPGMaintenanceBanner.tsx +53 -0
  119. package/src/components/cnpg/actions/CNPGPoolerActions.test.tsx +35 -0
  120. package/src/components/cnpg/actions/CNPGPoolerActions.tsx +79 -0
  121. package/src/components/cnpg/actions/CNPGReportDialog.test.tsx +12 -0
  122. package/src/components/cnpg/actions/CNPGReportDialog.tsx +91 -0
  123. package/src/components/cnpg/actions/CNPGScheduleActions.run.test.tsx +58 -0
  124. package/src/components/cnpg/actions/CNPGScheduleActions.test.tsx +54 -0
  125. package/src/components/cnpg/actions/CNPGScheduleActions.tsx +208 -0
  126. package/src/components/cnpg/actions/actionModel.test.ts +111 -0
  127. package/src/components/cnpg/actions/actionModel.ts +127 -0
  128. package/src/components/cnpg/actions/renderCNPGHeaderActions.tsx +60 -0
  129. package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +58 -0
  130. package/src/components/cnpg/actions/useOpenCNPGPsql.ts +22 -0
  131. package/src/components/cnpg/archivingRepair.test.ts +104 -0
  132. package/src/components/cnpg/archivingRepair.ts +145 -0
  133. package/src/components/cnpg/baseBackup.test.ts +36 -0
  134. package/src/components/cnpg/baseBackup.ts +36 -0
  135. package/src/components/cnpg/blocking.test.ts +59 -0
  136. package/src/components/cnpg/blocking.ts +131 -0
  137. package/src/components/cnpg/coverageText.test.ts +27 -0
  138. package/src/components/cnpg/creation/CNPGTargetFields.tsx +110 -0
  139. package/src/components/cnpg/creation/targetModel.test.ts +137 -0
  140. package/src/components/cnpg/creation/targetModel.ts +149 -0
  141. package/src/components/cnpg/fleetStatus.test.ts +46 -0
  142. package/src/components/cnpg/fleetStatus.ts +43 -0
  143. package/src/components/cnpg/formFields.ts +2 -0
  144. package/src/components/cnpg/grantText.test.tsx +11 -0
  145. package/src/components/cnpg/host.test.tsx +24 -0
  146. package/src/components/cnpg/host.tsx +101 -0
  147. package/src/components/cnpg/inspectModel.test.ts +120 -0
  148. package/src/components/cnpg/inspectModel.ts +140 -0
  149. package/src/components/cnpg/logicalSlots.test.ts +30 -0
  150. package/src/components/cnpg/logicalSlots.ts +29 -0
  151. package/src/components/cnpg/lsn.test.ts +40 -0
  152. package/src/components/cnpg/lsn.ts +43 -0
  153. package/src/components/cnpg/operations/CNPGFleetOperation.tsx +30 -0
  154. package/src/components/cnpg/operations/CNPGOperationTracker.test.tsx +247 -0
  155. package/src/components/cnpg/operations/CNPGOperationTracker.tsx +255 -0
  156. package/src/components/cnpg/operations/model.test.ts +510 -0
  157. package/src/components/cnpg/operations/model.ts +499 -0
  158. package/src/components/cnpg/operations/presentation.test.ts +80 -0
  159. package/src/components/cnpg/operations/presentation.ts +84 -0
  160. package/src/components/cnpg/operations/store.ts +98 -0
  161. package/src/components/cnpg/operatorStatus.test.ts +134 -0
  162. package/src/components/cnpg/operatorStatus.ts +194 -0
  163. package/src/components/cnpg/paths.test.ts +54 -0
  164. package/src/components/cnpg/paths.ts +47 -4
  165. package/src/components/cnpg/protection/CNPGAttachArchiveDialog.tsx +185 -0
  166. package/src/components/cnpg/protection/CNPGCreateScheduleDialog.tsx +196 -0
  167. package/src/components/cnpg/protection/CNPGProtectionSetup.test.tsx +121 -0
  168. package/src/components/cnpg/protection/CNPGProtectionSetup.tsx +452 -0
  169. package/src/components/cnpg/protection/CNPGScheduleInput.tsx +115 -0
  170. package/src/components/cnpg/protection/CNPGScheduleRepairButton.tsx +120 -0
  171. package/src/components/cnpg/protection/scheduleModel.test.ts +19 -0
  172. package/src/components/cnpg/protection/scheduleModel.ts +16 -0
  173. package/src/components/cnpg/recovery/CNPGRecoveryPoint.tsx +220 -0
  174. package/src/components/cnpg/recovery/CNPGRestoreButton.test.tsx +29 -0
  175. package/src/components/cnpg/recovery/CNPGRestoreButton.tsx +26 -0
  176. package/src/components/cnpg/recovery/CNPGRestoreChecks.test.tsx +23 -0
  177. package/src/components/cnpg/recovery/CNPGRestoreChecks.tsx +153 -0
  178. package/src/components/cnpg/recovery/CNPGRestoreDialog.back.test.tsx +149 -0
  179. package/src/components/cnpg/recovery/CNPGRestoreDialog.test.tsx +46 -0
  180. package/src/components/cnpg/recovery/CNPGRestoreDialog.tsx +333 -0
  181. package/src/components/cnpg/recovery/CNPGRestoreProgress.tsx +182 -0
  182. package/src/components/cnpg/recovery/CNPGRestoreValidation.tsx +216 -0
  183. package/src/components/cnpg/recovery/restoreModel.test.ts +709 -0
  184. package/src/components/cnpg/recovery/restoreModel.ts +685 -0
  185. package/src/components/cnpg/recovery/restoreOperation.ts +56 -0
  186. package/src/components/cnpg/refresh.test.ts +38 -0
  187. package/src/components/cnpg/refresh.ts +17 -0
  188. package/src/components/cnpg/refreshNotice.test.tsx +29 -0
  189. package/src/components/cnpg/routes.test.ts +34 -3
  190. package/src/components/cnpg/routes.ts +60 -48
  191. package/src/components/cnpg/runtimeAssessment.ts +198 -0
  192. package/src/components/cnpg/runtimeModel.test.ts +175 -0
  193. package/src/components/cnpg/runtimeModel.ts +196 -0
  194. package/src/components/cnpg/runtimeParts.test.tsx +17 -0
  195. package/src/components/cnpg/runtimeParts.tsx +79 -0
  196. package/src/components/cnpg/shared.test.tsx +59 -0
  197. package/src/components/cnpg/shared.tsx +100 -182
  198. package/src/components/cnpg/storageModel.test.ts +107 -0
  199. package/src/components/cnpg/storageModel.ts +101 -0
  200. package/src/components/cnpg/trendSamples.test.ts +148 -0
  201. package/src/components/cnpg/trendSamples.ts +222 -0
  202. package/src/components/cnpg/useCNPGClusterAssessment.ts +30 -0
  203. package/src/components/cnpg/useCNPGKubectlContext.test.tsx +45 -0
  204. package/src/components/cnpg/useCNPGKubectlContext.ts +13 -0
  205. package/src/components/cnpg/useCNPGNavigate.test.tsx +58 -0
  206. package/src/components/cnpg/useCNPGNavigate.ts +21 -0
  207. package/src/components/cnpg/useCNPGPoolerLive.ts +46 -0
  208. package/src/components/cnpg/useCNPGScreenParams.ts +24 -0
  209. package/src/components/cnpg/useCNPGSidebarWorkspace.ts +66 -16
  210. package/src/components/cnpg/workspaceRoute.ts +23 -0
  211. package/src/components/cost/ApplicationCostTab.test.ts +7 -0
  212. package/src/components/cost/ApplicationCostTab.tsx +7 -7
  213. package/src/components/cost/CostView.test.ts +2 -1
  214. package/src/components/cost/CostView.tsx +0 -2
  215. package/src/components/cost/WorkloadCostTab.tsx +2 -4
  216. package/src/components/cost/errors.ts +3 -1
  217. package/src/components/cost/source.test.ts +10 -0
  218. package/src/components/cost/source.ts +5 -1
  219. package/src/components/diagnose/DiagnoseSurface.tsx +3 -3
  220. package/src/components/diagnose/InvestigationChangesEvidence.test.tsx +352 -0
  221. package/src/components/diagnose/InvestigationEvidencePane.test.tsx +101 -0
  222. package/src/components/diagnose/InvestigationView.tsx +2 -1
  223. package/src/components/diagnose/investigationEvidence/adapters/changes.test.ts +123 -0
  224. package/src/components/diagnose/investigationEvidence/adapters/changes.ts +192 -3
  225. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +73 -43
  226. package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +64 -2
  227. package/src/components/diagnose/investigationEvidence/adapters/resource.test.ts +37 -0
  228. package/src/components/diagnose/investigationEvidence/adapters/testdata/get-changes-created.json +323 -0
  229. package/src/components/diagnose/investigationEvidence/bodies/streams.tsx +144 -15
  230. package/src/components/diagnose/investigationEvidence/observations.ts +20 -0
  231. package/src/components/diagnose/investigationEvidence/parse.ts +57 -1
  232. package/src/components/diagnose/investigationEvidence/projection.test.ts +123 -0
  233. package/src/components/diagnose/investigationEvidence/types.ts +11 -0
  234. package/src/components/diagnose/investigationEvidencePresentation.test.ts +18 -0
  235. package/src/components/diagnose/investigationState.test.ts +36 -1
  236. package/src/components/diagnose/investigationState.ts +8 -0
  237. package/src/components/diagnose/launch.ts +2 -2
  238. package/src/components/dock/BottomDock.tsx +8 -3
  239. package/src/components/dock/TerminalTab.test.tsx +17 -0
  240. package/src/components/dock/TerminalTab.tsx +7 -3
  241. package/src/components/dock/WorkloadLogsTab.tsx +3 -0
  242. package/src/components/execution/BatchExecutionView.render.test.tsx +29 -1
  243. package/src/components/execution/BatchExecutionView.tsx +23 -8
  244. package/src/components/execution/cluster-template-runs.render.test.tsx +42 -0
  245. package/src/components/gitops/ArgoResourceDiffLoader.tsx +4 -2
  246. package/src/components/gitops/GitOpsView.tsx +23 -23
  247. package/src/components/helm/HelmCompareRoute.test.tsx +59 -0
  248. package/src/components/helm/HelmCompareRoute.tsx +57 -26
  249. package/src/components/helm/HelmReleaseDrawer.test.ts +55 -3
  250. package/src/components/helm/HelmReleaseDrawer.tsx +186 -64
  251. package/src/components/helm/HelmReleaseNotes.test.tsx +42 -0
  252. package/src/components/helm/HelmReleaseNotes.tsx +26 -0
  253. package/src/components/helm/OwnedResources.tsx +2 -2
  254. package/src/components/helm/TrackChartSourceDialog.render.test.tsx +192 -0
  255. package/src/components/helm/TrackChartSourceDialog.test.ts +51 -0
  256. package/src/components/helm/TrackChartSourceDialog.tsx +179 -176
  257. package/src/components/helm/ValuesDiffPreview.tsx +4 -1
  258. package/src/components/helm/ValuesViewer.test.tsx +301 -0
  259. package/src/components/helm/ValuesViewer.tsx +169 -78
  260. package/src/components/home/ActivitySummary.tsx +2 -1
  261. package/src/components/home/ClusterHealthCard.tsx +4 -4
  262. package/src/components/home/CostCard.test.tsx +100 -0
  263. package/src/components/home/CostCard.tsx +2 -2
  264. package/src/components/home/HelmSummary.tsx +2 -2
  265. package/src/components/home/HomeView.tsx +32 -12
  266. package/src/components/home/MCPSetupDialog.test.tsx +30 -0
  267. package/src/components/home/MCPSetupDialog.tsx +13 -6
  268. package/src/components/home/ProblemsPanel.test.tsx +82 -0
  269. package/src/components/home/TopologyPreview.tsx +2 -2
  270. package/src/components/home/mcpToolCatalog.ts +18 -2
  271. package/src/components/issues/IssuesPane.render.test.tsx +143 -0
  272. package/src/components/issues/IssuesPane.test.ts +65 -1
  273. package/src/components/issues/IssuesPane.tsx +213 -26
  274. package/src/components/issues/UncheckedSourceHelp.test.tsx +42 -0
  275. package/src/components/issues/UncheckedSourceHelp.tsx +24 -0
  276. package/src/components/issues/uncheckedSources.test.ts +43 -0
  277. package/src/components/issues/uncheckedSources.ts +74 -0
  278. package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +4 -2
  279. package/src/components/resource/PVCUsageBar.render.test.tsx +32 -0
  280. package/src/components/resource/PVCUsageBar.test.tsx +24 -0
  281. package/src/components/resource/PVCUsageBar.tsx +15 -6
  282. package/src/components/resource/WorkloadMetricsHelpDialog.test.tsx +3 -1
  283. package/src/components/resource/WorkloadMetricsHelpDialog.tsx +1 -1
  284. package/src/components/resources/CompositeRenderer.tsx +4 -4
  285. package/src/components/resources/ImageFilesystemModal.test.tsx +68 -0
  286. package/src/components/resources/ImageFilesystemModal.tsx +11 -4
  287. package/src/components/resources/PodFilesystemModal.tsx +2 -2
  288. package/src/components/resources/ResourceDetailDrawer.tsx +2 -2
  289. package/src/components/resources/ResourcesView.scope.render.test.tsx +58 -0
  290. package/src/components/resources/ResourcesView.tsx +44 -15
  291. package/src/components/resources/renderers/FluxHelmReleaseRenderer.test.tsx +111 -0
  292. package/src/components/resources/renderers/FluxHelmReleaseRenderer.tsx +67 -0
  293. package/src/components/resources/renderers/KyvernoPolicyCoverage.scope.render.test.tsx +64 -0
  294. package/src/components/resources/renderers/KyvernoPolicyCoverage.tsx +6 -7
  295. package/src/components/settings/LocalIntegrationStatus.test.tsx +52 -0
  296. package/src/components/settings/LocalIntegrationStatus.tsx +3 -4
  297. package/src/components/settings/SettingsDialog.tsx +49 -30
  298. package/src/components/timeline/TimelineList.tsx +22 -24
  299. package/src/components/timeline/TimelineLoadError.test.tsx +62 -0
  300. package/src/components/timeline/TimelineLoadError.tsx +96 -0
  301. package/src/components/timeline/TimelineView.tsx +18 -45
  302. package/src/components/timeline/ViewModeToggle.tsx +20 -0
  303. package/src/components/timeline/useStickyError.test.tsx +47 -0
  304. package/src/components/timeline/useStickyError.ts +15 -0
  305. package/src/components/traffic/TrafficFilterSidebar.test.tsx +77 -0
  306. package/src/components/traffic/TrafficFilterSidebar.tsx +42 -31
  307. package/src/components/traffic/TrafficView.tsx +12 -12
  308. package/src/components/traffic/trafficFilters.test.ts +20 -1
  309. package/src/components/traffic/trafficFilters.ts +13 -0
  310. package/src/components/ui/DiagnosticsOverlay.tsx +34 -2
  311. package/src/components/ui/Markdown.test.tsx +65 -0
  312. package/src/components/ui/Markdown.tsx +144 -127
  313. package/src/components/ui/Omnibar.tsx +13 -2
  314. package/src/components/ui/Toast.tsx +1 -1
  315. package/src/components/ui/omnibar-match.test.ts +30 -0
  316. package/src/components/ui/omnibar-match.ts +18 -0
  317. package/src/components/whats-new/releaseNotes.ts +63 -1
  318. package/src/components/workload/CronJobSchedulingEvidence.test.tsx +35 -0
  319. package/src/components/workload/CronJobSchedulingEvidence.tsx +37 -0
  320. package/src/components/workload/NodeDrainStatus.test.tsx +253 -0
  321. package/src/components/workload/NodeDrainStatus.tsx +55 -0
  322. package/src/components/workload/WorkloadView.test.ts +10 -1
  323. package/src/components/workload/WorkloadView.tsx +63 -243
  324. package/src/components/workspace/layout.test.tsx +29 -0
  325. package/src/components/workspace/layout.tsx +259 -0
  326. package/src/components/workspace/table.ts +7 -0
  327. package/src/context/ConnectionContext.test.ts +27 -1
  328. package/src/context/ConnectionContext.tsx +17 -7
  329. package/src/contexts/CapabilitiesContext.tsx +1 -1
  330. package/src/integrations/resourceHost.test.tsx +55 -0
  331. package/src/integrations/resourceHost.ts +99 -0
  332. package/src/integrations/resourceHosts.test.tsx +142 -0
  333. package/src/integrations/resourceHosts.tsx +121 -0
  334. package/src/integrations/workspaceRoute.ts +20 -0
  335. package/src/integrations/workspaceRoutes.test.ts +40 -0
  336. package/src/integrations/workspaceRoutes.ts +22 -0
  337. package/src/integrations/workspaceScreens.tsx +14 -0
  338. package/src/utils/drawer-trail.ts +35 -0
  339. package/src/utils/kindFilterStore.test.ts +147 -0
  340. package/src/utils/kindFilterStore.ts +91 -0
  341. package/src/utils/navigation.test.ts +13 -1
  342. package/src/utils/navigation.ts +53 -2
  343. package/src/utils/page-links.ts +21 -0
  344. package/src/utils/tabStorage.ts +40 -0
  345. package/src/utils/viewMemory.test.ts +78 -0
  346. package/src/utils/viewMemory.ts +54 -0
  347. package/src/utils/wails-clipboard.ts +4 -2
@@ -1,4 +1,4 @@
1
- import { useEffect, useState, useCallback } from 'react'
1
+ import { useEffect, useState, useCallback, useRef } from 'react'
2
2
  import { X, Copy, Check, ExternalLink } from 'lucide-react'
3
3
  import { clsx } from 'clsx'
4
4
  import { TRANSITION_BACKDROP, TRANSITION_PANEL, overlayTransitionStyle } from '../../utils/animation'
@@ -7,15 +7,29 @@ import { useDiagnostics } from '../../api/client'
7
7
  import type { DiagnosticsSnapshot, DiagEnvVar, DiagMetricsSourceHealth, DiagDropRecord, DiagErrorEntry, DiagCacheSyncStatus, DiagInformerSyncStatus, DiagSyncPhase, DiagSampleWindow } from '../../api/client'
8
8
  import { getK8sUIPerfSnapshot, type K8sUIPerfSnapshot } from '@skyhook-io/k8s-ui'
9
9
 
10
+ export type DiagnosticsFocus = 'timeline'
11
+
10
12
  interface DiagnosticsOverlayProps {
11
13
  onClose: () => void
12
14
  isOpen?: boolean
15
+ /** Section to scroll to on open, for callers linking to one specific problem. */
16
+ focus?: DiagnosticsFocus
13
17
  }
14
18
 
15
- export function DiagnosticsOverlay({ onClose, isOpen = true }: DiagnosticsOverlayProps) {
19
+ export function DiagnosticsOverlay({ onClose, isOpen = true, focus }: DiagnosticsOverlayProps) {
16
20
  const { data, isLoading, error } = useDiagnostics(true)
17
21
  const [copied, setCopied] = useState<'json' | 'formatted' | null>(null)
18
22
  const [reportOpened, setReportOpened] = useState(false)
23
+ const timelineRef = useRef<HTMLDivElement>(null)
24
+ const hasData = data != null
25
+
26
+ // Once, when the snapshot first renders: the overlay polls, and re-scrolling
27
+ // on every refresh would yank the reader back while they read other sections.
28
+ useEffect(() => {
29
+ if (isOpen && hasData && focus === 'timeline') {
30
+ timelineRef.current?.scrollIntoView({ block: 'start' })
31
+ }
32
+ }, [isOpen, hasData, focus])
19
33
 
20
34
  // Close on Escape (capture phase) — only while logically open: the overlay
21
35
  // stays mounted through its exit.
@@ -119,6 +133,7 @@ export function DiagnosticsOverlay({ onClose, isOpen = true }: DiagnosticsOverla
119
133
  <CacheSection data={data} />
120
134
  <MetricsSection data={data} />
121
135
  <EventPipelineSection data={data} />
136
+ <div ref={timelineRef} className="scroll-mt-4"><TimelineSection data={data} /></div>
122
137
  <InformersSection data={data} />
123
138
  <PrometheusSection data={data} />
124
139
  <TrafficSection data={data} />
@@ -330,6 +345,20 @@ function EventPipelineSection({ data }: { data: DiagnosticsSnapshot }) {
330
345
  )
331
346
  }
332
347
 
348
+ function TimelineSection({ data }: { data: DiagnosticsSnapshot }) {
349
+ if (!data.timeline) return null
350
+ const t = data.timeline
351
+ return (
352
+ <Section title="Timeline" warn={t.degraded}>
353
+ <Row label="Storage" value={t.storageType} warn={t.degraded} />
354
+ {t.degraded && t.degradedReason && <Row label="Unavailable" value={t.degradedReason} warn />}
355
+ {/* An unreachable database has no count to report; 0 would read as empty. */}
356
+ {(!t.degraded || t.storageType === 'memory') && <Row label="Events" value={t.totalEvents.toLocaleString()} />}
357
+ <Row label="Dropped" value={t.totalDrops.toLocaleString()} warn={t.totalDrops > 0} />
358
+ </Section>
359
+ )
360
+ }
361
+
333
362
  function InformersSection({ data }: { data: DiagnosticsSnapshot }) {
334
363
  if (!data.informers) return null
335
364
  const inf = data.informers
@@ -702,6 +731,9 @@ export function formatForGitHub(data: DiagnosticsSnapshot, frontendPerf?: K8sUIP
702
731
  const t = data.timeline
703
732
  lines.push(`### Timeline`)
704
733
  lines.push(`- Storage: \`${t.storageType}\` | Events: ${t.totalEvents.toLocaleString()} | Errors: ${t.storeErrors} | Drops: ${t.totalDrops}`)
734
+ if (t.degraded && t.degradedReason) {
735
+ lines.push(`- Unavailable: ${t.degradedReason}`)
736
+ }
705
737
  lines.push(``)
706
738
  }
707
739
 
@@ -0,0 +1,65 @@
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 } from 'vitest'
5
+ import { Markdown } from './Markdown'
6
+
7
+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true })
8
+
9
+ const TEXT = 'First paragraph.\n\nRun `kubectl get pods` then open [the docs](https://example.com).\n\n```\nkubectl describe pod x\n```'
10
+
11
+ let container: HTMLDivElement
12
+ let root: Root
13
+
14
+ beforeEach(() => {
15
+ container = document.createElement('div')
16
+ document.body.appendChild(container)
17
+ root = createRoot(container)
18
+ })
19
+
20
+ afterEach(() => {
21
+ act(() => root.unmount())
22
+ container.remove()
23
+ })
24
+
25
+ // Callers pass fresh inline callbacks on every render, as the investigation
26
+ // views do, so the rendered elements must survive a re-render with new ones.
27
+ function render(label: string) {
28
+ act(() => {
29
+ root.render(
30
+ <Markdown
31
+ codeActions={(code) => <button type="button">{`${label}:${code}`}</button>}
32
+ linkRenderer={(href, children) => (href?.includes('example') ? <a data-custom={label}>{children}</a> : null)}
33
+ >
34
+ {TEXT}
35
+ </Markdown>,
36
+ )
37
+ })
38
+ }
39
+
40
+ describe('Markdown', () => {
41
+ it('keeps its rendered elements across parent re-renders', () => {
42
+ render('a')
43
+ const paragraph = container.querySelector('p')
44
+ const pre = container.querySelector('pre')
45
+ expect(paragraph).not.toBeNull()
46
+ expect(pre).not.toBeNull()
47
+
48
+ render('b')
49
+
50
+ expect(container.querySelector('p')).toBe(paragraph)
51
+ expect(container.querySelector('pre')).toBe(pre)
52
+ expect(paragraph?.isConnected).toBe(true)
53
+ })
54
+
55
+ it('applies the latest link and code hooks', () => {
56
+ render('a')
57
+ render('b')
58
+
59
+ expect(container.querySelector('a')?.getAttribute('data-custom')).toBe('b')
60
+ const labels = Array.from(container.querySelectorAll('button')).map((b) => b.textContent?.trim())
61
+ expect(labels).toContain('b:kubectl get pods')
62
+ expect(labels).toContain('b:kubectl describe pod x')
63
+ expect(labels.some((l) => l?.startsWith('a:'))).toBe(false)
64
+ })
65
+ })
@@ -1,12 +1,11 @@
1
- import ReactMarkdown from 'react-markdown'
1
+ import { createContext, useContext, useMemo } from 'react'
2
+ import ReactMarkdown, { type Components } from 'react-markdown'
2
3
  import remarkGfm from 'remark-gfm'
3
4
  import { clsx } from 'clsx'
4
5
 
5
6
  import type { ReactNode } from 'react'
6
7
 
7
- interface MarkdownProps {
8
- children: string
9
- className?: string
8
+ interface MarkdownHooks {
10
9
  /**
11
10
  * Intercepts links before the default anchor renders. Return null to fall
12
11
  * through. Lets a caller turn a reserved href (an in-page evidence
@@ -16,132 +15,150 @@ interface MarkdownProps {
16
15
  codeActions?: (code: string) => ReactNode
17
16
  }
18
17
 
18
+ interface MarkdownProps extends MarkdownHooks {
19
+ children: string
20
+ className?: string
21
+ }
22
+
23
+ const MarkdownHooksContext = createContext<MarkdownHooks>({})
24
+
25
+ const REMARK_PLUGINS = [remarkGfm]
26
+
27
+ // Module-level so every render hands react-markdown the same component types.
28
+ // A fresh map per render makes React unmount and remount the whole rendered
29
+ // tree whenever the parent re-renders; WebKit then moves the scroll position
30
+ // of any pane the text sits in. Per-call hooks arrive through context instead.
31
+ const COMPONENTS: Components = {
32
+ h1: ({ children }) => (
33
+ <h1 className="text-lg font-bold text-theme-text-primary mt-4 mb-2 first:mt-0">{children}</h1>
34
+ ),
35
+ h2: ({ children }) => (
36
+ <h2 className="text-base font-semibold text-theme-text-primary mt-4 mb-2 first:mt-0">{children}</h2>
37
+ ),
38
+ h3: ({ children }) => (
39
+ <h3 className="text-sm font-semibold text-theme-text-primary mt-3 mb-1.5">{children}</h3>
40
+ ),
41
+ h4: ({ children }) => (
42
+ <h4 className="text-sm font-medium text-theme-text-primary mt-2 mb-1">{children}</h4>
43
+ ),
44
+ p: ({ children }) => (
45
+ <p className="text-theme-text-secondary my-2 leading-relaxed">{children}</p>
46
+ ),
47
+ a: function MarkdownLink({ href, children }) {
48
+ const { linkRenderer } = useContext(MarkdownHooksContext)
49
+ const custom = linkRenderer?.(href, children)
50
+ if (custom !== null && custom !== undefined) return <>{custom}</>
51
+ return (
52
+ <a
53
+ href={href}
54
+ target="_blank"
55
+ rel="noopener noreferrer"
56
+ className="text-blue-400 hover:text-blue-300 underline underline-offset-2"
57
+ >
58
+ {children}
59
+ </a>
60
+ )
61
+ },
62
+ ul: ({ children }) => (
63
+ <ul className="list-disc list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ul>
64
+ ),
65
+ ol: ({ children }) => (
66
+ <ol className="list-decimal list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ol>
67
+ ),
68
+ li: ({ children }) => (
69
+ <li className="leading-relaxed">{children}</li>
70
+ ),
71
+ code: function MarkdownCode({ className, children }) {
72
+ const { codeActions } = useContext(MarkdownHooksContext)
73
+ const isInline = !className
74
+ if (isInline) {
75
+ const actions = codeActions?.(String(children))
76
+ if (actions) {
77
+ return (
78
+ <span className="inline-flex max-w-full items-start gap-1 align-middle">
79
+ <code className="inline-code min-w-0">{children}</code>
80
+ {actions}
81
+ </span>
82
+ )
83
+ }
84
+ return (
85
+ <code className="inline-code">
86
+ {children}
87
+ </code>
88
+ )
89
+ }
90
+ return (
91
+ <code className="block font-mono text-theme-text-secondary">{children}</code>
92
+ )
93
+ },
94
+ pre: function MarkdownPre({ children, node }) {
95
+ const { codeActions } = useContext(MarkdownHooksContext)
96
+ const code = node?.children[0]
97
+ const text = code?.type === 'element'
98
+ ? code.children.filter(child => child.type === 'text').map(child => child.value).join('')
99
+ : ''
100
+ const actions = codeActions?.(text)
101
+ if (actions) {
102
+ // Render the code directly so an unlabelled fence does not also
103
+ // receive the inline-code action. Only the code scrolls, not Copy.
104
+ return (
105
+ <pre className="my-3 flex items-start gap-2 rounded-lg bg-theme-elevated p-3 text-xs font-mono text-theme-text-secondary">
106
+ <code className="min-w-0 flex-1 overflow-x-auto">{text}</code>
107
+ {actions}
108
+ </pre>
109
+ )
110
+ }
111
+ return (
112
+ <pre className="my-3 p-3 bg-theme-elevated rounded-lg overflow-x-auto text-xs font-mono text-theme-text-secondary">
113
+ {children}
114
+ </pre>
115
+ )
116
+ },
117
+ blockquote: ({ children }) => (
118
+ <blockquote className="border-l-2 border-theme-border pl-3 my-2 text-theme-text-tertiary italic">
119
+ {children}
120
+ </blockquote>
121
+ ),
122
+ table: ({ children }) => (
123
+ <div className="my-3 overflow-x-auto">
124
+ <table className="min-w-full border-collapse text-sm">{children}</table>
125
+ </div>
126
+ ),
127
+ thead: ({ children }) => (
128
+ <thead className="bg-theme-elevated">{children}</thead>
129
+ ),
130
+ tbody: ({ children }) => (
131
+ <tbody className="divide-y divide-theme-border">{children}</tbody>
132
+ ),
133
+ tr: ({ children }) => (
134
+ <tr className="border-b border-theme-border">{children}</tr>
135
+ ),
136
+ th: ({ children }) => (
137
+ <th className="px-3 py-2 text-left text-theme-text-primary font-medium border border-theme-border">
138
+ {children}
139
+ </th>
140
+ ),
141
+ td: ({ children }) => (
142
+ <td className="px-3 py-2 text-theme-text-secondary border border-theme-border">{children}</td>
143
+ ),
144
+ hr: () => <hr className="my-4 border-theme-border" />,
145
+ strong: ({ children }) => (
146
+ <strong className="font-semibold text-theme-text-primary">{children}</strong>
147
+ ),
148
+ em: ({ children }) => (
149
+ <em className="italic">{children}</em>
150
+ ),
151
+ }
152
+
19
153
  export function Markdown({ children, className, linkRenderer, codeActions }: MarkdownProps) {
154
+ const hooks = useMemo(() => ({ linkRenderer, codeActions }), [linkRenderer, codeActions])
20
155
  return (
21
156
  <div className={clsx('markdown-content', className)}>
22
- <ReactMarkdown
23
- remarkPlugins={[remarkGfm]}
24
- components={{
25
- h1: ({ children }) => (
26
- <h1 className="text-lg font-bold text-theme-text-primary mt-4 mb-2 first:mt-0">{children}</h1>
27
- ),
28
- h2: ({ children }) => (
29
- <h2 className="text-base font-semibold text-theme-text-primary mt-4 mb-2 first:mt-0">{children}</h2>
30
- ),
31
- h3: ({ children }) => (
32
- <h3 className="text-sm font-semibold text-theme-text-primary mt-3 mb-1.5">{children}</h3>
33
- ),
34
- h4: ({ children }) => (
35
- <h4 className="text-sm font-medium text-theme-text-primary mt-2 mb-1">{children}</h4>
36
- ),
37
- p: ({ children }) => (
38
- <p className="text-theme-text-secondary my-2 leading-relaxed">{children}</p>
39
- ),
40
- a: ({ href, children }) => {
41
- const custom = linkRenderer?.(href, children)
42
- if (custom !== null && custom !== undefined) return <>{custom}</>
43
- return (
44
- <a
45
- href={href}
46
- target="_blank"
47
- rel="noopener noreferrer"
48
- className="text-blue-400 hover:text-blue-300 underline underline-offset-2"
49
- >
50
- {children}
51
- </a>
52
- )
53
- },
54
- ul: ({ children }) => (
55
- <ul className="list-disc list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ul>
56
- ),
57
- ol: ({ children }) => (
58
- <ol className="list-decimal list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ol>
59
- ),
60
- li: ({ children }) => (
61
- <li className="leading-relaxed">{children}</li>
62
- ),
63
- code: ({ className, children }) => {
64
- const isInline = !className
65
- if (isInline) {
66
- const actions = codeActions?.(String(children))
67
- if (actions) {
68
- return (
69
- <span className="inline-flex max-w-full items-start gap-1 align-middle">
70
- <code className="inline-code min-w-0">{children}</code>
71
- {actions}
72
- </span>
73
- )
74
- }
75
- return (
76
- <code className="inline-code">
77
- {children}
78
- </code>
79
- )
80
- }
81
- return (
82
- <code className="block font-mono text-theme-text-secondary">{children}</code>
83
- )
84
- },
85
- pre: ({ children, node }) => {
86
- const code = node?.children[0]
87
- const text = code?.type === 'element'
88
- ? code.children.filter(child => child.type === 'text').map(child => child.value).join('')
89
- : ''
90
- const actions = codeActions?.(text)
91
- if (actions) {
92
- // Render the code directly so an unlabelled fence does not also
93
- // receive the inline-code action. Only the code scrolls, not Copy.
94
- return (
95
- <pre className="my-3 flex items-start gap-2 rounded-lg bg-theme-elevated p-3 text-xs font-mono text-theme-text-secondary">
96
- <code className="min-w-0 flex-1 overflow-x-auto">{text}</code>
97
- {actions}
98
- </pre>
99
- )
100
- }
101
- return (
102
- <pre className="my-3 p-3 bg-theme-elevated rounded-lg overflow-x-auto text-xs font-mono text-theme-text-secondary">
103
- {children}
104
- </pre>
105
- )
106
- },
107
- blockquote: ({ children }) => (
108
- <blockquote className="border-l-2 border-theme-border pl-3 my-2 text-theme-text-tertiary italic">
109
- {children}
110
- </blockquote>
111
- ),
112
- table: ({ children }) => (
113
- <div className="my-3 overflow-x-auto">
114
- <table className="min-w-full border-collapse text-sm">{children}</table>
115
- </div>
116
- ),
117
- thead: ({ children }) => (
118
- <thead className="bg-theme-elevated">{children}</thead>
119
- ),
120
- tbody: ({ children }) => (
121
- <tbody className="divide-y divide-theme-border">{children}</tbody>
122
- ),
123
- tr: ({ children }) => (
124
- <tr className="border-b border-theme-border">{children}</tr>
125
- ),
126
- th: ({ children }) => (
127
- <th className="px-3 py-2 text-left text-theme-text-primary font-medium border border-theme-border">
128
- {children}
129
- </th>
130
- ),
131
- td: ({ children }) => (
132
- <td className="px-3 py-2 text-theme-text-secondary border border-theme-border">{children}</td>
133
- ),
134
- hr: () => <hr className="my-4 border-theme-border" />,
135
- strong: ({ children }) => (
136
- <strong className="font-semibold text-theme-text-primary">{children}</strong>
137
- ),
138
- em: ({ children }) => (
139
- <em className="italic">{children}</em>
140
- ),
141
- }}
142
- >
143
- {children}
144
- </ReactMarkdown>
157
+ <MarkdownHooksContext.Provider value={hooks}>
158
+ <ReactMarkdown remarkPlugins={REMARK_PLUGINS} components={COMPONENTS}>
159
+ {children}
160
+ </ReactMarkdown>
161
+ </MarkdownHooksContext.Provider>
145
162
  </div>
146
163
  )
147
164
  }
@@ -7,6 +7,7 @@ import { TRANSITION_BACKDROP, TRANSITION_MENU, TW_EASE_UI, overlayExitMs, overla
7
7
  import { SearchPillInput, type SearchModifier } from '@skyhook-io/k8s-ui'
8
8
  import { getResourceIcon } from '../../utils/resource-icons'
9
9
  import type { SearchHit, SearchMatchedField } from '../../api/client'
10
+ import { contentMatchLabel, partialSearchNotice } from './omnibar-match'
10
11
  import { recordUsageEvent } from '../../api/usage-data'
11
12
  import { bestScore, type CommandItem } from './command-items'
12
13
  import { SearchSyntaxHelp } from './SearchSyntaxHelp'
@@ -28,6 +29,10 @@ export interface OmnibarSearchResult {
28
29
  hits: SearchHit[]
29
30
  total?: number
30
31
  total_matched?: number
32
+ /** "time_limit" when scan report findings were only partly searched. */
33
+ incomplete_findings?: string
34
+ /** Some namespaces' scan reports were left out, access not confirmed yet. */
35
+ access_incomplete?: boolean
31
36
  }
32
37
 
33
38
  // Health → dot color (summaryContext.health is the same vocabulary as the rest
@@ -424,6 +429,7 @@ export const Omnibar = forwardRef<OmnibarHandle, OmnibarProps>(function Omnibar(
424
429
  const mac = typeof navigator !== 'undefined' && navigator.platform.includes('Mac')
425
430
  const total = searchData?.total ?? 0
426
431
  const totalMatched = searchData?.total_matched ?? 0
432
+ const partialNotice = partialSearchNotice(searchData)
427
433
  const hasNsPill = pills.some((p) => p.key === 'ns')
428
434
  const dropdownOpen = open && !suggesting && (rows.length > 0 || searchActive)
429
435
  // Presence: the scrim and the results panel are menu-kind overlays (140ms
@@ -491,6 +497,11 @@ export const Omnibar = forwardRef<OmnibarHandle, OmnibarProps>(function Omnibar(
491
497
  <ResourceRow key={row.id} hit={row.hit} stale={resourcesStale} selected={row.id === selectedId} onSelect={() => selectRow(row.id)} onActivate={() => { if (!resourcesStale) execute(row) }} />
492
498
  ))
493
499
  )}
500
+ {!isFetching && !isError && partialNotice && (
501
+ <div className="flex items-start gap-2 px-3 py-1.5 text-[11px] text-amber-600 dark:text-amber-400">
502
+ <AlertTriangle className="w-3 h-3 mt-0.5 shrink-0" /> {partialNotice}
503
+ </div>
504
+ )}
494
505
  </>
495
506
  )}
496
507
 
@@ -614,7 +625,7 @@ function ResourceRow({ hit, selected, stale, onSelect, onActivate }: { hit: Sear
614
625
  const Icon = getResourceIcon(hit.kind)
615
626
  const dot = healthDot(hit.summaryContext?.health)
616
627
  const issues = hit.summaryContext?.issueCount ?? 0
617
- const contentOnly = !!hit.matched?.length && hit.matched.every((m) => m.site.startsWith('content:'))
628
+ const contentLabel = contentMatchLabel(hit.matched)
618
629
  return (
619
630
  <button
620
631
  data-selected={selected}
@@ -630,7 +641,7 @@ function ResourceRow({ hit, selected, stale, onSelect, onActivate }: { hit: Sear
630
641
  {hit.namespace ? <> · {highlight(hit.namespace, tokensForSite(hit.matched, 'namespace'))}</> : ''}
631
642
  {hit.clusterName ? <> · <span className="text-theme-text-secondary">{hit.clusterName}</span></> : ''}
632
643
  </span>
633
- {contentOnly && <span className="shrink-0 text-[10px] text-theme-text-tertiary italic">in spec</span>}
644
+ {contentLabel && <span className="shrink-0 text-[10px] text-theme-text-tertiary italic">{contentLabel}</span>}
634
645
  {issues > 0 && <span className="ml-auto shrink-0 text-[10px] font-medium text-amber-600 dark:text-amber-400">{issues} issue{issues === 1 ? '' : 's'}</span>}
635
646
  </button>
636
647
  )
@@ -1 +1 @@
1
- export { ToastProvider, useToast, showApiError, showApiSuccess } from '@skyhook-io/k8s-ui'
1
+ export { ToastProvider, useToast, showApiError, showApiSuccess, showApiNotice } from '@skyhook-io/k8s-ui'
@@ -0,0 +1,30 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { contentMatchLabel, partialSearchNotice } from './omnibar-match'
3
+
4
+ const site = (s: string) => ({ token: 't', site: s, score: 12 })
5
+
6
+ describe('contentMatchLabel', () => {
7
+ it('names a match inside Trivy findings', () => {
8
+ expect(contentMatchLabel([site('content:report.vulnerabilities[3]')])).toBe('in findings')
9
+ })
10
+ it('keeps "in spec" for other content', () => {
11
+ expect(contentMatchLabel([site('content:spec.template.spec.containers[0].env[1].value')])).toBe('in spec')
12
+ expect(contentMatchLabel([site('content:report.checks[0]'), site('content:spec.x')])).toBe('in spec')
13
+ })
14
+ it('is empty when any token matched identity', () => {
15
+ expect(contentMatchLabel([site('content:report.vulnerabilities[0]'), site('name')])).toBe('')
16
+ expect(contentMatchLabel([])).toBe('')
17
+ expect(contentMatchLabel(undefined)).toBe('')
18
+ })
19
+ })
20
+
21
+ describe('partialSearchNotice', () => {
22
+ it('flags partly searched findings and unchecked namespaces', () => {
23
+ expect(partialSearchNotice({ incomplete_findings: 'time_limit' })).toMatch(/not fully searched/)
24
+ expect(partialSearchNotice({ access_incomplete: true })).toMatch(/not fully searched/)
25
+ })
26
+ it('is null for a whole result or an older Radar', () => {
27
+ expect(partialSearchNotice({})).toBeNull()
28
+ expect(partialSearchNotice(undefined)).toBeNull()
29
+ })
30
+ })
@@ -0,0 +1,18 @@
1
+ import type { SearchMatchedField } from '../../api/client'
2
+
3
+ // contentMatchLabel names where a hit matched when every token landed in the
4
+ // object's content rather than its name, kind or namespace. Trivy Operator
5
+ // reports keep their findings under `report`, not a spec.
6
+ export function contentMatchLabel(matched: SearchMatchedField[] | undefined): string {
7
+ if (!matched?.length || !matched.every((m) => m.site.startsWith('content:'))) return ''
8
+ return matched.every((m) => m.site.startsWith('content:report.')) ? 'in findings' : 'in spec'
9
+ }
10
+
11
+ // partialSearchNotice explains a result the server says is incomplete, so a
12
+ // missing CVE doesn't read as "not affected". Null when the search was whole.
13
+ export function partialSearchNotice(data: { incomplete_findings?: string; access_incomplete?: boolean } | undefined): string | null {
14
+ if (data?.incomplete_findings || data?.access_incomplete) {
15
+ return 'Some scan reports were not fully searched. Try again, or narrow with ns:.'
16
+ }
17
+ return null
18
+ }
@@ -1,5 +1,5 @@
1
1
  import type { LucideIcon } from 'lucide-react'
2
- import { Bot, GitCompareArrows, Layers, Network, RefreshCcw, Scale, ScrollText, SlidersHorizontal } from 'lucide-react'
2
+ import { Bot, Database, GitCompareArrows, HardDrive, Hourglass, Layers, Network, RefreshCcw, Scale, ScrollText, SlidersHorizontal, Undo2 } from 'lucide-react'
3
3
  import { compareVersions } from '../../utils/version'
4
4
 
5
5
  export interface ReleaseHighlight {
@@ -47,6 +47,68 @@ export const CHANGELOG_URL = 'https://radarhq.io/changelog'
47
47
  // major release must have its own entry: scripts/check-whats-new.sh refuses to
48
48
  // release one without it.
49
49
  export const RELEASE_NOTES: ReleaseNotes[] = [
50
+ {
51
+ version: 'v1.17.0',
52
+ highlights: [
53
+ {
54
+ id: 'cloudnative-pg',
55
+ icon: Database,
56
+ title: 'CloudNativePG, end to end',
57
+ description: 'See which Postgres cluster needs attention and why, whether its backups would restore, and switch over, fence or restore with a review first.',
58
+ leadDescription: 'New views for CloudNativePG show which Postgres cluster needs attention and why, what each instance is doing, and whether its backups would actually let you restore. Create, restore, back up, switch over, fence and hibernate from Radar: you review exactly what will be written, then Radar follows the operation until it sees the outcome.',
59
+ importance: 9,
60
+ path: '/cnpg',
61
+ cta: 'Open CloudNativePG',
62
+ },
63
+ {
64
+ id: 'live-traffic-large-clusters',
65
+ icon: Network,
66
+ title: 'Live Traffic on large Cilium clusters',
67
+ description: 'Traffic is drawn per workload and stays fast on big clusters. Focus on one workload, or get a connection list when the map is too big.',
68
+ importance: 7,
69
+ path: '/traffic',
70
+ cta: 'Open Live Traffic',
71
+ },
72
+ {
73
+ id: 'gitops-revert-warnings',
74
+ icon: Undo2,
75
+ title: 'Know before an edit gets reverted',
76
+ description: 'Before Radar edits an object owned by Argo CD, Flux or Helm, it tells you whether the owner will undo the change.',
77
+ importance: 6,
78
+ },
79
+ {
80
+ id: 'stuck-deletion-issues',
81
+ icon: Hourglass,
82
+ title: 'Issues for stuck deletions',
83
+ description: "Helm uninstalls and custom resources stuck deleting raise issues, and so do volumes that can't attach to their node's machine type.",
84
+ importance: 6,
85
+ path: '/issues',
86
+ cta: 'Open Issues',
87
+ },
88
+ {
89
+ id: 'audit-unused-storage',
90
+ icon: HardDrive,
91
+ title: 'Cluster Audit finds unused storage',
92
+ description: 'Claims nothing uses, claims Pending for over a day, and Released PersistentVolumes, with their size and storage class.',
93
+ // Below v1.16's headline at its 0.75 weight, so an upgrade from v1.15
94
+ // still shows that card.
95
+ importance: 4,
96
+ path: '/checks',
97
+ cta: 'Open Checks',
98
+ },
99
+ ],
100
+ improvements: [
101
+ // The grid fills row by row: pair lines of similar length.
102
+ "Capacity explains why a node pool isn't scaling down",
103
+ 'Nodes being removed show as removed, not failed',
104
+ 'Helm actions on Flux releases change the right objects',
105
+ 'Flux Sync with source matches flux reconcile --with-source',
106
+ 'Topology links Services only to the Pods they select',
107
+ 'Namespaces stuck Terminating show what holds them',
108
+ 'Filters stay put when you switch kinds or sections',
109
+ 'Skip an audit check per resource with an annotation',
110
+ ],
111
+ },
50
112
  {
51
113
  version: 'v1.16.0',
52
114
  highlights: [
@@ -0,0 +1,35 @@
1
+ import { renderToStaticMarkup } from 'react-dom/server'
2
+ import { describe, expect, it } from 'vitest'
3
+ import { CronJobSchedulingContext, CronJobSchedulingDetails } from './CronJobSchedulingEvidence'
4
+ import type { CronJobSchedulingEvidence } from '../../api/client'
5
+
6
+ const report: CronJobSchedulingEvidence = {
7
+ uid: 'current-cronjob', state: 'reported', reason: 'InvalidSchedule',
8
+ message: 'original report from Kubernetes', last_reported_at: '2026-10-21T08:00:00Z',
9
+ }
10
+
11
+ describe('CronJob scheduling evidence', () => {
12
+ it('does not duplicate an operational report with a second notice', () => {
13
+ expect(renderToStaticMarkup(<CronJobSchedulingContext evidence={report} onViewTimeline={() => {}} />)).toBe('')
14
+ })
15
+ it('makes an edited future schedule neutral and keeps its evidence accessible', () => {
16
+ const html = renderToStaticMarkup(<CronJobSchedulingContext evidence={{ ...report, state: 'configuration_changed', configuration_changed_at: '2026-10-21T08:05:00Z' }} onViewTimeline={() => {}} />)
17
+ expect(html).toContain('Schedule changed after this error')
18
+ expect(html).toContain('Kubernetes has not recorded a scheduled run since the change.')
19
+ expect(html).toContain('Earlier report')
20
+ expect(html).toContain(report.message)
21
+ expect(html).toContain('View timeline')
22
+ expect(html).not.toContain('Operational issues')
23
+ expect(html).not.toContain('Warning')
24
+ })
25
+ it('does not call incomplete history recovery or a confirmed current failure', () => {
26
+ const html = renderToStaticMarkup(<CronJobSchedulingContext evidence={{ ...report, state: 'history_incomplete', history_incomplete: true }} onViewTimeline={() => {}} />)
27
+ expect(html).toContain('Scheduling history is incomplete')
28
+ expect(html).toContain('cannot establish whether it still applies')
29
+ })
30
+ it('provides the report date and existing timeline navigation in expanded evidence', () => {
31
+ const html = renderToStaticMarkup(<CronJobSchedulingDetails evidence={report} onViewTimeline={() => {}} />)
32
+ expect(html).toContain('Last reported')
33
+ expect(html).toContain('View timeline')
34
+ })
35
+ })