From fbcf7ce40b755ceaa62e4b95de4eaf99b74ed3f2 Mon Sep 17 00:00:00 2001 From: Hampus Date: Sun, 15 Nov 2026 22:45:35 +0100 Subject: [PATCH] fix(app): mark home button selected on plutonium and pass pages (#4190) --- fluxer_app/src/app/Routes.ts | 5 +++++ .../app/components/layout/sidebar_nav/FluxerButton.tsx | 2 +- .../src/features/app/components/skeleton/AppSkeleton.tsx | 2 +- fluxer_app/src/features/app/components/skeleton/ShellHint.ts | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fluxer_app/src/app/Routes.ts b/fluxer_app/src/app/Routes.ts index ba3dcbaea..9800c7723 100644 --- a/fluxer_app/src/app/Routes.ts +++ b/fluxer_app/src/app/Routes.ts @@ -86,6 +86,11 @@ export const Routes = { pathname === Routes.NOTIFICATIONS || pathname === Routes.YOU, isDMRoute: (pathname: string) => pathname.startsWith('/channels/@me'), + isHomeRoute: (pathname: string) => + Routes.isDMRoute(pathname) || + pathname === Routes.PLUTONIUM || + pathname === Routes.OPERATOR_PASS || + Routes.isSpecialPage(pathname), isFavoritesRoute: (pathname: string) => pathname.startsWith('/channels/@favorites'), isDiscoverRoute: (pathname: string) => pathname.startsWith(Routes.DISCOVER) || pathname.startsWith(Routes.LEGACY_DISCOVER), diff --git a/fluxer_app/src/features/app/components/layout/sidebar_nav/FluxerButton.tsx b/fluxer_app/src/features/app/components/layout/sidebar_nav/FluxerButton.tsx index 7c751a5ea..2be2cc095 100644 --- a/fluxer_app/src/features/app/components/layout/sidebar_nav/FluxerButton.tsx +++ b/fluxer_app/src/features/app/components/layout/sidebar_nav/FluxerButton.tsx @@ -60,7 +60,7 @@ export const FluxerButton = observer(() => { const mergedButtonRef = useMergeRefs([hoverRef, buttonRef]); const contextMenuOpen = useContextMenuHoverState(buttonRef, !MobileLayout.enabled); const location = useLocation(); - const isSelected = location.pathname.startsWith(Routes.ME) || Routes.isSpecialPage(location.pathname); + const isSelected = Routes.isHomeRoute(location.pathname); const selectedChannel = SelectedChannel.selectedChannelIds.get(ME); const inlineDmsCollapsed = SidebarPreferences.inlineDmsCollapsed; const showCollapsedUnreadDmsBadge = SidebarPreferences.showCollapsedUnreadDmsBadge; diff --git a/fluxer_app/src/features/app/components/skeleton/AppSkeleton.tsx b/fluxer_app/src/features/app/components/skeleton/AppSkeleton.tsx index 50834f1bb..2612719f3 100644 --- a/fluxer_app/src/features/app/components/skeleton/AppSkeleton.tsx +++ b/fluxer_app/src/features/app/components/skeleton/AppSkeleton.tsx @@ -117,7 +117,7 @@ interface FrozenChatSkeletonPresentation { export const AppSkeleton = observer(({isExiting = false, onTransitionEnd, effectivePathname}: AppSkeletonProps) => { const location = useLocation(); const pathname = effectivePathname ?? location.pathname; - const isFluxerSelected = pathname.startsWith(Routes.ME) || Routes.isSpecialPage(pathname); + const isFluxerSelected = Routes.isHomeRoute(pathname); const isFavoritesSelected = pathname.startsWith(Routes.FAVORITES); const isDiscoverySelected = Routes.isDiscoverRoute(pathname); const isMobile = MobileLayout.enabled; diff --git a/fluxer_app/src/features/app/components/skeleton/ShellHint.ts b/fluxer_app/src/features/app/components/skeleton/ShellHint.ts index 8235793ee..648df6e96 100644 --- a/fluxer_app/src/features/app/components/skeleton/ShellHint.ts +++ b/fluxer_app/src/features/app/components/skeleton/ShellHint.ts @@ -170,7 +170,7 @@ function encodeRailItem(item: RememberedSkeletonGuildRailItem): Array { function resolveSelectedTopRowIndex(pathname: string, rail: SkeletonRailProjection): number { const leadingTopRowCount = flag(rail.fluxerVisible) + flag(rail.favoritesVisible); - if ((Routes.isDMRoute(pathname) || Routes.isSpecialPage(pathname)) && rail.fluxerVisible) { + if (Routes.isHomeRoute(pathname) && rail.fluxerVisible) { return 0; } if (Routes.isFavoritesRoute(pathname) && rail.favoritesVisible) {