@skyhook-io/radar-app 1.8.3 → 1.8.5
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.
- package/package.json +5 -5
- package/src/App.tsx +248 -92
- package/src/RadarApp.tsx +4 -1
- package/src/api/client.ts +32 -6
- package/src/components/ConnectionErrorView.tsx +1 -1
- package/src/components/ContextSwitcher.tsx +5 -1
- package/src/components/NamespaceSwitcher.tsx +21 -300
- package/src/components/applications/ApplicationsView.tsx +13 -1
- package/src/components/audit/AuditView.tsx +11 -2
- package/src/components/cost/CostView.tsx +12 -2
- package/src/components/gitops/GitOpsView.tsx +22 -7
- package/src/components/helm/HelmCompareRoute.tsx +1342 -0
- package/src/components/helm/HelmReleaseDrawer.tsx +189 -352
- package/src/components/helm/HelmView.tsx +79 -62
- package/src/components/helm/ManifestDiffViewer.tsx +4 -4
- package/src/components/home/ClusterHealthCard.tsx +6 -1
- package/src/components/home/HomeView.tsx +12 -1
- package/src/components/home/mcpToolCatalog.ts +1 -1
- package/src/components/issues/IssuesPane.tsx +29 -18
- package/src/components/resources/ResourceDetailDrawer.tsx +8 -3
- package/src/components/resources/ResourcesView.tsx +3 -0
- package/src/components/timeline/TimelineView.tsx +26 -2
- package/src/components/traffic/TrafficView.tsx +17 -10
- package/src/components/ui/Markdown.tsx +2 -2
- package/src/components/ui/Omnibar.tsx +1 -1
- package/src/components/workload/WorkloadView.tsx +5 -1
- package/src/filter/FilterLocationBridge.tsx +30 -0
- package/src/hooks/useKeyboardShortcuts.tsx +1 -0
- package/src/index.ts +15 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useCallback, useMemo, useRef, type ReactNode } from 'react';
|
|
2
|
+
import { useSearchParams } from 'react-router-dom';
|
|
3
|
+
import { FilterLocationProvider, type FilterLocation } from '@skyhook-io/k8s-ui';
|
|
4
|
+
|
|
5
|
+
// Adapts OSS Radar's react-router search params to the app-agnostic
|
|
6
|
+
// FilterLocation seam that @skyhook-io/k8s-ui's useFilterState reads. Mounted
|
|
7
|
+
// once inside the router; every list view's shared filter state flows through
|
|
8
|
+
// it, keeping the URL the single source of truth. (Radar Hub provides its own
|
|
9
|
+
// bridge over its router — k8s-ui itself never depends on react-router.)
|
|
10
|
+
export function FilterLocationBridge({ children }: { children: ReactNode }) {
|
|
11
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
12
|
+
|
|
13
|
+
// React Router's functional updater is NOT state-queued: two updates in one
|
|
14
|
+
// tick can both read the same params and clobber. Advance a ref synchronously
|
|
15
|
+
// so successive filter changes (e.g. toggling two facets fast) compose.
|
|
16
|
+
const latest = useRef(searchParams);
|
|
17
|
+
latest.current = searchParams;
|
|
18
|
+
|
|
19
|
+
const update = useCallback<FilterLocation['update']>(
|
|
20
|
+
(updater, opts) => {
|
|
21
|
+
const next = updater(new URLSearchParams(latest.current));
|
|
22
|
+
latest.current = next;
|
|
23
|
+
setSearchParams(next, opts);
|
|
24
|
+
},
|
|
25
|
+
[setSearchParams],
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const value = useMemo<FilterLocation>(() => ({ searchParams, update }), [searchParams, update]);
|
|
29
|
+
return <FilterLocationProvider value={value}>{children}</FilterLocationProvider>;
|
|
30
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,21 @@ export { ShortcutHelpOverlay } from './components/ui/ShortcutHelpOverlay';
|
|
|
23
23
|
export { ClusterSwitcher } from '@skyhook-io/k8s-ui';
|
|
24
24
|
export type { ClusterSwitcherProps, ClusterSwitcherItem } from '@skyhook-io/k8s-ui';
|
|
25
25
|
|
|
26
|
+
// Shared namespace-scope picker primitive — re-exported so embedders (Radar
|
|
27
|
+
// Hub) can render a namespace filter visually identical to OSS Radar's, driving
|
|
28
|
+
// their own per-cluster scope (Hub via ?namespaces= on the embedded RadarApp).
|
|
29
|
+
export { NamespacePicker } from '@skyhook-io/k8s-ui';
|
|
30
|
+
export type {
|
|
31
|
+
NamespacePickerProps,
|
|
32
|
+
NamespacePickerHandle,
|
|
33
|
+
NamespaceScopeView,
|
|
34
|
+
} from '@skyhook-io/k8s-ui';
|
|
35
|
+
|
|
36
|
+
// Shared bordered shell that groups the cluster + namespace segments into one
|
|
37
|
+
// pill — so Radar Hub's cluster top bar matches OSS Radar's header exactly.
|
|
38
|
+
export { ScopePill } from '@skyhook-io/k8s-ui';
|
|
39
|
+
export type { ScopePillProps } from '@skyhook-io/k8s-ui';
|
|
40
|
+
|
|
26
41
|
// Deep-link builders — so consumers (Radar Hub) construct deep links into a
|
|
27
42
|
// cluster view without hand-rolling Radar's internal URL format, which drifts
|
|
28
43
|
// silently when Radar re-routes. `resourcePath` opens the detail drawer for any
|