@orsetra/shared-ui 1.10.25 → 1.10.26

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.
@@ -79,8 +79,6 @@ export function MainSidebarFlyout({
79
79
  <a
80
80
  key={sub.id}
81
81
  href={sub.disabled ? undefined : sub.href}
82
- target={sub.target}
83
- rel={sub.target === "_blank" ? "noopener noreferrer" : undefined}
84
82
  aria-disabled={sub.disabled}
85
83
  title={sub.disabled ? "Select a project/environment first" : undefined}
86
84
  onClick={(e) => { if (sub.disabled) e.preventDefault() }}
@@ -151,7 +149,6 @@ export function MainSidebarFlyout({
151
149
  <a
152
150
  key={i}
153
151
  href={link.href}
154
- {...(isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {})}
155
152
  className="flex items-start gap-x-3 px-2 py-2 border-l-4 border-transparent hover:bg-ui-background hover:border-interactive transition-colors"
156
153
  >
157
154
  <LinkIcon className="h-4 w-4 flex-shrink-0 mt-0.5 text-text-secondary" />
@@ -206,7 +203,6 @@ export function MainSidebarFlyout({
206
203
  <a
207
204
  key={i}
208
205
  href={link.href}
209
- {...(isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {})}
210
206
  className="flex items-start gap-x-3 px-2 py-2 border-l-4 border-transparent hover:bg-ui-background hover:border-interactive transition-colors"
211
207
  >
212
208
  <LinkIcon className="h-4 w-4 flex-shrink-0 mt-0.5 text-text-secondary" />
@@ -11,6 +11,13 @@ interface QuickAccessTrackerProps {
11
11
  icon?: string
12
12
  /** Set to false to skip tracking this page (e.g. list/index pages) */
13
13
  enabled?: boolean
14
+ /**
15
+ * Canonical href for this resource — overrides the current page URL.
16
+ * Pass the resource root (e.g. "/my-app") so that visiting any tab of
17
+ * the same resource tracks a single entry instead of one per tab.
18
+ * Absolute URL or path relative to the current origin.
19
+ */
20
+ href?: string
14
21
  }
15
22
 
16
23
  /**
@@ -18,7 +25,7 @@ interface QuickAccessTrackerProps {
18
25
  * sidebar's quick-access list. Tracks on mount and whenever pathname changes.
19
26
  * Renders nothing.
20
27
  */
21
- export function QuickAccessTracker({ label, icon, enabled = true }: QuickAccessTrackerProps) {
28
+ export function QuickAccessTracker({ label, icon, enabled = true, href: hrefProp }: QuickAccessTrackerProps) {
22
29
  const pathname = usePathname()
23
30
  const { addItem } = useQuickAccess()
24
31
  // Stable ref so the effect doesn't re-run when addItem reference changes
@@ -27,11 +34,12 @@ export function QuickAccessTracker({ label, icon, enabled = true }: QuickAccessT
27
34
 
28
35
  useEffect(() => {
29
36
  if (!enabled || !label || !pathname) return
30
- // Use clean URL (no query params) — useQuickAccess normalises further
31
- const href = window.location.origin + window.location.pathname
37
+ const href = hrefProp
38
+ ? (hrefProp.startsWith("http") ? hrefProp : window.location.origin + hrefProp)
39
+ : window.location.origin + window.location.pathname
32
40
  addRef.current({ label, href, icon })
33
41
  // eslint-disable-next-line react-hooks/exhaustive-deps
34
- }, [pathname, label, icon, enabled])
42
+ }, [pathname, label, icon, enabled, hrefProp])
35
43
 
36
44
  return null
37
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orsetra/shared-ui",
3
- "version": "1.10.25",
3
+ "version": "1.10.26",
4
4
  "description": "Shared UI components for Orsetra platform",
5
5
  "main": "./index.ts",
6
6
  "types": "./index.ts",