chore: window resize handles, UI cleanup and type fixes
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
Adds edge resize handles for frameless Windows/Linux windows, reserves space for the custom titlebar, and fixes assorted unused imports, error-boundary typing and image decoding hints.
This commit is contained in:
1 parent
6675a55957
commit
ae5a2133fa
22 files changed
+161
-35
No files matched your search
@@ -6,7 +6,7 @@ import {
|
||||
type ImageType,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import React, { memo, type Ref, useCallback, useState } from "react";
|
||||
import React, { memo, type Ref, useCallback } from "react";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import { useInView } from "react-intersection-observer";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
@@ -110,6 +110,7 @@ const CardContent = ({
|
||||
{image && (
|
||||
<img
|
||||
alt={item.Name ?? "blink"}
|
||||
decoding="async"
|
||||
src={
|
||||
api && image
|
||||
? overrideIcon === "User"
|
||||
|
||||
@@ -146,7 +146,12 @@ const Carousel = ({
|
||||
aria-label={item.Name ?? "Featured item"}
|
||||
>
|
||||
{imageUrl ? (
|
||||
<img src={imageUrl} alt="" loading="lazy" />
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
/>
|
||||
) : (
|
||||
<div className="cinema-trending-placeholder">
|
||||
<span className="material-symbols-rounded">
|
||||
|
||||
@@ -102,6 +102,7 @@ const CarouselSlide = ({ item }: { item: BaseItemDto }) => {
|
||||
className={`hero-carousel-background-image${heroArtwork.isPortrait ? " is-poster" : ""}`}
|
||||
src={heroArtwork.url}
|
||||
loading="eager"
|
||||
decoding="async"
|
||||
/>
|
||||
) : (
|
||||
<div className="hero-carousel-background-icon-container">
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
type ListItemProps,
|
||||
ListItemText,
|
||||
} from "@mui/material";
|
||||
import { createLink, Link } from "@tanstack/react-router";
|
||||
import { createLink } from "@tanstack/react-router";
|
||||
import React, { forwardRef, type ReactNode } from "react";
|
||||
|
||||
interface MUIListItemLinkProps extends ListItemProps<"a"> {
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useNProgress } from "@tanem/react-nprogress";
|
||||
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
||||
import { useRouterState } from "@tanstack/react-router";
|
||||
import React, { useMemo } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
|
||||
export default function NProgress() {
|
||||
const isQueryFetching = useIsFetching();
|
||||
|
||||
@@ -195,9 +195,6 @@ const BubbleSlider = () => {
|
||||
};
|
||||
const imgUrlParams = new URLSearchParams(imgUrlParamsObject).toString();
|
||||
|
||||
const _imageAspectRatio =
|
||||
trickplayResolution.Width / trickplayResolution.Height;
|
||||
|
||||
trickplayStyle = {
|
||||
backgroundImage: `url(${api?.basePath}/Videos/${itemId}/Trickplay/${trickplayResolution.Width}/${index}.jpg?${imgUrlParams})`,
|
||||
backgroundPositionX: `${backgroundOffsetX}px`,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Box, Button } from "@mui/material";
|
||||
import { Button } from "@mui/material";
|
||||
import { AnimatePresence, motion } from "motion/react";
|
||||
import React from "react";
|
||||
import { useShallow } from "zustand/shallow";
|
||||
|
||||
@@ -13,7 +13,7 @@ const LibraryItemsSkeleton = () => {
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{Array.from(new Array(18)).map((item, index) => (
|
||||
{Array.from(new Array(18)).map((_, index) => (
|
||||
<Skeleton
|
||||
key={index}
|
||||
variant="rounded"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { LoadingButton } from "@mui/lab";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import { getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import React from "react";
|
||||
|
||||
const isMac = navigator.userAgent.includes("Macintosh");
|
||||
|
||||
type Direction =
|
||||
| "North"
|
||||
| "South"
|
||||
| "East"
|
||||
| "West"
|
||||
| "NorthEast"
|
||||
| "NorthWest"
|
||||
| "SouthEast"
|
||||
| "SouthWest";
|
||||
|
||||
const handles: Array<{ className: string; direction: Direction }> = [
|
||||
{ className: "n", direction: "North" },
|
||||
{ className: "s", direction: "South" },
|
||||
{ className: "e", direction: "East" },
|
||||
{ className: "w", direction: "West" },
|
||||
{ className: "ne", direction: "NorthEast" },
|
||||
{ className: "nw", direction: "NorthWest" },
|
||||
{ className: "se", direction: "SouthEast" },
|
||||
{ className: "sw", direction: "SouthWest" },
|
||||
];
|
||||
|
||||
/**
|
||||
* Edge/corner resize handles for the frameless Windows/Linux window. Native
|
||||
* decorations are removed there, so the OS no longer gives us resize borders.
|
||||
*/
|
||||
const WindowResizeHandles = () => {
|
||||
if (isMac) return null;
|
||||
|
||||
return (
|
||||
<div className="window-resize-handles" aria-hidden="true">
|
||||
{handles.map(({ className, direction }) => (
|
||||
<div
|
||||
key={direction}
|
||||
className={`window-resize-handle ${className}`}
|
||||
onPointerDown={(event) => {
|
||||
if (event.button !== 0) return;
|
||||
event.preventDefault();
|
||||
getCurrentWindow()
|
||||
.startResizeDragging(direction)
|
||||
.catch((error) =>
|
||||
console.warn("Could not resize window", error),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default WindowResizeHandles;
|
||||
@@ -47,6 +47,82 @@ html.is-linux body.has-window-chrome #root {
|
||||
padding-top: 44px;
|
||||
}
|
||||
|
||||
.window-resize-handles {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 10002;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.window-resize-handle {
|
||||
position: absolute;
|
||||
pointer-events: auto;
|
||||
|
||||
&.n,
|
||||
&.s {
|
||||
left: 8px;
|
||||
right: 8px;
|
||||
height: 6px;
|
||||
cursor: ns-resize;
|
||||
}
|
||||
|
||||
&.n {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
&.s {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
&.e,
|
||||
&.w {
|
||||
top: 8px;
|
||||
bottom: 8px;
|
||||
width: 6px;
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
&.e {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
&.w {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&.ne,
|
||||
&.nw,
|
||||
&.se,
|
||||
&.sw {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
&.ne {
|
||||
top: 0;
|
||||
right: 0;
|
||||
cursor: nesw-resize;
|
||||
}
|
||||
|
||||
&.nw {
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: nwse-resize;
|
||||
}
|
||||
|
||||
&.se {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
cursor: nwse-resize;
|
||||
}
|
||||
|
||||
&.sw {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
cursor: nesw-resize;
|
||||
}
|
||||
}
|
||||
|
||||
.window-chrome {
|
||||
position: fixed;
|
||||
inset: 0 0 auto;
|
||||
|
||||
Reference in new issue
Block a user