@skyhook-io/radar-app 0.2.0 → 0.2.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyhook-io/radar-app",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Radar's full web UI as a reusable React component. Used by Radar's own binary and by external consumers like Radar Cloud.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -181,15 +181,14 @@ export function ResourcesView({ namespaces, selectedResource, onResourceClick, o
181
181
  pinned={pinned}
182
182
  togglePin={togglePin}
183
183
  isPinned={(kind: string, group?: string) => isPinned(kind, group ?? '')}
184
- // Navigation. basePath is the full URL prefix where the Resources view
185
- // lives '/resources' for standalone Radar, '/c/{cluster}/resources'
186
- // when embedded in a host app that mounts RadarApp under a basename.
187
- // k8s-ui's ResourcesView uses this to read the current kind out of
188
- // window.location.pathname and to write URL updates (drawer open/close,
189
- // filter changes) back via history.replaceState. Without the basename
190
- // prefix, those writes would drop the host-app route context and the
191
- // URL would no longer be reloadable.
192
- basePath={getBasename() + '/resources'}
184
+ // Navigation. basePath is basename-relative. React Router's useLocation
185
+ // strips the basename from `location.pathname`, so reading the current
186
+ // kind compares basename-relative paths on both sides. URL writes go
187
+ // through `handleNavigate`, which strips any leading basename before
188
+ // handing off to react-router (which re-applies it). Embedding hosts
189
+ // (e.g. Radar Cloud at /c/{cluster}/resources) work without ResourcesView
190
+ // needing to know the basename.
191
+ basePath="/resources"
193
192
  locationSearch={location.search}
194
193
  locationPathname={location.pathname}
195
194
  onNavigate={handleNavigate}