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
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:
1 parent
5b4efd20c0
commit
0d2edcab3d
6 files changed
+37
-18
No files matched your search
@@ -25,7 +25,6 @@ import BackButton from "../buttons/backButton";
|
|||||||
import CastButton from "../buttons/castButton";
|
import CastButton from "../buttons/castButton";
|
||||||
import { FiltersDialogTrigger } from "../filtersDialog";
|
import { FiltersDialogTrigger } from "../filtersDialog";
|
||||||
import { UserAvatarMenu } from "../userAvatarMenu";
|
import { UserAvatarMenu } from "../userAvatarMenu";
|
||||||
import WindowControls from "../windowControls";
|
|
||||||
import "./libraryHeader.scss";
|
import "./libraryHeader.scss";
|
||||||
|
|
||||||
const route = getRouteApi("/_api/library/$id");
|
const route = getRouteApi("/_api/library/$id");
|
||||||
@@ -387,16 +386,23 @@ export const LibraryHeader = () => {
|
|||||||
</TextField>
|
</TextField>
|
||||||
<FiltersDialogTrigger />
|
<FiltersDialogTrigger />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row" style={{ gap: "0.6em" }}>
|
<div
|
||||||
|
className="library-header-actions flex flex-row"
|
||||||
|
style={{ gap: "0.6em" }}
|
||||||
|
>
|
||||||
|
<span className="library-header-cast">
|
||||||
<CastButton />
|
<CastButton />
|
||||||
|
</span>
|
||||||
<IconButton onClick={toggleSearchDialog}>
|
<IconButton onClick={toggleSearchDialog}>
|
||||||
<div className="material-symbols-rounded">search</div>
|
<div className="material-symbols-rounded">search</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton onClick={handleNavigateToFavorite}>
|
<IconButton
|
||||||
|
className="library-header-favorite"
|
||||||
|
onClick={handleNavigateToFavorite}
|
||||||
|
>
|
||||||
<div className="material-symbols-rounded">favorite</div>
|
<div className="material-symbols-rounded">favorite</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<UserAvatarMenu />
|
<UserAvatarMenu />
|
||||||
<WindowControls />
|
|
||||||
</div>
|
</div>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
<NavigationDrawer open={showDrawer} onClose={handleDrawerClose} />
|
<NavigationDrawer open={showDrawer} onClose={handleDrawerClose} />
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
@media (max-width: 980px) {
|
||||||
|
.library-header-cast,
|
||||||
|
.library-header-favorite {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.library-header {
|
.library-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -114,6 +114,17 @@ const RemoteControlDialog = () => {
|
|||||||
} else if (transfer?.kind === "video") {
|
} else if (transfer?.kind === "video") {
|
||||||
const playback = usePlaybackStore.getState();
|
const playback = usePlaybackStore.getState();
|
||||||
const transferredItemId = playback.metadata.item?.Id;
|
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) {
|
if (api && transferredItemId) {
|
||||||
try {
|
try {
|
||||||
await getSessionApi(api).reportPlaybackStopped({
|
await getSessionApi(api).reportPlaybackStopped({
|
||||||
@@ -122,16 +133,13 @@ const RemoteControlDialog = () => {
|
|||||||
ItemId: transferredItemId,
|
ItemId: transferredItemId,
|
||||||
MediaSourceId: playback.mediaSource.id,
|
MediaSourceId: playback.mediaSource.id,
|
||||||
PlaySessionId: playback.playsessionId,
|
PlaySessionId: playback.playsessionId,
|
||||||
PositionTicks: playback.playerState.currentTime,
|
PositionTicks: stoppedPosition,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn("Could not report the transferred video as stopped", error);
|
console.warn("Could not report the transferred video as stopped", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
usePlaybackStore.setState(usePlaybackStore.getInitialState());
|
|
||||||
clearQueue();
|
|
||||||
navigate({ to: "/home" });
|
|
||||||
}
|
}
|
||||||
closeDialog();
|
closeDialog();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,14 +31,8 @@ const WindowChrome = () => {
|
|||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
if (isMac) return null;
|
if (isMac) return null;
|
||||||
if (pathname === "/home" || shouldShowAppBar(pathname)) return null;
|
if (pathname === "/home" || shouldShowAppBar(pathname)) return null;
|
||||||
// These routes draw their own headers and include WindowControls.
|
// The video player has its own fullscreen UI.
|
||||||
if (
|
if (pathname.startsWith("/player")) return null;
|
||||||
pathname.startsWith("/library") ||
|
|
||||||
pathname.startsWith("/search") ||
|
|
||||||
pathname.startsWith("/player")
|
|
||||||
) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return <WindowChromeContent />;
|
return <WindowChromeContent />;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,12 @@ html.is-linux body.has-window-chrome #root {
|
|||||||
padding-top: 44px;
|
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 {
|
.window-resize-handles {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import { useShallow } from "zustand/shallow";
|
|||||||
import { NavigationDrawer } from "@/components/appBar/navigationDrawer";
|
import { NavigationDrawer } from "@/components/appBar/navigationDrawer";
|
||||||
import BackButton from "@/components/buttons/backButton";
|
import BackButton from "@/components/buttons/backButton";
|
||||||
import { UserAvatarMenu } from "@/components/userAvatarMenu";
|
import { UserAvatarMenu } from "@/components/userAvatarMenu";
|
||||||
import WindowControls from "@/components/windowControls";
|
|
||||||
import { useApiInContext } from "@/utils/store/api";
|
import { useApiInContext } from "@/utils/store/api";
|
||||||
import useDebounce from "@/utils/hooks/useDebounce";
|
import useDebounce from "@/utils/hooks/useDebounce";
|
||||||
import { useCentralStore } from "@/utils/store/central";
|
import { useCentralStore } from "@/utils/store/central";
|
||||||
@@ -357,7 +356,6 @@ function SearchAppBar({
|
|||||||
<div className="material-symbols-rounded">favorite</div>
|
<div className="material-symbols-rounded">favorite</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<UserAvatarMenu />
|
<UserAvatarMenu />
|
||||||
<WindowControls />
|
|
||||||
</div>
|
</div>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
<NavigationDrawer
|
<NavigationDrawer
|
||||||
|
|||||||
Reference in new issue
Block a user