Files
Blink/src/components/windowControls/windowChrome.tsx
T
1xDed fcf61012db 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
2026-12-01 02:47:40 +03:00

45 lines
1.5 KiB
TypeScript

import { useLocation } from "@tanstack/react-router";
import React from "react";
import { shouldShowAppBar } from "@/components/appBar/appBar";
import WindowControls from ".";
import "./windowControls.scss";
const isMac = navigator.userAgent.includes("Macintosh");
/**
* 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">
<div className="window-chrome-drag" data-tauri-drag-region />
<div className="window-chrome-controls">
<WindowControls />
</div>
</div>
);
};
export default WindowChrome;