/* "Immersive" routes: the ones that build their own navigation bar with `LargeTitle` (a large title that collapses) and therefore don't show the global header with logo + theme toggle + avatar. The pattern is resolved by hand and not with `matchRoute` because the two routes carry params (`matchRoute` requires them) and because child routes are NOT immersive even when they share a prefix: `/groups/:id/attendees/new` still uses the global header. */ const IMMERSIVE_SEGMENTS: ReadonlyArray = [ ['groups', 'attention'], ['groups', ':id'], ['groups', ':id', 'analytics'], ['groups', ':id', 'attendees', ':attendeeId'], ['class', ':id', 'attendance'], ] /* Static routes that sit where a param would go. Without this list `/groups/new` (create group) would be taken for a group detail page and would lose the global header, and `/groups/attention/...` for a group's children. (`/groups/attention` itself is immersive through its own pattern.) */ const STATIC_SEGMENTS: ReadonlySet = new Set(['new', 'attention']) export function isImmersiveRoute(pathname: string) { const segments = pathname.split('/').filter(Boolean) return IMMERSIVE_SEGMENTS.some( (pattern) => pattern.length === segments.length && pattern.every((part, index) => { const segment = segments[index] if (part.startsWith(':')) return !STATIC_SEGMENTS.has(segment) return part === segment }), ) }