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"
+6 -1
View File
@@ -9,7 +9,12 @@ export default function BackButton() {
};
return (
<IconButton onClick={handleClick} disabled={history.length === 0}>
<IconButton
onClick={handleClick}
disabled={history.length === 0}
aria-label="Back"
title="Back"
>
<span className="material-symbols-rounded">arrow_back</span>
</IconButton>
);
@@ -15,6 +15,7 @@ import ShowMoreText from "@/components/showMoreText";
import { useApiInContext } from "@/utils/store/api";
import { useBackdropStore } from "@/utils/store/backdrop";
import { useCentralStore } from "@/utils/store/central";
import useHeaderStore from "@/utils/store/header";
import type MediaQualityInfo from "@/utils/types/mediaQualityInfo";
import "./itemDetail.scss";
@@ -90,6 +91,13 @@ const ItemDetailLayout = ({
setBackdrop(hash);
}, [hash, setBackdrop]);
// Show a human-readable location in the global app bar.
const setPageTitle = useHeaderStore((state) => state.setPageTitle);
useEffect(() => {
setPageTitle(item.Name ?? null);
return () => setPageTitle(null);
}, [item.Name, setPageTitle]);
return (
<motion.div
key={item.Id}
+17 -3
View File
@@ -270,11 +270,19 @@ export const LibraryHeader = () => {
color="transparent"
>
<div className="flex flex-row" data-tauri-drag-region style={{ gap: "0.6em" }}>
<IconButton onClick={handleDrawerOpen}>
<IconButton
onClick={handleDrawerOpen}
aria-label="Open navigation"
title="Open navigation"
>
<div className="material-symbols-rounded">menu</div>
</IconButton>
<MemoizeBackButton />
<IconButton onClick={handleNavigateToHome}>
<IconButton
onClick={handleNavigateToHome}
aria-label="Home"
title="Home"
>
<div
className={
location.pathname === "/home"
@@ -393,12 +401,18 @@ export const LibraryHeader = () => {
<span className="library-header-cast">
<CastButton />
</span>
<IconButton onClick={toggleSearchDialog}>
<IconButton
onClick={toggleSearchDialog}
aria-label="Search"
title="Search"
>
<div className="material-symbols-rounded">search</div>
</IconButton>
<IconButton
className="library-header-favorite"
onClick={handleNavigateToFavorite}
aria-label="Favorites"
title="Favorites"
>
<div className="material-symbols-rounded">favorite</div>
</IconButton>
+31 -18
View File
@@ -594,24 +594,37 @@ const AudioPlayer = () => {
<span className="material-symbols-rounded">shuffle</span>
</IconButton>
</Tooltip>
<IconButton size="small" onClick={handlePrevious}>
<span className="material-symbols-rounded">skip_previous</span>
</IconButton>
<IconButton
className="media-bar-play"
onClick={() =>
remote
? remoteCommand(PlaystateCommand.PlayPause)
: handlePlayPause()
}
>
<span className="material-symbols-rounded">
{isPlaying ? "pause" : "play_arrow"}
</span>
</IconButton>
<IconButton size="small" onClick={handleNext}>
<span className="material-symbols-rounded">skip_next</span>
</IconButton>
<Tooltip title="Previous">
<IconButton
size="small"
onClick={handlePrevious}
aria-label="Previous"
>
<span className="material-symbols-rounded">
skip_previous
</span>
</IconButton>
</Tooltip>
<Tooltip title={isPlaying ? "Pause" : "Play"}>
<IconButton
className="media-bar-play"
aria-label={isPlaying ? "Pause" : "Play"}
onClick={() =>
remote
? remoteCommand(PlaystateCommand.PlayPause)
: handlePlayPause()
}
>
<span className="material-symbols-rounded">
{isPlaying ? "pause" : "play_arrow"}
</span>
</IconButton>
</Tooltip>
<Tooltip title="Next">
<IconButton size="small" onClick={handleNext} aria-label="Next">
<span className="material-symbols-rounded">skip_next</span>
</IconButton>
</Tooltip>
<Tooltip
title={
remote
@@ -225,10 +225,18 @@ const VideoPlayerControls = ({
}}
>
<div className="video-player-osd-header flex flex-justify-spaced-between flex-align-center">
<IconButton onClick={handleExitPlayer}>
<IconButton
onClick={handleExitPlayer}
aria-label="Exit player"
title="Exit player"
>
<span className="material-symbols-rounded">arrow_back</span>
</IconButton>
<IconButton onClick={(e) => setSettingsMenuRef(e.currentTarget)}>
<IconButton
onClick={(e) => setSettingsMenuRef(e.currentTarget)}
aria-label="Player settings"
title="Player settings"
>
<span className="material-symbols-rounded">settings</span>
</IconButton>
<VideoPlayerSettingsMenu
+6 -1
View File
@@ -61,7 +61,12 @@ export const UserAvatarMenu = () => {
return (
<div>
<IconButton sx={menuButtonSx} onClick={handleMenuOpen}>
<IconButton
sx={menuButtonSx}
onClick={handleMenuOpen}
aria-label="Account menu"
title="Account menu"
>
{!!user?.Id &&
(user?.PrimaryImageTag === undefined ? (
<Avatar className="appBar-avatar" alt={user?.Name ?? "image"}>