refactor(web): grid, add flow and detail pages as utilities
The hero's backdrop scrim and the title placeholder stay in CSS: they are pseudo-element effects, not layout. Refs #280 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a4aa423b3a
commit
4254c1bde1
@@ -313,180 +313,6 @@ body {
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
/* ---- poster grid (§9.6, issue 151) -------------------------------------- */
|
||||
|
||||
.grid-rows {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
|
||||
gap: var(--space-3);
|
||||
padding-top: var(--space-3);
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
color: inherit;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
transition: border-color 150ms var(--ease-out);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.card-art {
|
||||
display: block;
|
||||
aspect-ratio: 2 / 3;
|
||||
background: var(--panel-raised);
|
||||
}
|
||||
|
||||
.card-poster {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* same ratio as a poster, carrying the title: the grid never has a hole */
|
||||
.card-blank {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: var(--space-3);
|
||||
}
|
||||
|
||||
.card-blank-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-base);
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
color: var(--ink-faint);
|
||||
}
|
||||
|
||||
.card-body {
|
||||
display: grid;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-2);
|
||||
}
|
||||
|
||||
.card-name {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.card-chips {
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
min-height: var(--chip-h);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card-skel .card-art {
|
||||
background: var(--panel-raised);
|
||||
}
|
||||
|
||||
/* ---- search rows and the add flow (§9.2) ---------------------------------- */
|
||||
|
||||
.add-panel {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-3);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: inset 0 1px var(--highlight);
|
||||
}
|
||||
|
||||
.add-roots {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.root-option {
|
||||
display: grid;
|
||||
gap: var(--space-1);
|
||||
min-height: var(--control-h);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
color: var(--ink);
|
||||
background: var(--panel-raised);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
cursor: pointer;
|
||||
transition: border-color 150ms var(--ease-out);
|
||||
}
|
||||
|
||||
.root-option:hover:not(:disabled) {
|
||||
border-color: var(--line-strong);
|
||||
}
|
||||
|
||||
.root-option[aria-pressed="true"] {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.root-option:disabled {
|
||||
cursor: default;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.root-audience {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-md);
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.12em;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.root-policy,
|
||||
.root-path {
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
.add-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.add-autotrack {
|
||||
display: grid;
|
||||
justify-items: start;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.add-note {
|
||||
margin: 0;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
.add-note[data-tone="fault"] {
|
||||
color: var(--signal-fault);
|
||||
}
|
||||
|
||||
.add-note[data-tone="ok"] {
|
||||
color: var(--signal-ok);
|
||||
}
|
||||
|
||||
/* ---- title detail (§9.6) ---------------------------------------------------- */
|
||||
|
||||
/* the hero: back and title, then poster and what the title IS, over the
|
||||
@@ -532,37 +358,6 @@ body {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.page-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
min-height: var(--control-h);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
/* a detail page without a hero still gives its head room under the rail */
|
||||
.deck.detail > .page-head {
|
||||
padding-top: var(--space-2);
|
||||
}
|
||||
|
||||
.page-id {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.page-year,
|
||||
.page-sub {
|
||||
flex: none;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
.page-sub {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* the title is known before the page is: a bar the title's own size */
|
||||
.page-title:empty::before,
|
||||
[data-loading] .page-title::before {
|
||||
@@ -575,231 +370,10 @@ body {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.hero-body {
|
||||
display: grid;
|
||||
grid-template-columns: 6rem minmax(0, 1fr);
|
||||
gap: var(--space-4);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
/* the poster's box is there before the poster is */
|
||||
.hero-poster {
|
||||
aspect-ratio: 2 / 3;
|
||||
background: var(--panel-raised);
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.movie-poster {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
opacity: 0;
|
||||
transition: opacity 300ms var(--ease-out);
|
||||
}
|
||||
|
||||
.movie-poster[data-loaded] {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.hero-info {
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
align-content: start;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.hero-chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1);
|
||||
min-height: var(--chip-h);
|
||||
}
|
||||
|
||||
/* each line keeps its height while empty, so the hero never grows in steps */
|
||||
.hero-rating,
|
||||
.hero-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1);
|
||||
min-height: 1.25rem;
|
||||
margin: 0;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
.hero-rating {
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.hero-tagline {
|
||||
display: none;
|
||||
margin: 0;
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-md);
|
||||
font-weight: 600;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
/* three lines, reserved, a tap opens the rest */
|
||||
.hero-overview {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
min-height: 4.5em;
|
||||
max-width: 65ch;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--ink);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hero-overview[data-full] {
|
||||
-webkit-line-clamp: unset;
|
||||
}
|
||||
|
||||
.hero-note {
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
|
||||
/* one action bar: the primary word, the links as glyphs, the rest behind ⋯ */
|
||||
.actionbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
min-height: var(--control-h);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.actionbar-links {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.more-panel {
|
||||
display: grid;
|
||||
gap: var(--space-3);
|
||||
margin-bottom: var(--space-4);
|
||||
padding: var(--space-3);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: inset 0 1px var(--highlight);
|
||||
}
|
||||
|
||||
.more-links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.more-links:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.more-toggles {
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.more-field {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.control-note {
|
||||
margin: 0;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
@container (min-width: 40rem) {
|
||||
.hero {
|
||||
padding-top: var(--space-4);
|
||||
}
|
||||
|
||||
.hero-body {
|
||||
grid-template-columns: 9rem minmax(0, 1fr);
|
||||
gap: var(--space-6);
|
||||
}
|
||||
|
||||
.hero-tagline {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.more-panel {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.more-toggles {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.more-panel > .remove-panel,
|
||||
.more-panel > .more-links,
|
||||
.more-panel > .control-note {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
}
|
||||
|
||||
@container (min-width: 64rem) {
|
||||
.hero-body {
|
||||
grid-template-columns: 10.5rem minmax(0, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- removal confirmation (§7.4, issue 104) ------------------------------- */
|
||||
|
||||
.remove-body {
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-3);
|
||||
background: var(--panel-raised);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
.remove-body[data-armed="true"] {
|
||||
border-color: oklch(from var(--signal-warn) l c h / 55%);
|
||||
}
|
||||
|
||||
.remove-evidence,
|
||||
.remove-path,
|
||||
.remove-note {
|
||||
margin: 0;
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
/* the folder is evidence: it wraps rather than truncating */
|
||||
.remove-path {
|
||||
color: var(--ink-muted);
|
||||
overflow-wrap: anywhere;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.remove-note {
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
.remove-note[data-tone="warn"] {
|
||||
color: var(--signal-warn);
|
||||
}
|
||||
|
||||
.remove-note[data-tone="fault"] {
|
||||
color: var(--signal-fault);
|
||||
}
|
||||
|
||||
.remove-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
/* ---- release deck (§9.3) ------------------------------------------------- */
|
||||
|
||||
+32
-17
@@ -3,7 +3,11 @@
|
||||
|
||||
import { type CSSProperties, type ReactNode, useEffect, useRef, useState } from "react";
|
||||
import { Icon, ProviderMark, Star } from "./icons";
|
||||
import { control, NOTE, type } from "./look";
|
||||
import { control, NOTE, detail as page, type } from "./look";
|
||||
|
||||
/** each line keeps its height while empty, so the hero never grows in steps */
|
||||
const HERO_LINE = "readout flex items-center gap-1 min-h-line m-0 text-xs";
|
||||
|
||||
import { formatMetaLine, formatRating, formatVoteCount, tmdbImage } from "./movie";
|
||||
import { type ActionOutcome, formatSize, totalSize } from "./releases";
|
||||
import { cx, flag, IconControl, IconLink, type Note, NoteLine } from "./ui";
|
||||
@@ -64,17 +68,17 @@ export function Hero({
|
||||
aria-label="title metadata"
|
||||
data-bleed=""
|
||||
>
|
||||
<header className="page-head">
|
||||
<header className={page.pageHead}>
|
||||
<IconControl glyph="back" label="back" look="bare" onClick={onBack} />
|
||||
<h2 className={cx(type.pageTitle, "flex-initial")} tabIndex={-1} ref={heading}>
|
||||
{title === "" ? " " : title}
|
||||
</h2>
|
||||
<span className="page-year readout">{year === null ? "" : year}</span>
|
||||
<span className={page.pageMeta}>{year === null ? "" : year}</span>
|
||||
</header>
|
||||
<div className="hero-body">
|
||||
<div className="hero-poster">
|
||||
<div className="grid [grid-template-columns:6rem_minmax(0,1fr)] gap-4 [align-items:start] @row:[grid-template-columns:9rem_minmax(0,1fr)] @row:gap-6 @wide:[grid-template-columns:10.5rem_minmax(0,1fr)]">
|
||||
<div className="aspect-2/3 bg-panel-raised border border-line-strong rounded-panel overflow-hidden">
|
||||
<img
|
||||
className="movie-poster"
|
||||
className="block w-full h-full object-cover opacity-0 [transition:opacity_300ms_var(--ease-out)] data-loaded:opacity-100"
|
||||
alt={posterUrl === null || posterBroken ? "" : `${title} poster`}
|
||||
src={posterUrl === null || posterBroken ? undefined : posterUrl}
|
||||
data-loaded={flag(posterLoaded && !posterBroken)}
|
||||
@@ -82,9 +86,9 @@ export function Hero({
|
||||
onError={() => setPosterBroken(true)}
|
||||
/>
|
||||
</div>
|
||||
<div className="hero-info">
|
||||
<span className="hero-chips">{chips}</span>
|
||||
<p className="hero-rating readout">
|
||||
<div className="grid gap-2 content-start min-w-0">
|
||||
<span className="flex flex-wrap gap-1 min-h-chip-h">{chips}</span>
|
||||
<p className={cx(HERO_LINE, "text-ink")}>
|
||||
{detail !== null && detail.vote_average !== null && (
|
||||
<>
|
||||
<Star />
|
||||
@@ -93,15 +97,15 @@ export function Hero({
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
<p className="hero-meta readout">
|
||||
<p className={cx(HERO_LINE, "text-ink-muted")}>
|
||||
{detail === null ? "" : formatMetaLine(detail.runtime, detail.genres)}
|
||||
</p>
|
||||
<p className="hero-tagline">
|
||||
<p className="hidden @row:block m-0 font-display text-md font-semibold text-ink-muted">
|
||||
{tagline !== null && tagline !== undefined && tagline !== "" ? `“${tagline}”` : ""}
|
||||
</p>
|
||||
{/* biome-ignore lint/a11y/useKeyWithClickEvents: a reading aid; the full text is in the DOM either way */}
|
||||
<p
|
||||
className="hero-overview"
|
||||
className="line-clamp-3 min-h-overview max-w-measure m-0 text-sm text-ink cursor-pointer data-full:[-webkit-line-clamp:unset]"
|
||||
data-full={flag(overviewFull)}
|
||||
onClick={() => setOverviewFull(!overviewFull)}
|
||||
>
|
||||
@@ -246,19 +250,30 @@ export function RemovePanel({
|
||||
return (
|
||||
// biome-ignore lint/a11y/useSemanticElements: a fieldset brings its own border, padding and min-width, which this group does not want
|
||||
<div
|
||||
className="remove-body"
|
||||
className={cx(
|
||||
"grid gap-2 p-3 bg-panel-raised border rounded-panel",
|
||||
hasFiles ? "[border-color:oklch(from_var(--signal-warn)_l_c_h/55%)]" : "border-line",
|
||||
)}
|
||||
role="group"
|
||||
aria-label={`remove ${subject.title}`}
|
||||
data-armed={String(hasFiles)}
|
||||
>
|
||||
<p className="remove-evidence readout dim">{evidence}</p>
|
||||
<p className="remove-path readout" hidden={path === null}>
|
||||
<p className="readout dim m-0 text-xs">{evidence}</p>
|
||||
<p
|
||||
className="readout m-0 text-xs text-ink-muted [overflow-wrap:anywhere] whitespace-pre-line"
|
||||
hidden={path === null}
|
||||
>
|
||||
{path ?? ""}
|
||||
</p>
|
||||
<p className="remove-note readout" id="remove-note" role="status" data-tone={note.tone}>
|
||||
<p
|
||||
className="readout m-0 text-xs text-ink-muted data-[tone=warn]:text-signal-warn data-[tone=fault]:text-signal-fault"
|
||||
id="remove-note"
|
||||
role="status"
|
||||
data-tone={note.tone}
|
||||
>
|
||||
{note.text}
|
||||
</p>
|
||||
<div className="remove-actions">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{/* armed: the confirm turns caution amber with the rest of the panel */}
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -296,3 +296,46 @@ export function score(stop: number | null): string {
|
||||
|
||||
/** The §9.3 fixed columns release attributes line up in, from 46rem. */
|
||||
export const CELLS = "[grid-template-columns:4rem_4.5rem_4.5rem_6rem_7rem_3.5rem] gap-4";
|
||||
|
||||
/* ---- panels -------------------------------------------------------------- */
|
||||
|
||||
/** An inline panel: the add flow, an edit form, the subtitle settings. */
|
||||
export const PANEL =
|
||||
"grid gap-3 p-3 bg-panel border border-line rounded-panel [box-shadow:inset_0_1px_var(--highlight)]";
|
||||
|
||||
/** A panel's save line: the controls, then what happened. */
|
||||
export const PANEL_ACTIONS = "flex flex-wrap items-center gap-3";
|
||||
|
||||
/** A panel's note, green once the thing it describes is done. */
|
||||
export const PANEL_NOTE =
|
||||
"m-0 text-xs text-ink-muted data-[tone=fault]:text-signal-fault data-[tone=ok]:text-signal-ok";
|
||||
|
||||
/* ---- poster grid --------------------------------------------------------- */
|
||||
|
||||
export const card = {
|
||||
grid: "grid [grid-template-columns:repeat(auto-fill,minmax(9rem,1fr))] gap-3 pt-3 px-0 pb-0",
|
||||
card: "flex flex-col w-full h-full p-0 [font:inherit] text-left text-inherit bg-panel border border-line rounded-panel overflow-hidden cursor-pointer [transition:border-color_150ms_var(--ease-out)] hover:border-accent",
|
||||
art: "block aspect-2/3 bg-panel-raised",
|
||||
poster: "block w-full h-full object-cover",
|
||||
/** Same ratio as a poster, carrying the title: the grid never has a hole. */
|
||||
blank: "flex items-center justify-center w-full h-full p-3",
|
||||
blankTitle: "font-display text-base font-semibold text-center text-ink-faint",
|
||||
body: "grid gap-1 p-2",
|
||||
name: "truncate text-sm font-semibold text-ink",
|
||||
chips: "flex gap-1 min-h-chip-h overflow-hidden",
|
||||
} as const;
|
||||
|
||||
/* ---- detail pages -------------------------------------------------------- */
|
||||
|
||||
export const detail = {
|
||||
pageHead: "flex items-center gap-2 min-h-control-h mb-3",
|
||||
pageMeta: "readout flex-none text-xs text-ink-muted",
|
||||
/** one action bar: the primary word, the links as glyphs, the rest behind ⋯ */
|
||||
actionbar: "flex items-center gap-2 min-h-control-h mb-3",
|
||||
actionbarLinks: "flex flex-1 items-center gap-2 min-w-0",
|
||||
morePanel:
|
||||
"grid gap-3 mb-4 p-3 bg-panel border border-line rounded-panel [box-shadow:inset_0_1px_var(--highlight)] @row:grid-cols-2 @row:[align-items:end]",
|
||||
moreLinks: "flex flex-wrap gap-2 empty:hidden @row:col-span-full",
|
||||
moreToggles: "grid gap-2 @row:grid-cols-2 @row:col-span-full",
|
||||
controlNote: "readout m-0 text-xs text-ink-muted @row:col-span-full",
|
||||
} as const;
|
||||
|
||||
+9
-8
@@ -3,6 +3,7 @@
|
||||
import { type ReactNode, useState } from "react";
|
||||
import type { LibrarySeries } from "./library";
|
||||
import { seriesStatusChipRedundant } from "./library";
|
||||
import { card } from "./look";
|
||||
import { tmdbImage } from "./movie";
|
||||
import {
|
||||
audienceOf,
|
||||
@@ -142,15 +143,15 @@ function LibraryCard({
|
||||
const [broken, setBroken] = useState(false);
|
||||
return (
|
||||
<li>
|
||||
<button type="button" className="card" onClick={(event) => open(event.currentTarget)}>
|
||||
<span className="card-art">
|
||||
<button type="button" className={card.card} onClick={(event) => open(event.currentTarget)}>
|
||||
<span className={card.art}>
|
||||
{posterPath === null || broken ? (
|
||||
<span className="card-blank">
|
||||
<span className="card-blank-title">{title}</span>
|
||||
<span className={card.blank}>
|
||||
<span className={card.blankTitle}>{title}</span>
|
||||
</span>
|
||||
) : (
|
||||
<img
|
||||
className="card-poster"
|
||||
className={card.poster}
|
||||
loading="lazy"
|
||||
src={tmdbImage(posterPath, "w342") ?? ""}
|
||||
alt={`${title} poster`}
|
||||
@@ -159,9 +160,9 @@ function LibraryCard({
|
||||
/>
|
||||
)}
|
||||
</span>
|
||||
<span className="card-body">
|
||||
<span className="card-name">{title}</span>
|
||||
<span className="card-chips">{chips}</span>
|
||||
<span className={card.body}>
|
||||
<span className={card.name}>{title}</span>
|
||||
<span className={card.chips}>{chips}</span>
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
@@ -87,6 +87,10 @@
|
||||
/* a row's poster thumbnail, 2:3 */
|
||||
--spacing-poster: 2.25rem;
|
||||
--spacing-poster-h: 3.375rem;
|
||||
/* a hero readout line, reserved while empty */
|
||||
--spacing-line: 1.25rem;
|
||||
/* three lines of overview, reserved */
|
||||
--spacing-overview: 4.5em;
|
||||
|
||||
--container-deck: var(--deck-max);
|
||||
--container-measure: var(--measure);
|
||||
|
||||
+2
-4
@@ -18,6 +18,7 @@ import {
|
||||
import { Icon, type IconName, useArmed } from "./icons";
|
||||
import {
|
||||
type ControlLook,
|
||||
card,
|
||||
chip,
|
||||
control,
|
||||
cx,
|
||||
@@ -831,10 +832,7 @@ export function Rows({
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<ul
|
||||
className={cx("m-0 list-none", grid ? "grid-rows px-0 pb-0" : "p-0", className)}
|
||||
aria-hidden={hidden}
|
||||
>
|
||||
<ul className={cx("m-0 list-none", grid ? card.grid : "p-0", className)} aria-hidden={hidden}>
|
||||
{children}
|
||||
</ul>
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
movieNeedsAttention,
|
||||
seriesNeedsAttention,
|
||||
} from "../library";
|
||||
import { seg, segmented, skel } from "../look";
|
||||
import { card, seg, segmented, skel } from "../look";
|
||||
import { MovieCard, MovieRow, SeriesCard, SeriesRow } from "../rows";
|
||||
import { allRoots, type LibraryMovie, type Root } from "../search";
|
||||
import { Deck, DeckHead, PageBar, Rows, Section, SkeletonRows, useStatus } from "../ui";
|
||||
@@ -54,9 +54,9 @@ function GridSkeleton() {
|
||||
{Array.from({ length: 6 }, (_, index) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: placeholders have no identity
|
||||
<li key={index}>
|
||||
<span className="card card-skel">
|
||||
<span className="card-art" />
|
||||
<span className="card-body">
|
||||
<span className={card.card}>
|
||||
<span className={card.art} />
|
||||
<span className={card.body}>
|
||||
<span className={skel.line} />
|
||||
<span className={skel.short} />
|
||||
</span>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Buckets, type DeckState, type ReleaseActions } from "../buckets";
|
||||
import { LAYER, useEscape, useNav } from "../context";
|
||||
import { Hero, ProviderLink, RemovePanel, type RemoveSubject, TrailerLink } from "../detail";
|
||||
import { control, SUB } from "../look";
|
||||
import { control, detail, SUB } from "../look";
|
||||
import {
|
||||
fileName,
|
||||
imdbLink,
|
||||
@@ -431,11 +431,11 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="actionbar">
|
||||
<div className={detail.actionbar}>
|
||||
<button type="button" className={control()} disabled={sweeping} onClick={sweep}>
|
||||
search indexers
|
||||
</button>
|
||||
<span className="actionbar-links">
|
||||
<span className={detail.actionbarLinks}>
|
||||
{/* the trailer resolves from the metadata's own key — no second call.
|
||||
Hidden when absent rather than shown dead (§9.6). */}
|
||||
{metadata?.trailer && (
|
||||
@@ -451,8 +451,8 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
|
||||
onClick={() => setMoreOpen(!moreOpen)}
|
||||
/>
|
||||
</div>
|
||||
<div className="more-panel" id="movie-more-panel" hidden={!moreOpen}>
|
||||
<div className="more-links">
|
||||
<div className={detail.morePanel} id="movie-more-panel" hidden={!moreOpen}>
|
||||
<div className={detail.moreLinks}>
|
||||
{metadata !== null && (
|
||||
<>
|
||||
<ProviderLink
|
||||
@@ -477,7 +477,7 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<div className="more-toggles">
|
||||
<div className={detail.moreToggles}>
|
||||
<LampToggle
|
||||
fill
|
||||
label="wanted"
|
||||
@@ -498,10 +498,10 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
|
||||
{/* §6.3 is the whole point of the flag and a bare toggle hides it: the
|
||||
note appears when the flag is on, which is when the RSS half is the
|
||||
thing that surprises. At rest the label and the title carry it. */}
|
||||
<p className="control-note readout" hidden={!movie?.blocked}>
|
||||
<p className={detail.controlNote} hidden={!movie?.blocked}>
|
||||
Targeted search is off. RSS still matches this title, so a release can still arrive.
|
||||
</p>
|
||||
<label className="field more-field">
|
||||
<label className="field grid">
|
||||
<span className="field-label" id="movie-root-label">
|
||||
root
|
||||
</span>
|
||||
@@ -537,7 +537,7 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
|
||||
>
|
||||
remove from library
|
||||
</button>
|
||||
<div className="remove-panel" id="remove-panel" hidden={!removeOpen}>
|
||||
<div className="@row:col-span-full" id="remove-panel" hidden={!removeOpen}>
|
||||
{removeOpen && subject.current !== null && (
|
||||
<RemovePanel
|
||||
subject={subject.current}
|
||||
|
||||
+17
-11
@@ -5,7 +5,7 @@
|
||||
import { type KeyboardEvent, useEffect, useRef, useState } from "react";
|
||||
import { useNav } from "../context";
|
||||
import { Icon } from "../icons";
|
||||
import { cx, seg, segmented } from "../look";
|
||||
import { cx, PANEL, PANEL_ACTIONS, PANEL_NOTE, seg, segmented } from "../look";
|
||||
import { RatingChip, RowPoster, TitleText } from "../parts";
|
||||
import { MovieRow, SeriesHitRow } from "../rows";
|
||||
import {
|
||||
@@ -116,38 +116,44 @@ function AddPanel({
|
||||
|
||||
const done = state === "done";
|
||||
return (
|
||||
<div className="add-panel" ref={panel}>
|
||||
<div className={PANEL} ref={panel}>
|
||||
{/* biome-ignore lint/a11y/useSemanticElements: a fieldset brings its own border, padding and min-width, which this group does not want */}
|
||||
<div className="add-roots" role="group" aria-label="root folder">
|
||||
<div
|
||||
className="grid [grid-template-columns:repeat(auto-fit,minmax(12rem,1fr))] gap-2"
|
||||
role="group"
|
||||
aria-label="root folder"
|
||||
>
|
||||
{roots.map((root) => (
|
||||
<button
|
||||
key={root.id}
|
||||
type="button"
|
||||
className="root-option"
|
||||
className="grid gap-1 min-h-control-h py-2 px-3 [font:inherit] text-left text-ink bg-panel-raised border border-line rounded-panel cursor-pointer [transition:border-color_150ms_var(--ease-out)] not-disabled:hover:border-line-strong aria-pressed:border-accent disabled:cursor-default disabled:opacity-60"
|
||||
aria-pressed={root === selected}
|
||||
disabled={done}
|
||||
onClick={() => setSelected(root)}
|
||||
>
|
||||
<span className="root-audience">{root.audience}</span>
|
||||
<span className="root-policy readout dim">{root.policy_name}</span>
|
||||
<span className="root-path readout dim">{root.path}</span>
|
||||
<span className="font-display text-md font-bold uppercase tracking-engraved leading-none">
|
||||
{root.audience}
|
||||
</span>
|
||||
<span className="readout dim text-xs">{root.policy_name}</span>
|
||||
<span className="readout dim text-xs">{root.path}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{isSeries && (
|
||||
<div className="add-autotrack">
|
||||
<div className="grid justify-items-start gap-1">
|
||||
<LampToggle
|
||||
label="track future seasons"
|
||||
pressed={autoTrack}
|
||||
disabled={done}
|
||||
onClick={() => setAutoTrack(!autoTrack)}
|
||||
/>
|
||||
<p className="add-note">
|
||||
<p className="m-0 text-xs text-ink-muted">
|
||||
Seasons that air later are wanted automatically. Past seasons are not.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="add-actions">
|
||||
<div className={PANEL_ACTIONS}>
|
||||
<Control
|
||||
text={
|
||||
state === "busy"
|
||||
@@ -165,7 +171,7 @@ function AddPanel({
|
||||
onClick={confirm}
|
||||
/>
|
||||
<p
|
||||
className="add-note readout"
|
||||
className={cx("readout", PANEL_NOTE)}
|
||||
role="status"
|
||||
data-tone={note?.tone}
|
||||
ref={noteRef}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { LAYER, type TvDeckRequest, useEscape, useNav } from "../context";
|
||||
import { Hero, ProviderLink, RemovePanel, type RemoveSubject, TrailerLink } from "../detail";
|
||||
import { ArmedDeleteIcon } from "../icons";
|
||||
import { seriesStatusChipRedundant } from "../library";
|
||||
import { control, cx } from "../look";
|
||||
import { control, cx, detail } from "../look";
|
||||
import { rottenTomatoesSearch, tmdbSeriesLink, tvdbLink, youtubeLink } from "../movie";
|
||||
import {
|
||||
audienceOf,
|
||||
@@ -741,8 +741,8 @@ export function SeriesView({ seriesId, covered }: { seriesId: number; covered: b
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="actionbar">
|
||||
<span className="actionbar-links">
|
||||
<div className={detail.actionbar}>
|
||||
<span className={detail.actionbarLinks}>
|
||||
{metadata?.trailer && (
|
||||
<TrailerLink href={youtubeLink(metadata.trailer.youtube_key)} title={title} />
|
||||
)}
|
||||
@@ -756,8 +756,8 @@ export function SeriesView({ seriesId, covered }: { seriesId: number; covered: b
|
||||
onClick={() => setMoreOpen(!moreOpen)}
|
||||
/>
|
||||
</div>
|
||||
<div className="more-panel" id="series-more-panel" hidden={!moreOpen}>
|
||||
<div className="more-links">
|
||||
<div className={detail.morePanel} id="series-more-panel" hidden={!moreOpen}>
|
||||
<div className={detail.moreLinks}>
|
||||
{metadata !== null && (
|
||||
<>
|
||||
<ProviderLink
|
||||
@@ -783,7 +783,7 @@ export function SeriesView({ seriesId, covered }: { seriesId: number; covered: b
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<label className="field more-field">
|
||||
<label className="field grid">
|
||||
<span className="field-label" id="series-root-label">
|
||||
root
|
||||
</span>
|
||||
@@ -817,7 +817,7 @@ export function SeriesView({ seriesId, covered }: { seriesId: number; covered: b
|
||||
>
|
||||
remove from library
|
||||
</button>
|
||||
<div className="remove-panel" id="series-remove-panel" hidden={!removeOpen}>
|
||||
<div className="@row:col-span-full" id="series-remove-panel" hidden={!removeOpen}>
|
||||
{removeOpen && subject.current !== null && (
|
||||
<RemovePanel
|
||||
subject={subject.current}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { LAYER, useEscape, useLive, useNav } from "../context";
|
||||
import type { Check, CheckStatus } from "../health";
|
||||
import { ArmedDeleteIcon, type IconName } from "../icons";
|
||||
import { control } from "../look";
|
||||
import { control, PANEL, PANEL_ACTIONS, PANEL_NOTE } from "../look";
|
||||
import type { Root } from "../search";
|
||||
import {
|
||||
deleteRow,
|
||||
@@ -393,10 +393,10 @@ function PanelActions({
|
||||
onCancel?: () => void;
|
||||
}) {
|
||||
return (
|
||||
<div className="add-actions">
|
||||
<div className={PANEL_ACTIONS}>
|
||||
<Control text={saveLabel} disabled={busy} onClick={save} />
|
||||
{onCancel && <Control text="cancel" quiet onClick={onCancel} />}
|
||||
<NoteLine note={note} className="add-note readout" />
|
||||
<NoteLine note={note} className={cx("readout", PANEL_NOTE)} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -436,7 +436,7 @@ function RootPanel({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="edit-panel add-panel">
|
||||
<div className={PANEL}>
|
||||
<div className="form-grid">
|
||||
<Field label="kind">
|
||||
<Select
|
||||
@@ -632,7 +632,7 @@ function PolicyPanel({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="edit-panel add-panel">
|
||||
<div className={PANEL}>
|
||||
<div className="form-grid">
|
||||
<Field label="name">
|
||||
<TextInput value={name} onChange={setName} placeholder="policy name" autoFocus />
|
||||
@@ -939,7 +939,7 @@ function SubtitlesPanel({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="add-panel subtitle-panel">
|
||||
<div className={cx(PANEL, "subtitle-panel")}>
|
||||
<div className="form-grid">
|
||||
<Field label="wanted languages">
|
||||
<TextInput value={wanted} onChange={setWanted} placeholder="pt-PT, en" />
|
||||
@@ -957,7 +957,7 @@ function SubtitlesPanel({
|
||||
</Field>
|
||||
</div>
|
||||
{!hasEngines && (
|
||||
<p className="add-note readout dim">
|
||||
<p className={cx("readout dim", PANEL_NOTE)}>
|
||||
no translation engine is compiled into this binary — pick is unavailable
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Buckets, type DeckState, type ReleaseActions } from "../buckets";
|
||||
import { LAYER, type TvDeckRequest, useEscape, useNav } from "../context";
|
||||
import { control, cx, type } from "../look";
|
||||
import { control, cx, detail, type } from "../look";
|
||||
import {
|
||||
blacklistAdvice,
|
||||
blacklistClass,
|
||||
@@ -361,14 +361,14 @@ export function TvDeckView({ request }: { request: TvDeckRequest }) {
|
||||
return (
|
||||
<Deck detail label="season and episode releases">
|
||||
{/* a detail page without a hero still gives its head room under the rail */}
|
||||
<header className="page-head pt-2">
|
||||
<header className={cx(detail.pageHead, "pt-2")}>
|
||||
<IconControl glyph="back" label="back" look="bare" ref={back} onClick={nav.close} />
|
||||
<div className="page-id">
|
||||
<div className="grid min-w-0">
|
||||
<h2 className={cx(type.pageTitle, "flex-initial")}>{request.title}</h2>
|
||||
<span className="page-sub readout">{request.sub ?? ""}</span>
|
||||
<span className={cx(detail.pageMeta, "truncate")}>{request.sub ?? ""}</span>
|
||||
</div>
|
||||
</header>
|
||||
<div className="actionbar">
|
||||
<div className={detail.actionbar}>
|
||||
<button
|
||||
type="button"
|
||||
className={control()}
|
||||
|
||||
Reference in New Issue
Block a user