feat(navigation): clearer labels, context and direct destinations
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped

Shows the current page in the app bar, labels every top-level icon action, adds Search/Favorites and a Shows shortcut to the main navigation, removes the redundant search icon on the search page, and cleans up page titles on leave.
This commit is contained in:
1xDed committed 2026-11-28 17:47:35 +03:00
1 parent b592680006
commit 7c5fa8f869
13 files changed
+214 -60

No files matched your search

+15
View File
@@ -28,6 +28,21 @@
backdrop-filter: none !important;
}
&-title {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
max-width: min(38vw, 520px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: rgb(255 255 255 / 0.72);
font-size: 0.9rem !important;
font-weight: 500 !important;
pointer-events: none;
}
&-avatar {
background: rgb(255 255 255 / 0.1) !important;
&-icon {
+51 -24
View File
@@ -1,5 +1,7 @@
import MuiAppBar from "@mui/material/AppBar";
import IconButton from "@mui/material/IconButton";
import Tooltip from "@mui/material/Tooltip";
import Typography from "@mui/material/Typography";
import useScrollTrigger from "@mui/material/useScrollTrigger";
import { useLocation, useNavigate } from "@tanstack/react-router";
import React, { useCallback, useState } from "react";
@@ -67,7 +69,18 @@ const AppBarContent = () => {
navigate({ to: "/favorite" });
}, []);
useHeaderStore(useShallow((s) => ({ pageTitle: s.pageTitle })));
const { pageTitle } = useHeaderStore(
useShallow((s) => ({ pageTitle: s.pageTitle })),
);
const fallbackTitle = (() => {
const path = location.pathname;
if (path === "/favorite") return "Favorites";
if (path.startsWith("/music/")) return "Music";
if (path.startsWith("/player/audio")) return "Now Playing";
return "";
})();
const title = pageTitle || fallbackTitle;
return (
<>
@@ -86,38 +99,52 @@ const AppBarContent = () => {
data-tauri-drag-region
style={{ gap: "0.6em" }}
>
<IconButton onClick={handleDrawerOpen} aria-label="Open navigation">
<span className="material-symbols-rounded">menu</span>
</IconButton>
<Tooltip title="Open navigation">
<IconButton onClick={handleDrawerOpen} aria-label="Open navigation">
<span className="material-symbols-rounded">menu</span>
</IconButton>
</Tooltip>
<MemoizeBackButton />
<IconButton onClick={handleNavigateToHome} aria-label="Home">
<span
className={
location.pathname === "/home"
? "material-symbols-rounded fill"
: "material-symbols-rounded"
}
>
home
</span>
</IconButton>
<Tooltip title="Home">
<IconButton onClick={handleNavigateToHome} aria-label="Home">
<span
className={
location.pathname === "/home"
? "material-symbols-rounded fill"
: "material-symbols-rounded"
}
>
home
</span>
</IconButton>
</Tooltip>
</div>
{title && (
<Typography className="appBar-title" noWrap>
{title}
</Typography>
)}
<div
className="flex flex-row"
data-tauri-drag-region
style={{ gap: "0.6em" }}
>
<CastButton />
<IconButton onClick={toggleSearchDialog} aria-label="Search">
<span className="material-symbols-rounded">search</span>
</IconButton>
<IconButton
onClick={handleNavigateToFavorite}
aria-label="Favorites"
>
<span className="material-symbols-rounded">favorite</span>
</IconButton>
<Tooltip title="Search">
<IconButton onClick={toggleSearchDialog} aria-label="Search">
<span className="material-symbols-rounded">search</span>
</IconButton>
</Tooltip>
<Tooltip title="Favorites">
<IconButton
onClick={handleNavigateToFavorite}
aria-label="Favorites"
>
<span className="material-symbols-rounded">favorite</span>
</IconButton>
</Tooltip>
<UserAvatarMenu />
<WindowControls />
</div>
+35 -1
View File
@@ -1,5 +1,12 @@
import { getUserViewApi } from "@jellyfin/sdk/lib/utils/api/user-view-api";
import { Divider, Drawer, List, ListItem, ListItemButton } from "@mui/material";
import {
Divider,
Drawer,
List,
ListItem,
ListItemButton,
Typography,
} from "@mui/material";
import { useQuery } from "@tanstack/react-query";
import React, { useEffect, useMemo } from "react";
import { useApiInContext } from "@/utils/store/api";
@@ -61,6 +68,12 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
</ListItem>
</List>
<Divider variant="middle" />
<Typography
variant="overline"
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
>
Browse
</Typography>
<List>
<ListItemLink
className="library-drawer-item"
@@ -69,6 +82,21 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
primary="Home"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/search"
search={{ query: "" }}
icon="search"
primary="Search"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/favorite"
icon="favorite"
primary="Favorites"
onClick={onClose}
/>
{libraries.isSuccess &&
libraries.data?.Items?.map((library) => (
<ListItemLink
@@ -85,6 +113,12 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
))}
</List>
<Divider variant="middle" />
<Typography
variant="overline"
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
>
Settings
</Typography>
<List>
<ListItemLink
to="/settings/preferences"