feat(chrome): shared account menu and global app header
Move account actions (Settings, Downloads, Display preferences, Sign out) out of the library-only header into a shared AccountMenu anchored in a global AppHeader, available on every authenticated non-immersive screen. Add a layoutShell helper deciding where chrome shows, expose serverName/serverUrl auth stores, and a display view-mode preference. The settings page also gains the UR-053 WiFi-only toggle. TRACES: UR-054 | DR-075, DR-076, DR-077
This commit is contained in:
@@ -67,6 +67,29 @@ export function routeOwnsLayout({ pathname }: { pathname: string }): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the root layout should render the shared app header (logo, desktop
|
||||
* nav, and the account menu) for this route.
|
||||
*
|
||||
* Routes that own their layout (library) render their own AppHeader, so the
|
||||
* root must not double it up. `/settings` owns its content but deliberately has
|
||||
* no account menu (the user is already there). `/player/*` and `/login` are
|
||||
* immersive/chrome-free. Everything else authenticated (`/`, `/search`,
|
||||
* `/downloads`) gets the header from the root — the whole point of UR-054.
|
||||
*
|
||||
* TRACES: UR-054 | DR-076
|
||||
*/
|
||||
export function showGlobalHeader({
|
||||
pathname,
|
||||
isAuthenticated,
|
||||
}: BottomUiVisibilityInput): boolean {
|
||||
return (
|
||||
isAuthenticated &&
|
||||
!routeOwnsLayout({ pathname }) &&
|
||||
!pathname.startsWith("/settings")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether any bottom UI is showing for this route (mini player, nav, or both).
|
||||
* The bottom UI is rendered in flex flow below the scroller (see BottomUi.svelte),
|
||||
|
||||
Reference in New Issue
Block a user