@skyhook-io/radar-app 1.17.1 → 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 (95) hide show
  1. package/package.json +9 -9
  2. package/src/App.tsx +14 -30
  3. package/src/api/client.gitopsPoll.test.ts +99 -0
  4. package/src/api/client.helmPreview.test.tsx +48 -0
  5. package/src/api/client.resourceAvailability.test.ts +24 -0
  6. package/src/api/client.ts +337 -87
  7. package/src/api/client.workloadRuns.test.ts +53 -0
  8. package/src/api/config.test.ts +23 -1
  9. package/src/api/config.ts +7 -3
  10. package/src/api/diagnose.ts +4 -1
  11. package/src/api/drain-plan.test.ts +70 -40
  12. package/src/api/policy.ts +5 -5
  13. package/src/api/radarFeatures.ts +1 -0
  14. package/src/api/traffic.scope.render.test.tsx +60 -0
  15. package/src/api/traffic.ts +3 -1
  16. package/src/components/cnpg/CNPGSummaryHost.tsx +4 -3
  17. package/src/components/diagnose/DiagnoseSurface.tsx +3 -3
  18. package/src/components/diagnose/InvestigationChangesEvidence.test.tsx +352 -0
  19. package/src/components/diagnose/InvestigationEvidencePane.test.tsx +101 -0
  20. package/src/components/diagnose/InvestigationView.tsx +2 -1
  21. package/src/components/diagnose/investigationEvidence/adapters/changes.test.ts +123 -0
  22. package/src/components/diagnose/investigationEvidence/adapters/changes.ts +192 -3
  23. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +73 -51
  24. package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +64 -2
  25. package/src/components/diagnose/investigationEvidence/adapters/resource.test.ts +37 -0
  26. package/src/components/diagnose/investigationEvidence/adapters/testdata/get-changes-created.json +323 -0
  27. package/src/components/diagnose/investigationEvidence/bodies/streams.tsx +144 -15
  28. package/src/components/diagnose/investigationEvidence/observations.ts +20 -0
  29. package/src/components/diagnose/investigationEvidence/parse.ts +57 -1
  30. package/src/components/diagnose/investigationEvidence/projection.test.ts +107 -0
  31. package/src/components/diagnose/investigationEvidence/types.ts +11 -0
  32. package/src/components/diagnose/investigationEvidencePresentation.test.ts +18 -0
  33. package/src/components/diagnose/investigationState.test.ts +36 -1
  34. package/src/components/diagnose/investigationState.ts +8 -0
  35. package/src/components/diagnose/launch.ts +2 -2
  36. package/src/components/dock/BottomDock.tsx +6 -3
  37. package/src/components/dock/WorkloadLogsTab.tsx +3 -0
  38. package/src/components/execution/BatchExecutionView.render.test.tsx +29 -1
  39. package/src/components/execution/BatchExecutionView.tsx +23 -8
  40. package/src/components/execution/cluster-template-runs.render.test.tsx +42 -0
  41. package/src/components/gitops/GitOpsView.tsx +7 -0
  42. package/src/components/helm/HelmReleaseDrawer.tsx +139 -55
  43. package/src/components/helm/HelmReleaseNotes.test.tsx +42 -0
  44. package/src/components/helm/HelmReleaseNotes.tsx +26 -0
  45. package/src/components/helm/OwnedResources.tsx +2 -2
  46. package/src/components/helm/TrackChartSourceDialog.render.test.tsx +76 -4
  47. package/src/components/helm/TrackChartSourceDialog.test.ts +3 -2
  48. package/src/components/helm/TrackChartSourceDialog.tsx +41 -15
  49. package/src/components/helm/ValuesDiffPreview.tsx +4 -1
  50. package/src/components/home/ClusterHealthCard.tsx +4 -4
  51. package/src/components/home/CostCard.test.tsx +100 -0
  52. package/src/components/home/CostCard.tsx +2 -2
  53. package/src/components/home/HelmSummary.tsx +2 -2
  54. package/src/components/home/HomeView.tsx +15 -6
  55. package/src/components/home/MCPSetupDialog.test.tsx +30 -0
  56. package/src/components/home/MCPSetupDialog.tsx +13 -6
  57. package/src/components/home/ProblemsPanel.test.tsx +1 -0
  58. package/src/components/home/mcpToolCatalog.ts +18 -2
  59. package/src/components/issues/IssuesPane.render.test.tsx +21 -0
  60. package/src/components/issues/IssuesPane.tsx +31 -7
  61. package/src/components/issues/UncheckedSourceHelp.test.tsx +42 -0
  62. package/src/components/issues/UncheckedSourceHelp.tsx +24 -0
  63. package/src/components/issues/uncheckedSources.test.ts +43 -0
  64. package/src/components/issues/uncheckedSources.ts +58 -5
  65. package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +4 -2
  66. package/src/components/resources/ImageFilesystemModal.test.tsx +68 -0
  67. package/src/components/resources/ImageFilesystemModal.tsx +11 -4
  68. package/src/components/resources/PodFilesystemModal.tsx +2 -2
  69. package/src/components/resources/ResourcesView.scope.render.test.tsx +58 -0
  70. package/src/components/resources/ResourcesView.tsx +18 -3
  71. package/src/components/resources/renderers/FluxHelmReleaseRenderer.test.tsx +111 -0
  72. package/src/components/resources/renderers/FluxHelmReleaseRenderer.tsx +67 -0
  73. package/src/components/resources/renderers/KyvernoPolicyCoverage.scope.render.test.tsx +64 -0
  74. package/src/components/resources/renderers/KyvernoPolicyCoverage.tsx +6 -7
  75. package/src/components/settings/SettingsDialog.tsx +21 -15
  76. package/src/components/traffic/TrafficFilterSidebar.test.tsx +77 -0
  77. package/src/components/traffic/TrafficFilterSidebar.tsx +42 -31
  78. package/src/components/traffic/TrafficView.tsx +12 -12
  79. package/src/components/traffic/trafficFilters.test.ts +20 -1
  80. package/src/components/traffic/trafficFilters.ts +13 -0
  81. package/src/components/ui/Omnibar.tsx +13 -2
  82. package/src/components/ui/Toast.tsx +1 -1
  83. package/src/components/ui/omnibar-match.test.ts +30 -0
  84. package/src/components/ui/omnibar-match.ts +18 -0
  85. package/src/components/workload/CronJobSchedulingEvidence.test.tsx +35 -0
  86. package/src/components/workload/CronJobSchedulingEvidence.tsx +37 -0
  87. package/src/components/workload/NodeDrainStatus.test.tsx +253 -0
  88. package/src/components/workload/NodeDrainStatus.tsx +55 -0
  89. package/src/components/workload/WorkloadView.tsx +37 -5
  90. package/src/context/ConnectionContext.test.ts +27 -1
  91. package/src/context/ConnectionContext.tsx +17 -7
  92. package/src/integrations/resourceHosts.test.tsx +1 -0
  93. package/src/integrations/resourceHosts.tsx +2 -0
  94. package/src/utils/navigation.ts +14 -0
  95. package/src/utils/wails-clipboard.ts +4 -2
@@ -263,6 +263,45 @@ describe("strict evidence adapters", () => {
263
263
  }),
264
264
  ]);
265
265
 
266
+ const evictedIssueFeed = project([
267
+ tool("issues-evicted", "issues", {
268
+ issues: [],
269
+ total: 0,
270
+ total_matched: 0,
271
+ recent_changes_history_coverage: {
272
+ incomplete: true,
273
+ reasons: ["events_evicted"],
274
+ },
275
+ }),
276
+ ]);
277
+ expect(evictedIssueFeed.limitations).toEqual([
278
+ expect.objectContaining({
279
+ source: "Issue-related changes",
280
+ kind: "unknown",
281
+ message: expect.stringContaining("incomplete for part of the window"),
282
+ }),
283
+ ]);
284
+ // Incomplete change history limits the change feed, not the live scan.
285
+ expect(groupsOf(evictedIssueFeed.groups, "receipt")).toHaveLength(1);
286
+
287
+ // So does a saturated change fetch whose rows were all discarded.
288
+ const saturatedIssueFeed = project([
289
+ tool("issues-saturated", "issues", {
290
+ issues: [],
291
+ total: 0,
292
+ total_matched: 0,
293
+ recent_changes_reason: "no_critical_issues",
294
+ recent_changes_truncated: true,
295
+ }),
296
+ ]);
297
+ expect(saturatedIssueFeed.limitations).toEqual([
298
+ expect.objectContaining({
299
+ source: "Issue-related changes",
300
+ kind: "truncated",
301
+ }),
302
+ ]);
303
+ expect(groupsOf(saturatedIssueFeed.groups, "receipt")).toHaveLength(1);
304
+
266
305
  const filtered = project([
267
306
  tool("filtered", "get_resource", {
268
307
  resource: deployment,
@@ -1988,6 +2027,74 @@ describe("honest zero and partial-result states", () => {
1988
2027
  });
1989
2028
  });
1990
2029
 
2030
+ it("shows cluster-scoped admission changes with why each one is listed", () => {
2031
+ const webhook = {
2032
+ kind: "MutatingWebhookConfiguration",
2033
+ apiVersion: "admissionregistration.k8s.io/v1",
2034
+ name: "gatekeeper-mutating-webhook-configuration",
2035
+ changeType: "add",
2036
+ timestamp: "2026-09-02T09:55:00Z",
2037
+ applicability: "applies",
2038
+ applies_because:
2039
+ "webhook mutation.gatekeeper.sh has a namespaceSelector matching namespace shop's labels and its rules cover namespaced resources",
2040
+ };
2041
+ const result = project([
2042
+ tool("changes", "get_changes", {
2043
+ changes: [],
2044
+ clusterScopedChanges: {
2045
+ kinds: ["MutatingWebhookConfiguration"],
2046
+ window_seconds: 3600,
2047
+ changes: [webhook],
2048
+ not_listed: [
2049
+ "ValidatingWebhookConfiguration policy (add at 2026-09-02T09:50:00Z)",
2050
+ ],
2051
+ incomplete: "Current webhook configurations are not cached.",
2052
+ },
2053
+ }),
2054
+ tool("issues", "issues", {
2055
+ issues: [],
2056
+ total: 0,
2057
+ total_matched: 0,
2058
+ cluster_scoped_changes: {
2059
+ changes: [{ ...webhook, applies_because: "" }],
2060
+ },
2061
+ }),
2062
+ ]);
2063
+ const rows = groupsOf(result.groups, "changes").map(
2064
+ (group) => group.latest.data,
2065
+ );
2066
+ expect(rows).toHaveLength(1);
2067
+ const data = rows[0];
2068
+ expect(data.type).toBe("changes");
2069
+ if (data.type === "changes") {
2070
+ expect(data.changes[0].summary).toBe(
2071
+ "Applies: webhook mutation.gatekeeper.sh has a namespaceSelector matching namespace shop's labels and its rules cover namespaced resources",
2072
+ );
2073
+ }
2074
+ expect(result.limitations).toEqual(
2075
+ expect.arrayContaining([
2076
+ expect.objectContaining({
2077
+ source: "Cluster-scoped admission changes",
2078
+ kind: "truncated",
2079
+ }),
2080
+ expect.objectContaining({
2081
+ source: "Cluster-scoped admission changes",
2082
+ kind: "unknown",
2083
+ }),
2084
+ ]),
2085
+ );
2086
+ // A row without its reason is malformed, not silently shown.
2087
+ expect(result.limitations).toEqual(
2088
+ expect.arrayContaining([
2089
+ expect.objectContaining({
2090
+ source: "Cluster-scoped admission changes",
2091
+ message:
2092
+ "Radar couldn't summarize this investigation step. Review it in Activity.",
2093
+ }),
2094
+ ]),
2095
+ );
2096
+ });
2097
+
1991
2098
  it("creates receipts only for confirmed complete zero-result reads", () => {
1992
2099
  const result = project([
1993
2100
  tool("diagnose", "diagnose", {
@@ -111,6 +111,17 @@ export interface InvestigationResourceContext extends DiagnosisResourceContext {
111
111
  };
112
112
  policySummary?: unknown;
113
113
  podSummary?: unknown;
114
+ templateDivergence?: {
115
+ summary: string;
116
+ podsCompared: number;
117
+ podsDiffering: number;
118
+ podsCapped?: boolean;
119
+ podsNotCompared?: number;
120
+ examplePod?: string;
121
+ baseline?: string;
122
+ differences: string[];
123
+ sources?: string[];
124
+ };
114
125
  }
115
126
  export interface InvestigationGitOpsDiagnosis {
116
127
  tool: "argocd" | "flux";
@@ -177,6 +177,24 @@ describe("evidence display significance (not record identity)", () => {
177
177
  evidenceDisplaySnapshot(different),
178
178
  );
179
179
  });
180
+ it("keeps a since-creation condition warning stable and distinct from a regression", () => {
181
+ const snapshot = (warning: string) =>
182
+ evidenceDisplaySnapshot(
183
+ observation({ type: "resource", resource, warnings: [warning] }),
184
+ );
185
+ const sinceCreation = (elapsed: string) =>
186
+ snapshot(
187
+ "Condition `Ready=False` for ~" +
188
+ elapsed +
189
+ " — since about when this resource was created (resource age: " +
190
+ elapsed +
191
+ ").",
192
+ );
193
+ expect(sinceCreation("20s")).toBe(sinceCreation("1m5s"));
194
+ expect(sinceCreation("20s")).not.toBe(
195
+ snapshot("Condition `Ready=False` for ~20s (resource age: 1h)."),
196
+ );
197
+ });
180
198
  it("tolerates unstructured conditions without deleting their contents", () => {
181
199
  const value = {
182
200
  ...resource,
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import { DiagnoseError } from "../../api/diagnose";
2
+ import { DiagnoseError, type RunSummary } from "../../api/diagnose";
3
3
  import {
4
4
  canOfferInvestigationApply,
5
5
  initialInvestigationPane,
@@ -28,6 +28,7 @@ import {
28
28
  investigationHealthSignals,
29
29
  investigationSettledAnswerTurnIndexes,
30
30
  investigationIsAssessmentTurn,
31
+ readOnlyNotice,
31
32
  } from "./investigationState";
32
33
 
33
34
  describe("investigation terminal presentation", () => {
@@ -1355,3 +1356,37 @@ describe("investigationFailureShown", () => {
1355
1356
  });
1356
1357
  });
1357
1358
  });
1359
+
1360
+ describe("readOnlyNotice", () => {
1361
+ const base: RunSummary = {
1362
+ id: "r1",
1363
+ kind: "Deployment",
1364
+ group: "apps",
1365
+ namespace: "prod",
1366
+ name: "payments",
1367
+ context: "prod-cluster",
1368
+ status: "done",
1369
+ createdAt: "2026-01-01T00:00:00Z",
1370
+ updatedAt: "2026-01-01T00:00:00Z",
1371
+ canContinue: false,
1372
+ };
1373
+
1374
+ it("shows the host's reason a run can't take a follow-up", () => {
1375
+ expect(
1376
+ readOnlyNotice({
1377
+ ...base,
1378
+ continueBlockedReason:
1379
+ "This conversation can't be continued. Start a new investigation to ask more.",
1380
+ }),
1381
+ ).toBe(
1382
+ "This conversation can't be continued. Start a new investigation to ask more.",
1383
+ );
1384
+ });
1385
+
1386
+ it("falls back to the generic notice without one", () => {
1387
+ expect(readOnlyNotice(base)).toBe("This investigation is read-only.");
1388
+ expect(readOnlyNotice({ ...base, continueBlockedReason: " " })).toBe(
1389
+ "This investigation is read-only.",
1390
+ );
1391
+ });
1392
+ });
@@ -819,6 +819,14 @@ export function canContinueInvestigation(
819
819
  );
820
820
  }
821
821
 
822
+ // readOnlyNotice is what an interactive run that can't take a follow-up shows
823
+ // where the follow-up box would be: the host's reason when it gave one.
824
+ export function readOnlyNotice(run: RunSummary): string {
825
+ return (
826
+ run.continueBlockedReason?.trim() || "This investigation is read-only."
827
+ );
828
+ }
829
+
822
830
  export function canInvestigateFurther(run: RunSummary, gone = false): boolean {
823
831
  return (
824
832
  !gone &&
@@ -1,8 +1,8 @@
1
1
  // Builds the shell command that hands an investigation off to the user's own
2
2
  // interactive agent CLI, pointed at Radar's MCP. This is the "escape hatch" to the
3
3
  // full agent (their config, their other MCPs, interactive approvals) — distinct
4
- // from the contained in-panel engine. The launched agent gets the full /mcp mount
5
- // (read+write); its own per-tool approval prompts gate any changes.
4
+ // from the contained in-panel engine. The endpoint follows the server MCP mode.
5
+ // In full mode, the client approval prompts gate changes.
6
6
  import { type RunSummary } from "../../api/diagnose";
7
7
 
8
8
  // sq POSIX-single-quotes a string so it's a safe single shell argument regardless
@@ -1,3 +1,4 @@
1
+ import { useCallback } from 'react'
1
2
  import { BottomDock as K8sBottomDock, DockTab, useDock, Input } from '@skyhook-io/k8s-ui'
2
3
  import { TerminalTab } from './TerminalTab'
3
4
  import { LogsTab } from './LogsTab'
@@ -8,7 +9,7 @@ import { TrafficFlowListTab } from './TrafficFlowListTab'
8
9
  import { useFlowSearch } from '../traffic/TrafficFlowListContext'
9
10
  import { Search } from 'lucide-react'
10
11
 
11
- function renderTabContent(tab: DockTab, isActive: boolean) {
12
+ function renderTabContent(tab: DockTab, isActive: boolean, viewNamespaces: string[]) {
12
13
  if (tab.type === 'terminal') {
13
14
  return (
14
15
  <TerminalTab
@@ -40,6 +41,7 @@ function renderTabContent(tab: DockTab, isActive: boolean) {
40
41
  namespace={tab.namespace!}
41
42
  workloadKind={tab.workloadKind!}
42
43
  workloadName={tab.workloadName!}
44
+ viewNamespaces={viewNamespaces}
43
45
  />
44
46
  )
45
47
  }
@@ -90,8 +92,9 @@ function renderTabHeaderExtra(tab: DockTab) {
90
92
  return null
91
93
  }
92
94
 
93
- export function BottomDock() {
95
+ export function BottomDock({ viewNamespaces }: { viewNamespaces: string[] }) {
94
96
  const { leftOffset, tabs } = useDock()
95
97
  const hasTrafficFlows = tabs.some(t => t.type === 'traffic-flows')
96
- return <K8sBottomDock renderTabContent={renderTabContent} renderTabHeaderExtra={renderTabHeaderExtra} leftOffset={leftOffset} defaultHeight={hasTrafficFlows ? 300 : undefined} />
98
+ const renderContent = useCallback((tab: DockTab, isActive: boolean) => renderTabContent(tab, isActive, viewNamespaces), [viewNamespaces])
99
+ return <K8sBottomDock renderTabContent={renderContent} renderTabHeaderExtra={renderTabHeaderExtra} leftOffset={leftOffset} defaultHeight={hasTrafficFlows ? 300 : undefined} />
97
100
  }
@@ -5,12 +5,14 @@ interface WorkloadLogsTabProps {
5
5
  namespace: string
6
6
  workloadKind: string
7
7
  workloadName: string
8
+ viewNamespaces?: string[]
8
9
  }
9
10
 
10
11
  export function WorkloadLogsTab({
11
12
  namespace,
12
13
  workloadKind,
13
14
  workloadName,
15
+ viewNamespaces,
14
16
  }: WorkloadLogsTabProps) {
15
17
  const normalizedKind = workloadKind.toLowerCase()
16
18
  const isScheduled = normalizedKind === 'cronjob' || normalizedKind === 'cronjobs' ||
@@ -27,6 +29,7 @@ export function WorkloadLogsTab({
27
29
  kind={workloadKind}
28
30
  namespace={namespace}
29
31
  name={workloadName}
32
+ viewNamespaces={viewNamespaces}
30
33
  />
31
34
  ) : (
32
35
  <WorkloadLogsViewer
@@ -2,13 +2,28 @@ import { renderToStaticMarkup } from 'react-dom/server'
2
2
  import { describe, expect, it, vi } from 'vitest'
3
3
  import { BatchExecutionFullscreen } from './BatchExecutionView'
4
4
 
5
+ const runQueryState = vi.hoisted(() => {
6
+ const state: { isLoading: boolean; error: Error | undefined } = { isLoading: false, error: undefined }
7
+ return state
8
+ })
9
+
5
10
  vi.mock('../../api/client', () => ({
6
11
  useResource: () => ({}),
7
12
  useWorkloadPods: () => ({}),
8
13
  useJobSetResources: () => ({ data: undefined, isLoading: false }),
9
- useWorkloadRuns: () => ({ data: { collection: 'runs', runs: [], total: 0, truncated: false } }),
14
+ useWorkloadRuns: () => ({ ...runQueryState, data: { collection: 'runs', runs: [], total: 0, truncated: false } }),
10
15
  }))
11
16
 
17
+ it('keeps CronJob configuration distinct from scheduling and completion', () => {
18
+ const html = renderToStaticMarkup(<BatchExecutionFullscreen
19
+ kind="CronJob" apiKind="cronjobs" namespace="default" name="nightly"
20
+ resource={{ spec: { schedule: '0 * * * *', timeZone: 'UTC', startingDeadlineSeconds: 0 }, status: {} }}
21
+ />)
22
+ expect(html).toContain('Enabled')
23
+ expect(html).toContain('>UTC<')
24
+ expect(html).toContain('>0s<')
25
+ })
26
+
12
27
  describe.each(['Job', 'CronJob', 'ScaledJob'])('%s cleanup retention display', (kind) => {
13
28
  function render(ttlSecondsAfterFinished?: number) {
14
29
  const jobSpec = { ttlSecondsAfterFinished, activeDeadlineSeconds: 60 }
@@ -34,3 +49,16 @@ describe.each(['Job', 'CronJob', 'ScaledJob'])('%s cleanup retention display', (
34
49
  expect(render()).not.toContain('TTL after finish')
35
50
  })
36
51
  })
52
+
53
+ it.each(['loading', 'error'])('keeps scheduling evidence visible while run history is %s', (state) => {
54
+ runQueryState.isLoading = state === 'loading'
55
+ runQueryState.error = state === 'error' ? new Error('history unavailable') : undefined
56
+ try {
57
+ const html = renderToStaticMarkup(<BatchExecutionFullscreen kind="CronJob" apiKind="cronjobs" namespace="default" name="nightly" resource={{ spec: {} }} leadContent={<p>Scheduling error reported</p>} />)
58
+ expect(html).toContain('Scheduling error reported')
59
+ if (state === 'error') expect(html).toContain('Run history unavailable')
60
+ } finally {
61
+ runQueryState.isLoading = false
62
+ runQueryState.error = undefined
63
+ }
64
+ })
@@ -26,6 +26,7 @@ import type { WorkloadPodInfo } from '../../types'
26
26
  import { getScaledJobStatus } from '../resources/resource-utils-keda'
27
27
  import { Tooltip } from '../ui/Tooltip'
28
28
  import { ImageFilesystemModal } from '../resources/ImageFilesystemModal'
29
+ import { useIsAuthEnabled } from '../../contexts/CapabilitiesContext'
29
30
  import { executionDefinitionDiffers, executionDefinitionSummary, type ExecutionDefinitionSummary, type ExecutionUnitSummary } from './execution-definition'
30
31
  import { batchRunHasContainerOutcome, batchRunNextStep, isFailedRunPhase, type BatchRunNextStep } from './batch-run-actions'
31
32
  import { JobSetAdmission } from './JobSetAdmission'
@@ -105,6 +106,7 @@ function mergeWorkflowArguments(base: any, overlay: any): any {
105
106
  }
106
107
 
107
108
  interface BatchExecutionProps {
109
+ leadContent?: ReactNode
108
110
  kind: string
109
111
  apiKind: string
110
112
  namespace: string
@@ -116,9 +118,11 @@ interface BatchExecutionProps {
116
118
  onSwitchToLogs?: () => void
117
119
  onSwitchToTimeline?: () => void
118
120
  onNavigateToResource?: (resource: ResourceNavigationTarget) => void
121
+ /** The view's namespace selection; narrows a cluster-scoped template's runs. */
122
+ viewNamespaces?: string[]
119
123
  }
120
124
 
121
- export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resource, selectedRunKey = '', canViewLogs = false, onSelectRun, onSwitchToLogs, onSwitchToTimeline, onNavigateToResource }: BatchExecutionProps) {
125
+ export function BatchExecutionFullscreen({ leadContent, kind, apiKind, namespace, name, resource, selectedRunKey = '', canViewLogs = false, onSelectRun, onSwitchToLogs, onSwitchToTimeline, onNavigateToResource, viewNamespaces }: BatchExecutionProps) {
122
126
  const scheduled = SCHEDULED_KINDS.has(kind)
123
127
  const clusterScoped = kind === 'ClusterWorkflowTemplate'
124
128
  const jobSetRoot = isJobSetV1Alpha2(resource)
@@ -127,7 +131,7 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
127
131
  const debouncedSearch = useDebouncedValue(runSearch, 250, value => value === '')
128
132
  const [roleFilter, setRoleFilter] = useState('')
129
133
  const memberOptions = { role: roleFilter, search: debouncedSearch, state: runFilter, selected: selectedRunKey }
130
- const runsQuery = useWorkloadRuns(apiKind, namespace, name, true, { refetchActive: true, clusterScoped, ...(jobSetRoot ? memberOptions : {}) })
134
+ const runsQuery = useWorkloadRuns(apiKind, namespace, name, true, { refetchActive: true, clusterScoped, namespaces: viewNamespaces, ownerUID: kind === 'CronJob' ? resource.metadata?.uid : undefined, ...(jobSetRoot ? memberOptions : {}) })
131
135
  const resourcesQuery = useJobSetResources(namespace, name, jobSetRoot ? resource.metadata?.uid : undefined, memberOptions)
132
136
  const memberCollection = runsQuery.data?.collection === 'members'
133
137
  const memberShell = memberCollection || (!runsQuery.data && jobSetRoot)
@@ -251,12 +255,18 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
251
255
  : 'Radar could not load retained runs.'
252
256
 
253
257
  if (runsQuery.isLoading && !jobSetRoot) {
254
- return <FetchResult loading className="h-full" />
258
+ return (
259
+ <div className="flex h-full min-h-0 flex-col">
260
+ {leadContent && <div className="p-4">{leadContent}</div>}
261
+ <FetchResult loading className="min-h-0 flex-1" />
262
+ </div>
263
+ )
255
264
  }
256
265
 
257
266
  if (runsQuery.error && !jobSetRoot) {
258
267
  return (
259
- <div className="p-4">
268
+ <div className="space-y-4 p-4">
269
+ {leadContent && <div className="space-y-4">{leadContent}</div>}
260
270
  <EmptyState
261
271
  tone="neutral"
262
272
  variant="card"
@@ -339,6 +349,7 @@ export function BatchExecutionFullscreen({ kind, apiKind, namespace, name, resou
339
349
 
340
350
  <main className="min-w-0 flex-1 overflow-auto">
341
351
  <div className="space-y-4 p-4">
352
+ {leadContent && <div className="space-y-4">{leadContent}</div>}
342
353
  {jobSetRoot && (
343
354
  <section className="rounded-lg border border-theme-border bg-theme-surface p-4" aria-label="JobSet overview">
344
355
  <JobSetRenderer data={resource} mode="overview" shownMemberCounts={shownMemberCounts} onSelectRole={memberCollection ? selectRole : undefined} />
@@ -560,7 +571,7 @@ function sourceFacts(kind: string, resource: any, runs: WorkloadRun[]) {
560
571
  const definition = executionDefinitionSummary(kind, resource)
561
572
  if (kind === 'CronJob') {
562
573
  return {
563
- state: spec.suspend ? 'Suspended' : (status.active?.length ?? 0) > 0 ? 'Active' : 'Scheduled',
574
+ state: spec.suspend ? 'Suspended' : (status.active?.length ?? 0) > 0 ? 'Active' : 'Enabled',
564
575
  stateTone: spec.suspend ? 'warning' : 'info',
565
576
  schedule: spec.schedule,
566
577
  concurrency: spec.concurrencyPolicy || 'Allow',
@@ -570,7 +581,8 @@ function sourceFacts(kind: string, resource: any, runs: WorkloadRun[]) {
570
581
  facts: [
571
582
  ['Last schedule', status.lastScheduleTime ? formatTimeAgo(status.lastScheduleTime) : 'Never'],
572
583
  ['Last success', status.lastSuccessfulTime ? formatTimeAgo(status.lastSuccessfulTime) : 'Never'],
573
- ['Starting deadline', spec.startingDeadlineSeconds ? `${spec.startingDeadlineSeconds}s` : 'None'],
584
+ ['Time zone', spec.timeZone ?? 'Controller local time (zone not reported)'],
585
+ ['Starting deadline', spec.startingDeadlineSeconds != null ? `${spec.startingDeadlineSeconds}s` : 'None'],
574
586
  ],
575
587
  definition,
576
588
  }
@@ -720,18 +732,21 @@ function ExecutionDefinitionDetails({ summary, namespace, compact = false }: { s
720
732
 
721
733
  function ExecutionUnitDetails({ unit, namespace, pullSecrets, compact }: { unit: ExecutionUnitSummary; namespace: string; pullSecrets: string[]; compact: boolean }) {
722
734
  const [browseImage, setBrowseImage] = useState(false)
735
+ const authEnabled = useIsAuthEnabled()
736
+ // With auth on, images are browsed through a Pod; a template has none.
737
+ const canBrowseImage = !authEnabled
723
738
  return (
724
739
  <>
725
740
  <div className={clsx(!compact && 'rounded-md bg-theme-elevated/40 px-3 py-2')}>
726
741
  {!compact && <div className="mb-1 flex items-center justify-between gap-3"><span className="truncate text-xs font-medium text-theme-text-primary">{unit.name}</span><span className="text-[10px] uppercase tracking-wide text-theme-text-tertiary">{unit.type}</span></div>}
727
742
  <div className="space-y-1">
728
- {unit.image && <DefinitionFact label="Image" value={unit.image} mono onClick={() => setBrowseImage(true)} tooltip="Browse image filesystem from registry" />}
743
+ {unit.image && <DefinitionFact label="Image" value={unit.image} mono onClick={canBrowseImage ? () => setBrowseImage(true) : undefined} tooltip={canBrowseImage ? 'Browse image filesystem from registry' : undefined} />}
729
744
  {unit.command && <DefinitionFact label="Command" value={unit.command} mono />}
730
745
  {!compact && unit.requests && <DefinitionFact label="Requests" value={unit.requests} />}
731
746
  {!compact && unit.limits && <DefinitionFact label="Limits" value={unit.limits} />}
732
747
  </div>
733
748
  </div>
734
- {unit.image && (
749
+ {unit.image && canBrowseImage && (
735
750
  <ImageFilesystemModal
736
751
  open={browseImage}
737
752
  onClose={() => setBrowseImage(false)}
@@ -0,0 +1,42 @@
1
+ import { renderToStaticMarkup } from 'react-dom/server'
2
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
3
+ import { BatchExecutionFullscreen } from './BatchExecutionView'
4
+ import { ScheduledWorkloadLogsViewer } from '../logs/ScheduledWorkloadLogsViewer'
5
+ import { WorkloadLogsTab } from '../dock/WorkloadLogsTab'
6
+
7
+ const runs = vi.hoisted(() => vi.fn(() => ({ data: { collection: 'runs', runs: [], total: 0, truncated: false } })))
8
+
9
+ vi.mock('../../api/client', () => ({
10
+ useResource: () => ({}),
11
+ useWorkloadPods: () => ({}),
12
+ useJobSetResources: () => ({ data: undefined, isLoading: false }),
13
+ useWorkloadRuns: runs,
14
+ }))
15
+ vi.mock('../logs/WorkloadLogsViewer', () => ({ WorkloadLogsViewer: () => null }))
16
+
17
+ const view = ['team-a', 'team-b']
18
+
19
+ function runsOptions() {
20
+ return (runs.mock.calls.at(-1) as unknown[] | undefined)?.[4]
21
+ }
22
+
23
+ beforeEach(() => runs.mockClear())
24
+
25
+ // A ClusterWorkflowTemplate's runs span namespaces; every surface listing them
26
+ // narrows them to the view's selection.
27
+ describe('cluster-scoped template runs follow the view selection', () => {
28
+ it('in the execution overview', () => {
29
+ renderToStaticMarkup(<BatchExecutionFullscreen kind="ClusterWorkflowTemplate" apiKind="clusterworkflowtemplates" namespace="" name="build" resource={{ spec: {} }} viewNamespaces={view} />)
30
+ expect(runsOptions()).toMatchObject({ clusterScoped: true, namespaces: view })
31
+ })
32
+
33
+ it('in the logs tab', () => {
34
+ renderToStaticMarkup(<ScheduledWorkloadLogsViewer kind="clusterworkflowtemplates" namespace="" name="build" viewNamespaces={view} />)
35
+ expect(runsOptions()).toMatchObject({ clusterScoped: true, namespaces: view })
36
+ })
37
+
38
+ it('in the dock', () => {
39
+ renderToStaticMarkup(<WorkloadLogsTab namespace="" workloadKind="ClusterWorkflowTemplate" workloadName="build" viewNamespaces={view} />)
40
+ expect(runsOptions()).toMatchObject({ clusterScoped: true, namespaces: view })
41
+ })
42
+ })
@@ -490,6 +490,13 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
490
490
  })
491
491
  return
492
492
  }
493
+ if (node?.missing) {
494
+ const nextStep = node.sync === 'Synced'
495
+ ? 'Argo reports it as synced. Refresh the application to check its status.'
496
+ : 'Sync the application to create it.'
497
+ showToast(`${ref.kind} ${ref.name} is not present in this cluster. ${nextStep}`, { type: 'info' })
498
+ return
499
+ }
493
500
  if (isGitOpsDetailRef(ref) && isValidKubernetesName(ref.name)) {
494
501
  const detailKind = kindToPluralWithGroup(ref.kind, ref.group ?? '')
495
502
  // The tree's root node is this page's own subject — clicking it must not