@skyhook-io/radar-app 1.18.1 → 1.18.2

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 (72) hide show
  1. package/package.json +1 -1
  2. package/src/App.tsx +23 -8
  3. package/src/api/client.deleteResource.test.tsx +111 -0
  4. package/src/api/client.resourceAudit.test.tsx +57 -0
  5. package/src/api/client.resourcePath.test.ts +107 -0
  6. package/src/api/client.ts +136 -37
  7. package/src/components/capacity/CapacityDemand.tsx +6 -3
  8. package/src/components/capacity/CapacityOverview.tsx +14 -7
  9. package/src/components/capacity/CapacityPoolDetail.tsx +7 -5
  10. package/src/components/capacity/ClusterSchedulingCard.tsx +3 -3
  11. package/src/components/capacity/shared.tsx +9 -5
  12. package/src/components/cnpg/CNPGOverview.tsx +4 -1
  13. package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +1 -0
  14. package/src/components/diagnose/ApplyDialog.test.tsx +10 -0
  15. package/src/components/diagnose/ApplyDialog.tsx +8 -1
  16. package/src/components/diagnose/AssessmentCard.tsx +60 -0
  17. package/src/components/diagnose/DiagnoseSurface.tsx +5 -0
  18. package/src/components/diagnose/InvestigationEvidencePane.test.tsx +62 -2
  19. package/src/components/diagnose/InvestigationEvidenceSections.tsx +6 -5
  20. package/src/components/diagnose/InvestigationView.tsx +47 -13
  21. package/src/components/diagnose/assessmentCopy.ts +11 -0
  22. package/src/components/diagnose/investigationEvidence/adapters/changes.ts +36 -1
  23. package/src/components/diagnose/investigationEvidence/adapters/crossplane.test.tsx +85 -0
  24. package/src/components/diagnose/investigationEvidence/adapters/issues.ts +1 -0
  25. package/src/components/diagnose/investigationEvidence/adapters/prometheus.test.ts +2 -1
  26. package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +2 -1
  27. package/src/components/diagnose/investigationEvidence/adapters/testdata/crossplane-paused-get-resource.json +28 -0
  28. package/src/components/diagnose/investigationEvidence/bodies/index.tsx +2 -0
  29. package/src/components/diagnose/investigationEvidence/bodies/workload.tsx +5 -1
  30. package/src/components/diagnose/investigationEvidence/builder.ts +3 -1
  31. package/src/components/diagnose/investigationEvidence/cardParts.tsx +7 -2
  32. package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
  33. package/src/components/diagnose/investigationEvidence/observations.ts +7 -3
  34. package/src/components/diagnose/investigationEvidence/projection.test.ts +57 -3
  35. package/src/components/diagnose/investigationEvidencePresentation.test.ts +36 -2
  36. package/src/components/diagnose/investigationEvidencePresentation.ts +33 -8
  37. package/src/components/diagnose/storyParts.test.tsx +53 -0
  38. package/src/components/helm/ChartBrowser.tsx +4 -4
  39. package/src/components/helm/HelmReleaseDrawer.tsx +6 -2
  40. package/src/components/helm/HelmView.tsx +34 -23
  41. package/src/components/helm/InstallWizard.tsx +6 -2
  42. package/src/components/helm/ValuesViewer.test.tsx +1 -0
  43. package/src/components/helm/ValuesViewer.tsx +4 -2
  44. package/src/components/home/ClusterHealthCard.tsx +28 -21
  45. package/src/components/home/MCPSetupDialog.test.tsx +27 -2
  46. package/src/components/home/MCPSetupDialog.tsx +14 -2
  47. package/src/components/home/mcpToolCatalog.ts +29 -2
  48. package/src/components/issues/IssuesPane.render.test.tsx +5 -5
  49. package/src/components/nav/PrimaryNavRail.tsx +34 -2
  50. package/src/components/product-hunt/ProductHuntNotice.render.test.tsx +120 -0
  51. package/src/components/product-hunt/ProductHuntNotice.test.ts +121 -0
  52. package/src/components/product-hunt/ProductHuntNotice.tsx +202 -0
  53. package/src/components/product-hunt/launchWindow.ts +78 -0
  54. package/src/components/product-hunt/useProductHuntRailEntry.test.tsx +76 -0
  55. package/src/components/product-hunt/useProductHuntRailEntry.ts +27 -0
  56. package/src/components/resources/CompositeRenderer.tsx +4 -0
  57. package/src/components/resources/ResourcesView.tsx +1 -1
  58. package/src/components/settings/LocalConnectionSettings.tsx +1 -0
  59. package/src/components/ui/RadarOmnibar.test.tsx +18 -0
  60. package/src/components/ui/RadarOmnibar.tsx +1 -0
  61. package/src/components/ui/SearchSyntaxHelp.test.tsx +39 -0
  62. package/src/components/ui/SearchSyntaxHelp.tsx +23 -2
  63. package/src/components/ui/UpdateNotification.test.tsx +2 -0
  64. package/src/components/ui/UpdateNotification.tsx +32 -5
  65. package/src/components/usage-data/UsageDataPrompt.tsx +19 -1
  66. package/src/components/workload/WorkloadView.tsx +10 -4
  67. package/src/components/workspace/layout.tsx +2 -1
  68. package/src/contexts/CapabilitiesContext.tsx +1 -0
  69. package/src/hooks/useGitOpsWriteGuard.test.tsx +126 -2
  70. package/src/hooks/useGitOpsWriteGuard.ts +25 -3
  71. package/src/hooks/useResolvedGitOpsOwner.ts +14 -9
  72. package/src/index.css +85 -0
@@ -0,0 +1,121 @@
1
+ import { afterEach, describe, expect, it, vi } from 'vitest'
2
+
3
+ vi.mock('../../api/client', () => ({ useCapabilities: () => ({ data: undefined }), useVersionCheck: () => ({ data: undefined }) }))
4
+ vi.mock('../../api/usage-data', () => ({ useSetUsageData: () => ({ mutate: vi.fn(), isPending: false }), useMarkUsagePromptShown: () => vi.fn() }))
5
+
6
+ import { launchLink, shouldShowLaunchNotice } from './ProductHuntNotice'
7
+ import { FALLBACK_LAUNCH, isPhaseDismissed, launchDayLabel, launchNoticeHoldsCorner, launchPhase, markPhaseDismissed, resolveLaunch } from './launchWindow'
8
+
9
+ const launch = FALLBACK_LAUNCH
10
+
11
+ describe('launchPhase', () => {
12
+ it('is upcoming before Product Hunt day starts in Pacific time', () => {
13
+ expect(launchPhase(launch, Date.parse('2026-10-28T12:00:00Z'))).toBe('upcoming')
14
+ expect(launchPhase(launch, Date.parse('2026-10-28T23:59:59-07:00'))).toBe('upcoming')
15
+ })
16
+
17
+ it('is live for the whole Pacific day of Oct 29', () => {
18
+ expect(launchPhase(launch, Date.parse('2026-10-29T00:00:00-07:00'))).toBe('live')
19
+ expect(launchPhase(launch, Date.parse('2026-10-29T09:01:00+02:00'))).toBe('live')
20
+ expect(launchPhase(launch, Date.parse('2026-10-29T23:59:59-07:00'))).toBe('live')
21
+ })
22
+
23
+ it('is over once the Pacific day ends', () => {
24
+ expect(launchPhase(launch, Date.parse('2026-10-30T00:00:00-07:00'))).toBe(null)
25
+ expect(launchPhase(launch, Date.parse('2026-11-15T00:00:00Z'))).toBe(null)
26
+ })
27
+ })
28
+
29
+ describe('resolveLaunch', () => {
30
+ it('uses the built-in launch only when the version check says nothing', () => {
31
+ expect(resolveLaunch(undefined)).toBe(FALLBACK_LAUNCH)
32
+ })
33
+
34
+ it('follows a moved or cancelled launch from the version check', () => {
35
+ const moved = resolveLaunch({ enabled: true, url: launch.url, start: '2026-11-05T08:00:00Z', end: '2026-11-06T08:00:00Z' })
36
+ expect(launchPhase(moved, Date.parse('2026-10-29T12:00:00Z'))).toBe('upcoming')
37
+ expect(launchPhase(moved, Date.parse('2026-11-05T12:00:00Z'))).toBe('live')
38
+ expect(launchDayLabel(moved)).toBe('Nov 5')
39
+
40
+ const cancelled = resolveLaunch({ enabled: false, url: '', start: '0001-01-01T00:00:00Z', end: '0001-01-01T00:00:00Z' })
41
+ expect(launchPhase(cancelled, Date.parse('2026-10-28T12:00:00Z'))).toBe(null)
42
+ expect(launchPhase(cancelled, Date.parse('2026-10-29T12:00:00Z'))).toBe(null)
43
+ })
44
+
45
+ it('labels the day on Product Hunt time and tags the link', () => {
46
+ expect(launchDayLabel(launch)).toBe('Oct 29')
47
+ const link = new URL(launchLink(launch))
48
+ expect(link.searchParams.get('launch')).toBe('radar-101')
49
+ expect(link.searchParams.get('utm_source')).toBe('radar-oss')
50
+ expect(link.searchParams.get('utm_campaign')).toBe('ph-launch-2026-10')
51
+ })
52
+ })
53
+
54
+ describe('shouldShowLaunchNotice', () => {
55
+ const base = { phase: 'live' as const, deploymentMode: 'local', dismissed: false, ready: true, cornerBusy: false }
56
+
57
+ it('shows on a local install with the corner free', () => {
58
+ expect(shouldShowLaunchNotice(base)).toBe(true)
59
+ expect(shouldShowLaunchNotice({ ...base, phase: 'upcoming' })).toBe(true)
60
+ })
61
+
62
+ it('shows in-cluster on launch day only, and never in Cloud or before capabilities load', () => {
63
+ expect(shouldShowLaunchNotice({ ...base, deploymentMode: 'in-cluster' })).toBe(true)
64
+ expect(shouldShowLaunchNotice({ ...base, deploymentMode: 'in-cluster', phase: 'upcoming' })).toBe(false)
65
+ expect(shouldShowLaunchNotice({ ...base, deploymentMode: 'cloud' })).toBe(false)
66
+ expect(shouldShowLaunchNotice({ ...base, deploymentMode: undefined })).toBe(false)
67
+ })
68
+
69
+ it('stays away once dismissed, outside the window, before the delay, or while another notice holds the corner', () => {
70
+ expect(shouldShowLaunchNotice({ ...base, dismissed: true })).toBe(false)
71
+ expect(shouldShowLaunchNotice({ ...base, phase: null })).toBe(false)
72
+ expect(shouldShowLaunchNotice({ ...base, ready: false })).toBe(false)
73
+ expect(shouldShowLaunchNotice({ ...base, cornerBusy: true })).toBe(false)
74
+ })
75
+ })
76
+
77
+ describe('isPhaseDismissed', () => {
78
+ const store = new Map<string, string>()
79
+ vi.stubGlobal('localStorage', {
80
+ getItem: (k: string) => store.get(k) ?? null,
81
+ setItem: (k: string, v: string) => void store.set(k, v),
82
+ })
83
+ afterEach(() => store.clear())
84
+
85
+ it('keeps the launch-day card for someone who closed the one before it', () => {
86
+ store.set('radar-product-hunt-dismissed-2026-10-29-upcoming', '1')
87
+ expect(isPhaseDismissed(launch, 'upcoming')).toBe(true)
88
+ expect(isPhaseDismissed(launch, 'live')).toBe(false)
89
+ })
90
+
91
+ it('announces a moved launch again', () => {
92
+ store.set('radar-product-hunt-dismissed-2026-10-29-upcoming', '1')
93
+ const moved = resolveLaunch({ enabled: true, url: launch.url, start: '2026-11-05T08:00:00Z', end: '2026-11-06T08:00:00Z' })
94
+ expect(isPhaseDismissed(moved, 'upcoming')).toBe(false)
95
+ })
96
+
97
+ it('holds the corner on launch day until the launch-day card is dismissed', () => {
98
+ const before = Date.parse('2026-10-28T12:00:00Z')
99
+ const during = Date.parse('2026-10-29T10:00:00-07:00')
100
+ const after = Date.parse('2026-10-30T01:00:00-07:00')
101
+ expect(launchNoticeHoldsCorner(launch, before)).toBe(false)
102
+ expect(launchNoticeHoldsCorner(launch, during)).toBe(true)
103
+ expect(launchNoticeHoldsCorner(launch, after)).toBe(false)
104
+ store.set('radar-product-hunt-dismissed-2026-10-29-live', '1')
105
+ expect(launchNoticeHoldsCorner(launch, during)).toBe(false)
106
+ })
107
+
108
+ it('frees the corner for this page when localStorage refuses the dismissal', () => {
109
+ const later = resolveLaunch({ enabled: true, url: launch.url, start: '2026-11-12T08:00:00Z', end: '2026-11-13T08:00:00Z' })
110
+ const during = Date.parse('2026-11-12T10:00:00-08:00')
111
+ vi.stubGlobal('localStorage', {
112
+ getItem: () => { throw new Error('denied') },
113
+ setItem: () => { throw new Error('denied') },
114
+ })
115
+ vi.stubGlobal('window', { dispatchEvent: vi.fn() })
116
+ expect(launchNoticeHoldsCorner(later, during)).toBe(true)
117
+ markPhaseDismissed(later, 'live')
118
+ expect(launchNoticeHoldsCorner(later, during)).toBe(false)
119
+ expect(isPhaseDismissed(later, 'upcoming')).toBe(false)
120
+ })
121
+ })
@@ -0,0 +1,202 @@
1
+ import { useEffect, useReducer, useState } from 'react'
2
+ import type { CSSProperties } from 'react'
3
+ import { clsx } from 'clsx'
4
+ import { Heart, Rocket, X } from 'lucide-react'
5
+ import { useCapabilities, useVersionCheck } from '../../api/client'
6
+ import type { UsageDataStatus } from '../../api/usage-data'
7
+ import { USAGE_PROMPT_VISIBILITY_EVENT, updateNoticeVisible, usagePromptOnScreen } from '../usage-data/UsageDataPrompt'
8
+ import { useAnimatedUnmount } from '../../hooks/useAnimatedUnmount'
9
+ import { TRANSITION_MENU } from '../../utils/animation'
10
+ import { LAUNCH_NOTICE_REOPEN_EVENT, LAUNCH_RAIL_ITEM_ID, isPhaseDismissed, launchDayLabel, launchPhase, launchShownIn, markPhaseDismissed, resolveLaunch, type LaunchPhase, type ProductHuntLaunch } from './launchWindow'
11
+
12
+ // The same tag for every install: it says the click came from inside Radar,
13
+ // nothing about who clicked.
14
+ const UTM = { utm_source: 'radar-oss', utm_medium: 'app', utm_campaign: 'ph-launch-2026-10' }
15
+ const FEATURE_URL = `https://radarhq.io/product/ai-investigations?${new URLSearchParams(UTM)}`
16
+ const SHOW_DELAY_MS = 10_000
17
+ const LAUNCH_RECHECK_MS = 60 * 60_000
18
+ // Long enough to read as growing out of the sidebar item, not snapping in.
19
+ const ENTER_MS = 320
20
+ const EXIT_MS = 220
21
+
22
+ export function shouldShowLaunchNotice(opts: {
23
+ phase: LaunchPhase | null
24
+ deploymentMode: string | undefined
25
+ dismissed: boolean
26
+ ready: boolean
27
+ cornerBusy: boolean
28
+ }): boolean {
29
+ return opts.phase !== null && launchShownIn(opts.deploymentMode, opts.phase) && !opts.dismissed && opts.ready && !opts.cornerBusy
30
+ }
31
+
32
+ export function launchLink(launch: ProductHuntLaunch): string {
33
+ const url = new URL(launch.url)
34
+ for (const [key, value] of Object.entries(UTM)) url.searchParams.set(key, value)
35
+ return url.toString()
36
+ }
37
+
38
+ // A one-off notice for the October 2026 Product Hunt launch, whose date and
39
+ // link come from the update check. Before the day it waits its turn behind the
40
+ // update notice and the first-run usage prompt; on the day they wait for it.
41
+ // Each phase is dismissed on its own, so the launch-day card still shows to
42
+ // someone who closed the one before.
43
+ export function ProductHuntNotice({ usageData, usageDataPending }: { usageData: UsageDataStatus | undefined; usageDataPending: boolean }) {
44
+ const { data: capabilities } = useCapabilities()
45
+ const { data: versionInfo, isPending: versionPending, refetch: refetchVersion } = useVersionCheck()
46
+ const [now, setNow] = useState(() => Date.now())
47
+ const [ready, setReady] = useState(false)
48
+
49
+ const [usagePromptShowing, setUsagePromptShowing] = useState(usagePromptOnScreen)
50
+ const launch = resolveLaunch(versionInfo?.productHuntLaunch)
51
+ const phase = launchPhase(launch, now)
52
+ const ended = phase === null
53
+
54
+ useEffect(() => {
55
+ if (ended) return
56
+ const delay = window.setTimeout(() => setReady(true), SHOW_DELAY_MS)
57
+ // Re-reads the clock for the phase change, and the update notice's
58
+ // dismissal, which only touches localStorage.
59
+ const poll = window.setInterval(() => setNow(Date.now()), 60_000)
60
+ // Picks up a launch moved or called off while this page stays open.
61
+ const recheck = window.setInterval(() => void refetchVersion(), LAUNCH_RECHECK_MS)
62
+ return () => {
63
+ window.clearTimeout(delay)
64
+ window.clearInterval(poll)
65
+ window.clearInterval(recheck)
66
+ }
67
+ }, [ended, refetchVersion])
68
+
69
+ // Opened again from the sidebar: shows at once, over whatever holds the corner.
70
+ const [reopened, setReopened] = useState(false)
71
+ // Re-renders after a dismissal, which lives outside React state.
72
+ const [, rerender] = useReducer((n: number) => n + 1, 0)
73
+ useEffect(() => {
74
+ const onReopen = () => setReopened(true)
75
+ window.addEventListener(LAUNCH_NOTICE_REOPEN_EVENT, onReopen)
76
+ return () => window.removeEventListener(LAUNCH_NOTICE_REOPEN_EVENT, onReopen)
77
+ }, [])
78
+
79
+ // Tracked whatever the launch, so a launch switched back on sees a usage
80
+ // prompt that opened meanwhile.
81
+ useEffect(() => {
82
+ const onUsagePrompt = () => setUsagePromptShowing(usagePromptOnScreen())
83
+ window.addEventListener(USAGE_PROMPT_VISIBILITY_EVENT, onUsagePrompt)
84
+ return () => window.removeEventListener(USAGE_PROMPT_VISIBILITY_EVENT, onUsagePrompt)
85
+ }, [])
86
+
87
+ const show = shouldShowLaunchNotice({
88
+ phase,
89
+ deploymentMode: capabilities ? (capabilities.deployment?.mode ?? 'local') : undefined,
90
+ dismissed: phase !== null && isPhaseDismissed(launch, phase) && !reopened,
91
+ // Waits for the version check, which says whether the launch is still on.
92
+ ready: (reopened || ready) && !versionPending,
93
+ // A card already on screen keeps the corner, whatever the day.
94
+ cornerBusy: !reopened && (usagePromptShowing || (phase === 'upcoming' && (
95
+ updateNoticeVisible(versionInfo?.latestVersion, versionInfo?.updateAvailable) || usageDataPending || !!usageData?.firstRunPrompt
96
+ ))),
97
+ })
98
+ const { shouldRender, isOpen } = useAnimatedUnmount(show, EXIT_MS)
99
+ // Beside the sidebar's Product Hunt item, growing out of it; the bottom-right
100
+ // corner when the sidebar isn't there (narrow windows, embedded).
101
+ const [anchor, setAnchor] = useState<{ left: number; bottom: number } | null>(null)
102
+ useEffect(() => {
103
+ if (!shouldRender) return
104
+ const item = document.getElementById(LAUNCH_RAIL_ITEM_ID)
105
+ let frame = 0
106
+ const place = () => {
107
+ cancelAnimationFrame(frame)
108
+ frame = requestAnimationFrame(() => {
109
+ const r = item?.getBoundingClientRect()
110
+ setAnchor(r && r.width > 0 ? { left: r.right + 8, bottom: Math.max(16, window.innerHeight - r.bottom) } : null)
111
+ })
112
+ }
113
+ place()
114
+ const observer = item && typeof ResizeObserver !== 'undefined' ? new ResizeObserver(place) : null
115
+ if (item) observer?.observe(item)
116
+ window.addEventListener('resize', place)
117
+ return () => {
118
+ cancelAnimationFrame(frame)
119
+ observer?.disconnect()
120
+ window.removeEventListener('resize', place)
121
+ }
122
+ }, [shouldRender])
123
+ // What the card last showed, kept through the exit fade: the day can end, or
124
+ // the launch be called off, while it is on screen.
125
+ const [shown, setShown] = useState<{ phase: LaunchPhase; launch: ProductHuntLaunch } | null>(null)
126
+ if (show && phase !== null && (shown?.phase !== phase || shown.launch.url !== launch.url || shown.launch.start !== launch.start)) {
127
+ setShown({ phase, launch })
128
+ }
129
+ if (!shouldRender || !shown) return null
130
+
131
+ const dismiss = () => {
132
+ markPhaseDismissed(shown.launch, shown.phase)
133
+ setReopened(false)
134
+ rerender()
135
+ }
136
+
137
+ const placement: CSSProperties = anchor
138
+ ? { left: anchor.left, bottom: anchor.bottom, maxWidth: `calc(100vw - ${anchor.left + 16}px)`, maxHeight: `calc(100vh - ${anchor.bottom + 16}px)` }
139
+ : { right: 16, bottom: 16, maxWidth: 'calc(100vw - 2rem)', maxHeight: 'calc(100vh - 2rem)' }
140
+
141
+ return (
142
+ <div
143
+ role="dialog"
144
+ aria-label="Radar on Product Hunt"
145
+ inert={!show || undefined}
146
+ className={clsx(
147
+ 'launch-border fixed z-40 w-[24rem] rounded-xl border border-emerald-500/40 dark:border-emerald-400/30 shadow-[0_10px_40px_-6px_rgba(16,185,129,0.6)] dark:shadow-[0_10px_40px_-8px_rgba(16,185,129,0.45)]',
148
+ anchor ? 'origin-bottom-left' : 'origin-bottom-right',
149
+ TRANSITION_MENU,
150
+ isOpen ? 'opacity-100 translate-x-0 translate-y-0 scale-100' : anchor ? 'opacity-0 -translate-x-3 scale-75' : 'opacity-0 translate-y-1 scale-[0.97]',
151
+ !show && 'pointer-events-none',
152
+ )}
153
+ style={{ ...placement, transitionDuration: `${isOpen ? ENTER_MS : EXIT_MS}ms` }}
154
+ >
155
+ <div className="relative flex gap-3 p-4 rounded-[11px] max-h-[inherit] overflow-y-auto bg-theme-surface bg-gradient-to-br from-emerald-500/12 via-emerald-500/4 to-transparent dark:from-emerald-400/18 dark:via-emerald-400/6">
156
+ <button
157
+ type="button"
158
+ onClick={dismiss}
159
+ aria-label="Close"
160
+ className="absolute top-2.5 right-2.5 p-1 rounded text-theme-text-tertiary hover:text-theme-text-primary hover:bg-theme-elevated"
161
+ >
162
+ <X className="w-3.5 h-3.5" />
163
+ </button>
164
+ <span className="flex items-center justify-center w-9 h-9 shrink-0 rounded-lg bg-emerald-500 text-white shadow-[0_4px_14px_-4px_rgba(16,185,129,0.6)]">
165
+ <Rocket className="w-4 h-4 animate-launch-rocket" aria-hidden />
166
+ </span>
167
+ <div className="min-w-0">
168
+ <p className="flex items-center gap-1.5 pr-6 text-sm font-medium text-theme-text-primary">
169
+ Radar <Heart className="w-3.5 h-3.5 fill-current text-red-500 dark:text-red-400" aria-label="loves" /> Agents
170
+ </p>
171
+ <p className="text-xs font-medium text-emerald-700 dark:text-emerald-300 mt-0.5">
172
+ {shown.phase === 'live' ? 'Live on Product Hunt today' : `Launching on Product Hunt ${launchDayLabel(shown.launch)}`}
173
+ </p>
174
+ <p className="text-xs text-theme-text-secondary mt-1.5">
175
+ {shown.phase === 'live'
176
+ ? "We're on Product Hunt today with Radar's newly upgraded MCP server and AI investigations. If Radar has made Kubernetes a little easier for you, a comment on the launch would mean a lot. It helps other engineers find Radar."
177
+ : "We're launching Radar's newly upgraded MCP server and AI investigations on Product Hunt. If Radar has made Kubernetes a little easier for you, follow the launch and come say hi on the day. It helps other engineers find Radar."}
178
+ </p>
179
+ <div className="flex items-center gap-3 mt-3">
180
+ <a
181
+ href={launchLink(shown.launch)}
182
+ target="_blank"
183
+ rel="noopener noreferrer"
184
+ onClick={dismiss}
185
+ className="inline-flex items-center rounded-lg bg-emerald-600 hover:bg-emerald-700 dark:bg-emerald-500 dark:hover:bg-emerald-400 px-3 py-1.5 text-xs font-semibold text-white dark:text-emerald-950 whitespace-nowrap transition-colors"
186
+ >
187
+ {shown.phase === 'live' ? 'Comment on Product Hunt →' : 'Follow on Product Hunt →'}
188
+ </a>
189
+ <a
190
+ href={FEATURE_URL}
191
+ target="_blank"
192
+ rel="noopener noreferrer"
193
+ className="text-xs text-theme-text-tertiary hover:text-theme-text-secondary hover:underline whitespace-nowrap"
194
+ >
195
+ How it works
196
+ </a>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ </div>
201
+ )
202
+ }
@@ -0,0 +1,78 @@
1
+ import type { VersionInfo } from '../../api/client'
2
+
3
+ // The launch as the update check last described it (internal/launchday), so it
4
+ // can move or be called off without a release.
5
+ export type ProductHuntLaunch = { enabled: boolean; url: string; start: number; end: number }
6
+
7
+ // Used only when Radar's version check doesn't answer. Product Hunt's day runs
8
+ // midnight to midnight Pacific; PDT is UTC-7 until Nov 1.
9
+ export const FALLBACK_LAUNCH: ProductHuntLaunch = {
10
+ enabled: true,
11
+ url: 'https://www.producthunt.com/products/radar-7?launch=radar-101',
12
+ start: Date.parse('2026-10-29T07:00:00Z'),
13
+ end: Date.parse('2026-10-30T07:00:00Z'),
14
+ }
15
+
16
+ export const LAUNCH_NOTICE_DISMISSED_EVENT = 'radar:product-hunt-notice-dismissed'
17
+ // Sent by the sidebar's Product Hunt item to bring a dismissed card back.
18
+ export const LAUNCH_NOTICE_REOPEN_EVENT = 'radar:product-hunt-notice-reopen'
19
+ // The sidebar item the card opens from and closes into.
20
+ export const LAUNCH_RAIL_ITEM_ID = 'product-hunt-rail-item'
21
+
22
+ export type LaunchPhase = 'upcoming' | 'live'
23
+
24
+ // In-cluster Radar is often shared by people who didn't install it, so they
25
+ // get only the launch day.
26
+ export function launchShownIn(deploymentMode: string | undefined, phase: LaunchPhase): boolean {
27
+ return deploymentMode === 'local' || (deploymentMode === 'in-cluster' && phase === 'live')
28
+ }
29
+
30
+ export function resolveLaunch(fromServer: VersionInfo['productHuntLaunch']): ProductHuntLaunch {
31
+ if (!fromServer) return FALLBACK_LAUNCH
32
+ return { enabled: fromServer.enabled, url: fromServer.url, start: Date.parse(fromServer.start), end: Date.parse(fromServer.end) }
33
+ }
34
+
35
+ export function launchPhase(launch: ProductHuntLaunch, now: number): LaunchPhase | null {
36
+ if (!launch.enabled || !(now < launch.end)) return null
37
+ return now >= launch.start ? 'live' : 'upcoming'
38
+ }
39
+
40
+ // "Oct 29": the launch day on Product Hunt's own clock.
41
+ export function launchDayLabel(launch: ProductHuntLaunch): string {
42
+ return new Date(launch.start).toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'America/Los_Angeles' })
43
+ }
44
+
45
+ // Keyed by launch day, so a moved launch is announced again.
46
+ function dismissedKey(launch: ProductHuntLaunch, phase: LaunchPhase): string {
47
+ return `radar-product-hunt-dismissed-${new Date(launch.start).toISOString().slice(0, 10)}-${phase}`
48
+ }
49
+
50
+ // Covers this page when localStorage is unavailable.
51
+ const dismissedThisPage = new Set<string>()
52
+
53
+ export function isPhaseDismissed(launch: ProductHuntLaunch, phase: LaunchPhase): boolean {
54
+ const key = dismissedKey(launch, phase)
55
+ if (dismissedThisPage.has(key)) return true
56
+ try {
57
+ return localStorage.getItem(key) !== null
58
+ } catch {
59
+ return false
60
+ }
61
+ }
62
+
63
+ export function markPhaseDismissed(launch: ProductHuntLaunch, phase: LaunchPhase): void {
64
+ const key = dismissedKey(launch, phase)
65
+ dismissedThisPage.add(key)
66
+ try {
67
+ localStorage.setItem(key, '1')
68
+ } catch {
69
+ // localStorage unavailable: dismissedThisPage keeps it for this page
70
+ }
71
+ window.dispatchEvent(new Event(LAUNCH_NOTICE_DISMISSED_EVENT))
72
+ }
73
+
74
+ // On launch day the Product Hunt card goes first: the update notice and the
75
+ // first-run usage prompt wait until it is dismissed or the day is over.
76
+ export function launchNoticeHoldsCorner(launch: ProductHuntLaunch, now: number): boolean {
77
+ return launchPhase(launch, now) === 'live' && !isPhaseDismissed(launch, 'live')
78
+ }
@@ -0,0 +1,76 @@
1
+ // @vitest-environment jsdom
2
+ import { act } from 'react'
3
+ import { createRoot, type Root } from 'react-dom/client'
4
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
5
+
6
+ const state = vi.hoisted(() => ({ mode: 'local', pending: false }))
7
+ vi.mock('../../api/client', () => ({
8
+ useCapabilities: () => ({ data: { deployment: { mode: state.mode } } }),
9
+ useVersionCheck: () => ({ data: undefined, isPending: state.pending }),
10
+ }))
11
+
12
+ import { useProductHuntRailEntry } from './useProductHuntRailEntry'
13
+
14
+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true })
15
+ let root: Root
16
+ const seen = vi.fn<(entry: ReturnType<typeof useProductHuntRailEntry>) => void>()
17
+ const entry = () => seen.mock.lastCall?.[0]
18
+
19
+ function Probe() {
20
+ seen(useProductHuntRailEntry())
21
+ return null
22
+ }
23
+
24
+ function mount() {
25
+ root = createRoot(document.createElement('div'))
26
+ act(() => root.render(<Probe />))
27
+ }
28
+
29
+ beforeEach(() => {
30
+ vi.useFakeTimers()
31
+ vi.setSystemTime(new Date('2026-10-29T17:00:00Z'))
32
+ localStorage.clear()
33
+ state.mode = 'local'
34
+ state.pending = false
35
+ seen.mockClear()
36
+ })
37
+
38
+ afterEach(() => {
39
+ act(() => root.unmount())
40
+ vi.useRealTimers()
41
+ })
42
+
43
+ describe('useProductHuntRailEntry', () => {
44
+ it('is there for the launch window, and opens the card', () => {
45
+ mount()
46
+ expect(entry()?.id).toBe('product-hunt-rail-item')
47
+ expect(entry()?.badge).toBe('Today')
48
+ const reopen = vi.fn()
49
+ window.addEventListener('radar:product-hunt-notice-reopen', reopen)
50
+ entry()?.onOpen()
51
+ expect(reopen).toHaveBeenCalledTimes(1)
52
+ })
53
+
54
+ it('stays away in-cluster before the day and after the window', () => {
55
+ state.mode = 'in-cluster'
56
+ vi.setSystemTime(new Date('2026-10-28T17:00:00Z'))
57
+ mount()
58
+ expect(entry()).toBeUndefined()
59
+ act(() => root.unmount())
60
+
61
+ state.mode = 'local'
62
+ mount()
63
+ expect(entry()?.badge).toBe('Oct 29')
64
+ act(() => root.unmount())
65
+
66
+ vi.setSystemTime(new Date('2026-10-30T17:00:00Z'))
67
+ mount()
68
+ expect(entry()).toBeUndefined()
69
+ })
70
+
71
+ it('waits for the version check, which may have moved or cancelled the launch', () => {
72
+ state.pending = true
73
+ mount()
74
+ expect(entry()).toBeUndefined()
75
+ })
76
+ })
@@ -0,0 +1,27 @@
1
+ import { useEffect, useState } from 'react'
2
+ import { useCapabilities, useVersionCheck } from '../../api/client'
3
+ import { LAUNCH_NOTICE_REOPEN_EVENT, LAUNCH_RAIL_ITEM_ID, launchDayLabel, launchPhase, launchShownIn, resolveLaunch } from './launchWindow'
4
+
5
+ // The sidebar's Product Hunt item: where the launch card opens from and closes
6
+ // into, there for the launch window to whoever the card is for.
7
+ export function useProductHuntRailEntry(): { onOpen: () => void; id: string; badge: string } | undefined {
8
+ const { data: capabilities } = useCapabilities()
9
+ const { data: versionInfo, isPending: versionPending } = useVersionCheck()
10
+ const [now, setNow] = useState(() => Date.now())
11
+ const launch = resolveLaunch(versionInfo?.productHuntLaunch)
12
+ const phase = launchPhase(launch, now)
13
+ const ended = phase === null
14
+
15
+ useEffect(() => {
16
+ if (ended) return
17
+ const poll = window.setInterval(() => setNow(Date.now()), 60_000)
18
+ return () => window.clearInterval(poll)
19
+ }, [ended])
20
+
21
+ const mode = capabilities ? (capabilities.deployment?.mode ?? 'local') : undefined
22
+ // Waits for the version check, which says whether the launch is still on.
23
+ if (versionPending || phase === null || !launchShownIn(mode, phase)) return undefined
24
+ // Tagged with the day, so it reads as happening now and gone after.
25
+ const badge = phase === 'live' ? 'Today' : launchDayLabel(launch)
26
+ return { id: LAUNCH_RAIL_ITEM_ID, badge, onOpen: () => window.dispatchEvent(new Event(LAUNCH_NOTICE_REOPEN_EVENT)) }
27
+ }
@@ -8,6 +8,9 @@ import {
8
8
  import {
9
9
  getCrossplaneResourceRefs,
10
10
  getBoundXRRef,
11
+ getCrossplanePauseState,
12
+ isManagedResource,
13
+ isComposite,
11
14
  isClaim,
12
15
  type CrossplaneResourceRef,
13
16
  } from '@skyhook-io/k8s-ui/components/resources/resource-utils-crossplane'
@@ -140,6 +143,7 @@ export function CompositeRenderer({ data, onNavigate }: CompositeRendererProps)
140
143
  const status = getResourceStatus(kindToPluralWithGroup(ref.kind, groupFromApiVersion(ref.apiVersion)), q.data.resource) ?? undefined
141
144
  map.set(key, {
142
145
  ref,
146
+ pauseState: isManagedResource(q.data.resource) || isComposite(q.data.resource) || getCrossplanePauseState(q.data.resource) === 'acknowledged' ? getCrossplanePauseState(q.data.resource) : null,
143
147
  status: status ? { ...status, level: (status as any).level ?? 'unknown' } : undefined,
144
148
  })
145
149
  })
@@ -426,7 +426,7 @@ export function ResourcesView({ namespaces, selectedResource, onResourceClick, o
426
426
  onCreateResource={handleCreateResource}
427
427
  renderKindView={renderKindView}
428
428
  // Bulk operations
429
- onBulkDelete={(items, options) => bulkDeleteMutation.mutate({ items, force: options?.force }, { onSuccess: options?.onSuccess })}
429
+ onBulkDelete={(items, options) => bulkDeleteMutation.mutate({ items, force: options?.force }, { onSuccess: results => { if (!results.some(({ result }) => result.outcomeUnknown)) options?.onSuccess?.() } })}
430
430
  isBulkDeleting={bulkDeleteMutation.isPending}
431
431
  onBulkRestart={canBulkRestartSelectedKind ? (items, options) => bulkRestartMutation.mutate({ items }, { onSuccess: options?.onSuccess }) : undefined}
432
432
  isBulkRestarting={canBulkRestartSelectedKind && bulkRestartMutation.isPending}
@@ -398,6 +398,7 @@ export function LocalConnectionSettings({
398
398
  const save = async (update: Update) => {
399
399
  const data = await fetchConnections(update)
400
400
  receive(data)
401
+ onDirtyChange(false)
401
402
  setConfirmBack(false)
402
403
  setTask('main')
403
404
  setPending(null)
@@ -31,6 +31,7 @@ const failed: SearchCoverageEntry[] = [{ kind: 'SpStall', group: 'stall.sp-live.
31
31
 
32
32
  beforeEach(() => {
33
33
  vi.useFakeTimers()
34
+ Element.prototype.scrollIntoView = vi.fn()
34
35
  caps.data = undefined
35
36
  searches = 0
36
37
  vi.stubGlobal('fetch', vi.fn(async (input: string) => {
@@ -76,6 +77,23 @@ const advance = (ms: number) => act(async () => { await vi.advanceTimersByTimeAs
76
77
  const page = () => document.body.textContent ?? ''
77
78
 
78
79
  describe('RadarOmnibar while results load', () => {
80
+ it('requests status context and accepts a full summary from an older Radar', async () => {
81
+ unsearched = []
82
+ vi.mocked(fetch).mockImplementationOnce(async () => new Response(JSON.stringify({
83
+ hits: [{ kind: 'Pod', namespace: 'shop', name: 'legacy-pod', score: 1, summaryContext: {
84
+ health: 'unhealthy', issueCount: 2, managedBy: { kind: 'Deployment', name: 'legacy-owner' },
85
+ } }],
86
+ total: 1, searched: 1, total_matched: 1, coverage: coverageOf([]),
87
+ }), { status: 200 }))
88
+ await typeQuery('legacy-pod')
89
+
90
+ const request = new URL(String(vi.mocked(fetch).mock.calls[0][0]), 'http://localhost')
91
+ expect(request.searchParams.get('context')).toBe('status')
92
+ expect(page()).toContain('legacy-pod')
93
+ expect(page()).toContain('2 issues')
94
+ expect(page()).not.toContain('legacy-owner')
95
+ })
96
+
79
97
  it('re-queries a loading search and ends on the failure once Radar gives up on the kind', async () => {
80
98
  unsearched = pending
81
99
  await typeQuery('sp-live')
@@ -31,6 +31,7 @@ export const RadarOmnibar = forwardRef<OmnibarHandle, RadarOmnibarProps>(functio
31
31
  const [exhaustedQuery, setExhaustedQuery] = useState<string | null>(null)
32
32
 
33
33
  const { data: searchData, isFetching, isPlaceholderData, isError } = useSearch(query, {
34
+ context: 'status',
34
35
  enabled: open,
35
36
  globalNs: true,
36
37
  refetchInterval: (data) => (open && stillLoading(data) && exhaustedQuery !== query ? PENDING_RETRY_MS : false),
@@ -0,0 +1,39 @@
1
+ // @vitest-environment jsdom
2
+ import { act } from 'react'
3
+ import { createRoot, type Root } from 'react-dom/client'
4
+ import { afterEach, expect, it } from 'vitest'
5
+ import { SearchSyntaxHelp } from './SearchSyntaxHelp'
6
+
7
+ let root: Root | undefined
8
+ let host: HTMLDivElement | undefined
9
+ afterEach(() => {
10
+ act(() => root?.unmount())
11
+ host?.remove()
12
+ })
13
+
14
+ function render() {
15
+ host = document.createElement('div')
16
+ document.body.appendChild(host)
17
+ root = createRoot(host)
18
+ act(() => root!.render(<SearchSyntaxHelp />))
19
+ return host.querySelector('button')!
20
+ }
21
+
22
+ const cardShown = () => document.body.textContent?.includes('Search syntax') ?? false
23
+
24
+ it('toggles on a click with no pointer before it (assistive activation)', () => {
25
+ const button = render()
26
+ act(() => button.click())
27
+ expect(cardShown()).toBe(true)
28
+ expect(button.getAttribute('aria-expanded')).toBe('true')
29
+ act(() => button.click())
30
+ expect(cardShown()).toBe(false)
31
+ })
32
+
33
+ it('keeps a hover-opened card open on the click that follows', () => {
34
+ const button = render()
35
+ act(() => { button.dispatchEvent(new MouseEvent('mouseover', { bubbles: true, relatedTarget: document.body })) })
36
+ expect(cardShown()).toBe(true)
37
+ act(() => button.click())
38
+ expect(cardShown()).toBe(true)
39
+ })