diff --git a/app/components/RouteTabs.tsx b/app/components/RouteTabs.tsx
index 6210a4cc5..b1c0b3b39 100644
--- a/app/components/RouteTabs.tsx
+++ b/app/components/RouteTabs.tsx
@@ -79,10 +79,16 @@ export function RouteTabs({
export interface TabProps {
to: string
+ /**
+ * Used in rare cases when a tab has sidebar tabs underneath and we want to be
+ * able to link directly to the first sidebar tab, but we of course also want
+ * this tab to appear active for all the sidebar tabs. See instance metrics.
+ */
+ toPrefix?: string
children: ReactNode
}
-export const Tab = ({ to, children }: TabProps) => {
- const isActive = useIsActivePath({ to })
+export const Tab = ({ to, toPrefix, children }: TabProps) => {
+ const isActive = useIsActivePath({ to: toPrefix || to })
return (
{
className={cn('ox-tab', { 'is-selected': isActive })}
tabIndex={isActive ? 0 : -1}
aria-selected={isActive}
+ data-state={isActive ? 'active' : 'inactive'}
>