Skip to content

Commit 09fc12c

Browse files
committed
Merge the phone app's web branch (mobile-shell-polish at 7f224ec) into the Android shell branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012xYtaUjbkB1hwLtK4TEzhq
2 parents bd16943 + 7f224ec commit 09fc12c

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎app/src/components/layout/page-shell.tsx‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IconChevronLeft } from "@tabler/icons-react";
2-
import { Link, type LinkProps, useRouterState } from "@tanstack/react-router";
2+
import { Link, type LinkProps, useRouter } from "@tanstack/react-router";
33
import type * as React from "react";
44
import { createContext, useContext } from "react";
55
import { nativeShell } from "@/lib/native-shell/shell";
@@ -70,9 +70,15 @@ export function PageShell({
7070
* link's own address is only the fallback (`lib/native-shell/use-tab-navigation.ts`).
7171
*/
7272
const shell = nativeShell() !== null;
73-
const atTabRoot = useRouterState({
74-
select: (state) => rootTabOf(state.location.pathname) !== null,
75-
});
73+
/*
74+
* Read only in the shell, and from a router only where there is one: a screen drawn without a
75+
* router (a test of a settings page) draws exactly as before, outside the shell.
76+
*/
77+
const router = useRouter({ warn: false });
78+
const atTabRoot =
79+
shell &&
80+
rootTabOf(router?.state.location.pathname ?? window.location.pathname) !==
81+
null;
7682
const back: PageBack | undefined =
7783
backButton ??
7884
fallbackBack ??

0 commit comments

Comments
 (0)