fix(ui): compact library/search titlebars and reliable local stop
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

Library/search headers no longer overflow at narrow widths and use the shared titlebar strip outside macOS. Transferring a local video now pauses it before reporting it stopped, preventing a ghost playback session.
This commit is contained in:
1xDed committed 2026-11-28 02:40:42 +03:00
1 parent 5b4efd20c0
commit 0d2edcab3d
6 files changed
+38 -19

No files matched your search

+11 -5
View File
@@ -25,7 +25,6 @@ import BackButton from "../buttons/backButton";
import CastButton from "../buttons/castButton";
import { FiltersDialogTrigger } from "../filtersDialog";
import { UserAvatarMenu } from "../userAvatarMenu";
import WindowControls from "../windowControls";
import "./libraryHeader.scss";
const route = getRouteApi("/_api/library/$id");
@@ -387,16 +386,23 @@ export const LibraryHeader = () => {
</TextField>
<FiltersDialogTrigger />
</div>
<div className="flex flex-row" style={{ gap: "0.6em" }}>
<CastButton />
<div
className="library-header-actions flex flex-row"
style={{ gap: "0.6em" }}
>
<span className="library-header-cast">
<CastButton />
</span>
<IconButton onClick={toggleSearchDialog}>
<div className="material-symbols-rounded">search</div>
</IconButton>
<IconButton onClick={handleNavigateToFavorite}>
<IconButton
className="library-header-favorite"
onClick={handleNavigateToFavorite}
>
<div className="material-symbols-rounded">favorite</div>
</IconButton>
<UserAvatarMenu />
<WindowControls />
</div>
</AppBar>
<NavigationDrawer open={showDrawer} onClose={handleDrawerClose} />
@@ -1,3 +1,10 @@
@media (max-width: 980px) {
.library-header-cast,
.library-header-favorite {
display: none !important;
}
}
.library-header {
display: flex;
align-items: center;
+12 -4
View File
@@ -114,6 +114,17 @@ const RemoteControlDialog = () => {
} else if (transfer?.kind === "video") {
const playback = usePlaybackStore.getState();
const transferredItemId = playback.metadata.item?.Id;
const stoppedPosition = playback.playerState.currentTime;
// Stop local playback first so a trailing timeupdate cannot
// re-mark the old session as playing after we report it stopped.
(
document
.querySelector("hls-video")
?.shadowRoot?.querySelector("video") as HTMLVideoElement | null
)?.pause();
usePlaybackStore.setState(usePlaybackStore.getInitialState());
clearQueue();
navigate({ to: "/home" });
if (api && transferredItemId) {
try {
await getSessionApi(api).reportPlaybackStopped({
@@ -122,16 +133,13 @@ const RemoteControlDialog = () => {
ItemId: transferredItemId,
MediaSourceId: playback.mediaSource.id,
PlaySessionId: playback.playsessionId,
PositionTicks: playback.playerState.currentTime,
PositionTicks: stoppedPosition,
},
});
} catch (error) {
console.warn("Could not report the transferred video as stopped", error);
}
}
usePlaybackStore.setState(usePlaybackStore.getInitialState());
clearQueue();
navigate({ to: "/home" });
}
closeDialog();
},
@@ -31,14 +31,8 @@ const WindowChrome = () => {
const { pathname } = useLocation();
if (isMac) return null;
if (pathname === "/home" || shouldShowAppBar(pathname)) return null;
// These routes draw their own headers and include WindowControls.
if (
pathname.startsWith("/library") ||
pathname.startsWith("/search") ||
pathname.startsWith("/player")
) {
return null;
}
// The video player has its own fullscreen UI.
if (pathname.startsWith("/player")) return null;
return <WindowChromeContent />;
};
@@ -47,6 +47,12 @@ html.is-linux body.has-window-chrome #root {
padding-top: 44px;
}
// Search uses a fixed header; move it below the custom titlebar strip.
html.is-windows body.has-window-chrome .search-header,
html.is-linux body.has-window-chrome .search-header {
top: calc(1em + 44px) !important;
}
.window-resize-handles {
position: fixed;
inset: 0;
-2
View File
@@ -29,7 +29,6 @@ import { useShallow } from "zustand/shallow";
import { NavigationDrawer } from "@/components/appBar/navigationDrawer";
import BackButton from "@/components/buttons/backButton";
import { UserAvatarMenu } from "@/components/userAvatarMenu";
import WindowControls from "@/components/windowControls";
import { useApiInContext } from "@/utils/store/api";
import useDebounce from "@/utils/hooks/useDebounce";
import { useCentralStore } from "@/utils/store/central";
@@ -357,7 +356,6 @@ function SearchAppBar({
<div className="material-symbols-rounded">favorite</div>
</IconButton>
<UserAvatarMenu />
<WindowControls />
</div>
</AppBar>
<NavigationDrawer