Address the first beta's bugs and requested changes
Startup now uses the Android iris animation, and playback can continue in a corner miniplayer while browsing (the video is drawn into a corner rectangle beneath a matching hole in the page). The player keeps the window controls, hides its chrome when the pointer leaves, and gains audio/subtitle tracks, audio sync, source bitrate and playback details in its options. Subtitles can be styled in Settings with a live preview. Categories replace Collections, the A–Z rail magnifies, descriptions expand in place, downloads can be removed in bulk, and search keeps its results while typing. Fixes scroll jank from per-card and scrolling backdrop blurs, the hidden colour wash, the cubic volume curve, loud theme music, the search focus ring, a stray nav indicator, Continue Watching previews and the TV Shows header overlap. Removes the star rating, the duplicate Settings menu entry and the server settings' Show advanced switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
be865fa992
commit
43c168da95
35 changed files with 1771 additions and 327 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useMemo, useState, type ReactNode } from 'react';
|
||||
import * as api from '../plex/api';
|
||||
import type { Item } from '../plex/types';
|
||||
import { invalidateLibrary, useChildren, useItem, useRelated, useServerQuery } from '../app/queries';
|
||||
import { useChildren, useItem, useRelated, useServerQuery } from '../app/queries';
|
||||
import { useServer } from '../app/session';
|
||||
import { useSettings } from '../app/settings';
|
||||
import { goBack, navigate, useRouter } from '../app/router';
|
||||
|
|
@ -11,7 +11,7 @@ import { Backdrop } from '../ui/Backdrop';
|
|||
import { Facts, HubShelf, LandscapeCard, PersonCard, PosterCard, Shelf, TitleArt } from '../ui/media';
|
||||
import { Artwork, Button, EmptyState, ErrorState, IconButton, PageLoader, Select } from '../ui/primitives';
|
||||
import { Icon } from '../ui/Icon';
|
||||
import { openMenu, toastError } from '../ui/overlays';
|
||||
import { openMenu } from '../ui/overlays';
|
||||
import { useDownloads } from '../downloads/store';
|
||||
import { playThemeMusic, stopThemeMusic } from '../player/theme';
|
||||
|
||||
|
|
@ -40,24 +40,29 @@ export function ItemScreen({ id }: { id: string }) {
|
|||
|
||||
// —— Shared pieces ————————————————————————————————————————————————
|
||||
|
||||
function Synopsis({ item, text }: { item: Item; text: string }) {
|
||||
/** Long descriptions open in place when clicked, and close again the same way. */
|
||||
function Synopsis({ text }: { item: Item; text: string }) {
|
||||
const [clamped, setClamped] = useState(false);
|
||||
const [open, setOpen] = useState(false);
|
||||
useEffect(() => setOpen(false), [text]);
|
||||
if (!text) return null;
|
||||
const toggle = () => (clamped || open) && setOpen(!open);
|
||||
return (
|
||||
<div className="synopsis-wrap">
|
||||
<p
|
||||
className="synopsis"
|
||||
className={`synopsis${open ? ' open' : ''}${clamped || open ? ' expandable' : ''}`}
|
||||
role={clamped || open ? 'button' : undefined}
|
||||
tabIndex={clamped || open ? 0 : undefined}
|
||||
aria-expanded={clamped || open ? open : undefined}
|
||||
title={clamped && !open ? 'Show the full description' : undefined}
|
||||
onClick={toggle}
|
||||
onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && (e.preventDefault(), toggle())}
|
||||
ref={(el) => {
|
||||
if (el) setClamped(el.scrollHeight > el.clientHeight + 2);
|
||||
if (el && !open) setClamped(el.scrollHeight > el.clientHeight + 2);
|
||||
}}
|
||||
>
|
||||
{text}
|
||||
</p>
|
||||
{clamped && (
|
||||
<button className="btn text synopsis-more" onClick={() => openDialog({ kind: 'synopsis', item })}>
|
||||
More
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -180,33 +185,6 @@ function RelatedRows({ item }: { item: Item }) {
|
|||
);
|
||||
}
|
||||
|
||||
function StarRating({ item }: { item: Item }) {
|
||||
const server = useServer();
|
||||
const [value, setValue] = useState(item.userRating);
|
||||
const [hover, setHover] = useState(0);
|
||||
useEffect(() => setValue(item.userRating), [item.userRating]);
|
||||
const set = async (stars: number) => {
|
||||
const rating = stars * 2 === value ? -1 : stars * 2;
|
||||
setValue(Math.max(0, rating));
|
||||
try {
|
||||
await api.rate(server, item.id, rating);
|
||||
invalidateLibrary();
|
||||
} catch (e) {
|
||||
toastError(e);
|
||||
}
|
||||
};
|
||||
const shown = hover || value / 2;
|
||||
return (
|
||||
<span className="star-rating" onMouseLeave={() => setHover(0)} aria-label="Your rating">
|
||||
{[1, 2, 3, 4, 5].map((n) => (
|
||||
<button key={n} onMouseEnter={() => setHover(n)} onClick={() => set(n)} aria-label={`${n} star${n > 1 ? 's' : ''}`}>
|
||||
<Icon name={n <= shown ? 'starFill' : 'star'} size={15} />
|
||||
</button>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
function AboutPanel({ item }: { item: Item }) {
|
||||
const m = item.media[0];
|
||||
const rows: [string, ReactNode][] = [];
|
||||
|
|
@ -248,7 +226,6 @@ function AboutPanel({ item }: { item: Item }) {
|
|||
<aside className="about-panel">
|
||||
<div className="about-head">
|
||||
<h3>About</h3>
|
||||
{['movie', 'show', 'episode', 'season'].includes(item.type) && <StarRating item={item} />}
|
||||
</div>
|
||||
{item.tagline && <p className="about-tagline">“{item.tagline}”</p>}
|
||||
{rows.map(([k, v]) => (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue