fix(ui): unify titlebar and playback state

- window buttons live in the page header on library/search pages and in a shared chrome strip where a page has no header; removed the 44px root padding toggle that made pages jump on navigation
- video player gets its own titlebar row with window controls; the audio player hides the global app bar
- starting a video stops music and vice versa; a single track queues the rest of its album, or the artist's songs when AlbumId is missing
- album page no longer crashes on albums without AlbumArtists
- queue summary is localized
This commit is contained in:
1xDed committed 2026-12-01 02:47:40 +03:00
1 parent d9bce4de04
commit fcf61012db
13 files changed
+245 -171

No files matched your search

+24 -20
View File
@@ -1,5 +1,5 @@
import { useLocation } from "@tanstack/react-router";
import React, { useEffect } from "react";
import React from "react";
import { shouldShowAppBar } from "@/components/appBar/appBar";
import WindowControls from ".";
@@ -7,11 +7,29 @@ import "./windowControls.scss";
const isMac = navigator.userAgent.includes("Macintosh");
const WindowChromeContent = () => {
useEffect(() => {
document.body.classList.add("has-window-chrome");
return () => document.body.classList.remove("has-window-chrome");
}, []);
/**
* Frameless-window fallback for pages that do not draw the app header:
* a small drag strip plus the window buttons in the top-right corner.
*
* Pages with a header (home, library, search, player) put the window buttons
* in that header's row instead, so every page has one titlebar plane and the
* buttons never float over the avatar or the page controls.
*/
const WindowChrome = () => {
const { pathname } = useLocation();
if (isMac) return null;
// The global app header owns the window buttons on these routes.
if (shouldShowAppBar(pathname)) return null;
// The home page draws its own header inside the hero frame.
if (pathname === "/home") return null;
// The video/photo players have their own fullscreen UI.
if (pathname.startsWith("/player")) return null;
// Library and search headers draw the window buttons themselves.
if (pathname.startsWith("/library") || pathname.startsWith("/search")) {
return null;
}
// The remote control page has its own titlebar with window buttons.
if (pathname.startsWith("/remote")) return null;
return (
<div className="window-chrome">
@@ -23,18 +41,4 @@ const WindowChromeContent = () => {
);
};
/**
* Frameless-window fallback for pages that do not draw the app header:
* a small drag strip plus the window buttons in the top-right corner.
*/
const WindowChrome = () => {
const { pathname } = useLocation();
if (isMac) return null;
if (pathname === "/home" || shouldShowAppBar(pathname)) return null;
// The video player has its own fullscreen UI.
if (pathname.startsWith("/player")) return null;
return <WindowChromeContent />;
};
export default WindowChrome;