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

+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>