diff --git a/web/scripts/check-tokens.mjs b/web/scripts/check-tokens.mjs
index 2c21db2..63e184a 100644
--- a/web/scripts/check-tokens.mjs
+++ b/web/scripts/check-tokens.mjs
@@ -108,7 +108,8 @@ function checkCss(source, rel) {
}
}
-const ARBITRARY = /(?:^|[\s"'`:])!?-?[a-z][\w-]*-\[([^\]\s]+)\]/g;
+// a value, not a variant: `data-[tone=fault]:` selects, it does not style
+const ARBITRARY = /(?:^|[\s"'`:])!?-?[a-z][\w-]*-\[([^\]\s]+)\](?!:)/g;
function checkPlain(source, rel) {
// Comments are prose, not styling — `checkCss` already ignores them, and
diff --git a/web/src/buckets.tsx b/web/src/buckets.tsx
index efe978c..c22d23b 100644
--- a/web/src/buckets.tsx
+++ b/web/src/buckets.tsx
@@ -19,7 +19,18 @@ import {
ruleLabel,
type WaiveOutcome,
} from "./releases";
-import { Chip, Control, DeckHead, Disclosure, EmptyRow, Row, SkeletonRows, useNote } from "./ui";
+import {
+ Chip,
+ Control,
+ DeckHead,
+ Disclosure,
+ EmptyRow,
+ Row,
+ Rows,
+ Section,
+ SkeletonRows,
+ useNote,
+} from "./ui";
export type Bucket = "eligible" | "waived" | "rejected";
@@ -138,13 +149,13 @@ function CollapsedBucket({
}) {
const [open, setOpen] = useState(false);
return (
-
+
setOpen(!open)} />
-
+
release.id}
@@ -157,9 +168,9 @@ function CollapsedBucket({
/>
)}
/>
-
+
-
+
);
}
@@ -171,17 +182,17 @@ export function Buckets({ state, actions }: { state: DeckState; actions: Release
if (state.kind !== "releases") {
return (
-
+
- {state.kind === "skeleton" && }
-
-
+ {state.kind === "skeleton" && }
+
+
-
+
+
);
}
@@ -206,10 +217,10 @@ function PaintedBuckets({
const forceable = rejected.filter(overridable).length;
return (
-
+
-
+
{eligible.length === 0 ? (
)}
-
-
+
+
* {
- margin-inline: var(--gutter);
-}
-
-.deck > section.hero {
- margin-inline: 0;
-}
-
-.deck.detail {
- padding-top: 0;
-}
-
-.page-bar .page-title {
- text-transform: capitalize;
-}
-
-/* a page's line: title, count, a one-line status slot, the page's controls */
-.page-bar {
- display: flex;
- align-items: center;
- gap: var(--space-3);
- min-height: var(--control-h);
- margin-bottom: var(--space-4);
-}
-
-.page-bar .deck-count {
- flex: none;
-}
-
-/* always laid out, so a message never pushes the page down */
-.head-status {
- flex: 1;
- min-width: 0;
- margin: 0;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-size: var(--text-xs);
- color: var(--ink-muted);
-}
-
-.head-status[data-tone="fault"] {
- color: var(--signal-fault);
-}
-
-/* a section's status: one reserved line, wraps only when the sentence must */
-.deck-status {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- gap: var(--space-2) var(--space-3);
- min-height: 1.5rem;
- margin-bottom: var(--space-3);
- font-size: var(--text-xs);
- color: var(--ink-muted);
-}
-
-.deck-status[hidden] {
- visibility: hidden;
-}
-
-.deck-status[data-tone="fault"],
-.head-status[data-tone="fault"] {
- color: var(--signal-fault);
-}
-
-.deck-status .lamp,
-.head-status .lamp {
- display: inline-block;
- margin-right: var(--space-2);
-}
-
-.deck-group {
- margin-bottom: var(--space-8);
-}
-
-.deck-head {
- display: flex;
- align-items: center;
- gap: var(--space-3);
- min-height: var(--control-h);
- padding-bottom: var(--space-1);
- border-bottom: 1px solid var(--line);
-}
-
-.deck-head .head-action,
-.deck-head .disclose {
- margin-left: auto;
-}
-
-/* nested heads inside a section are group labels, one step quieter */
-.deck-group .deck-group .deck-head {
- min-height: var(--chip-h);
- padding-top: var(--space-3);
-}
-
-.deck-rows {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-
-/* one plain sentence, the long form behind a tap */
-.group-note {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: var(--space-1) var(--space-2);
- padding: var(--space-2) 0 0;
- font-size: var(--text-sm);
- color: var(--ink-muted);
-}
-
-.group-note p {
- margin: 0;
-}
-
-.group-note .group-note-more {
- flex-basis: 100%;
- max-width: 65ch;
- font-size: var(--text-xs);
-}
-
-.group-note .control-icon {
- width: var(--chip-h);
- min-width: var(--chip-h);
- min-height: var(--chip-h);
- border-color: transparent;
- background: none;
- box-shadow: none;
- color: var(--ink-faint);
-}
-
/* ---- the row ------------------------------------------------------------------ */
/* lead | body | actions, then the tray full width. The body is minmax(0, 1fr):
@@ -1682,7 +1539,7 @@ button.chip {
/* ---- poster grid (§9.6, issue 151) -------------------------------------- */
-.deck-rows.grid-rows {
+.grid-rows {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
gap: var(--space-3);
@@ -2324,14 +2181,6 @@ button.chip {
border-radius: var(--radius);
}
-.subs-panel .deck-group {
- margin-bottom: var(--space-4);
-}
-
-.subs-panel .deck-group:last-child {
- margin-bottom: 0;
-}
-
.subs-present {
display: flex;
flex-wrap: wrap;
@@ -2384,10 +2233,6 @@ button.chip {
margin-top: var(--space-3);
}
-.subs-buckets .deck-group {
- margin-bottom: var(--space-3);
-}
-
/* ---- settings (issue #116) -------------------------------------------- */
.form-grid {
diff --git a/web/src/detail.tsx b/web/src/detail.tsx
index cb820d9..2ec8ea2 100644
--- a/web/src/detail.tsx
+++ b/web/src/detail.tsx
@@ -61,6 +61,7 @@ export function Hero({
: ({ "--backdrop": `url("${backdropUrl}")` } as CSSProperties)
}
aria-label="title metadata"
+ data-bleed=""
>
diff --git a/web/src/style.css b/web/src/style.css
index 25422f5..4490954 100644
--- a/web/src/style.css
+++ b/web/src/style.css
@@ -52,6 +52,7 @@
--color-score-6: var(--score-6);
--color-status-airing: var(--status-airing);
+ --spacing-0: 0px;
--spacing-1: var(--space-1);
--spacing-2: var(--space-2);
--spacing-3: var(--space-3);
@@ -59,6 +60,22 @@
--spacing-6: var(--space-6);
--spacing-8: var(--space-8);
--spacing-12: var(--space-12);
+ --spacing-control-h: var(--control-h);
+ --spacing-chip-h: var(--chip-h);
+ --spacing-row-min: var(--row-min);
+ --spacing-toggle-w: var(--toggle-w);
+ --spacing-word-w: var(--word-w);
+ --spacing-rail-h: var(--rail-h);
+ --spacing-tabbar-h: var(--tabbar-h);
+ --spacing-gutter: var(--gutter);
+
+ --container-deck: var(--deck-max);
+ --container-measure: var(--measure);
+ /* container query widths for @row, @cells and @wide: the row grows its
+ action column, the release cells line up, the detail hero widens */
+ --container-row: 40rem;
+ --container-cells: 46rem;
+ --container-wide: 64rem;
--text-2xs: var(--text-2xs);
--text-xs: var(--text-xs);
diff --git a/web/src/subs-panel.tsx b/web/src/subs-panel.tsx
index e29ef33..2fab2e3 100644
--- a/web/src/subs-panel.tsx
+++ b/web/src/subs-panel.tsx
@@ -45,7 +45,9 @@ import {
type Note,
NoteLine,
Row,
+ Rows,
type Say,
+ Section,
useNote,
} from "./ui";
@@ -326,9 +328,9 @@ function CandidateBuckets({
const rejected = results.candidates.filter((c) => c.verdict !== "eligible");
return (
-
+
-
+
{eligible.length === 0 && (
)}
@@ -340,14 +342,14 @@ function CandidateBuckets({
fetchCandidate={fetchCandidate}
/>
))}
-
-
-
+
setOpen(!open)} />
-
+
{rejected.map((candidate) => (
))}
-
+
-
+
);
}
@@ -731,7 +733,7 @@ export function useSubtitleSection(
const panel = (
-
+
{asked.map((subtitle) => (
@@ -760,9 +762,9 @@ export function useSubtitleSection(
)}
-
+
-
+
)}
-
+
-
+
@@ -872,7 +874,7 @@ export function useSubtitleSection(
{options === null ? "" : hint}
-
+
);
diff --git a/web/src/ui.tsx b/web/src/ui.tsx
index ae32c94..32f9236 100644
--- a/web/src/ui.tsx
+++ b/web/src/ui.tsx
@@ -5,11 +5,14 @@
import {
type ComponentProps,
+ createContext,
type HTMLAttributes,
type KeyboardEvent,
type MouseEvent,
type ReactNode,
+ type Ref,
useCallback,
+ useContext,
useState,
} from "react";
import { Icon, type IconName, useArmed } from "./icons";
@@ -156,7 +159,7 @@ export function Disclosure({
return (
@@ -212,16 +215,34 @@ export interface Status {
* A status slot. The slot is always laid out — an empty one keeps its line —
* so a message arriving or leaving never pushes the content below it.
*/
-export function StatusSlot({ status, className }: { status: Status | null; className: string }) {
+const SLOT = {
+ // a page bar's one line, ellipsised: a message never pushes the page down
+ head: "flex-1 min-w-0 m-0 overflow-hidden whitespace-nowrap text-ellipsis",
+ // a section's line: reserved, and wraps only when the sentence must
+ deck: "flex items-center flex-wrap gap-y-2 gap-x-3 min-h-chip-h mb-3",
+} as const;
+
+export function StatusSlot({
+ status,
+ variant,
+}: {
+ status: Status | null;
+ variant: keyof typeof SLOT;
+}) {
return (
- {status?.busy && }
+ {status?.busy && (
+
+ )}
{status?.text ?? ""}
{status?.action && }
@@ -500,6 +521,107 @@ export function EmptyRow({
);
}
+/* ---- page skeleton ------------------------------------------------------- */
+
+/**
+ * A page: the one centred column, and a container, so a row answers to the
+ * page's width rather than the window's. The gutter belongs to the content;
+ * a child marked `data-bleed` (the detail hero) reaches both edges.
+ */
+export function Deck({
+ label,
+ detail = false,
+ hidden,
+ id,
+ ref,
+ onKeyDown,
+ children,
+}: {
+ label: string;
+ /** A detail page opens on its hero, so the page drops its top padding. */
+ detail?: boolean;
+ hidden?: boolean;
+ id?: string;
+ ref?: Ref;
+ onKeyDown?: (event: KeyboardEvent) => void;
+ children: ReactNode;
+}) {
+ return (
+
+ {children}
+
+ );
+}
+
+/** A page's line: title, count, a one-line status slot, the page's controls. */
+export function PageBar({
+ title,
+ count,
+ status,
+ children,
+}: {
+ title: string;
+ /** Absent leaves the count's slot out entirely. */
+ count?: string;
+ status: Status | null;
+ children?: ReactNode;
+}) {
+ return (
+
+ {title}
+ {count !== undefined && {count} }
+
+ {children}
+
+ );
+}
+
+/** Whether a section sits inside another: its head is then a quieter group label. */
+const Nested = createContext(false);
+const InnerSection = createContext(false);
+
+/** A section of a page; `spacing` replaces the default gap after it. */
+export function Section({
+ spacing = "mb-8",
+ hidden,
+ labelledBy,
+ ref,
+ className,
+ children,
+}: {
+ spacing?: string;
+ hidden?: boolean;
+ labelledBy?: string;
+ ref?: Ref;
+ /** A marker other rules still key on, such as `subs-lane`. */
+ className?: string;
+ children: ReactNode;
+}) {
+ const outer = useContext(Nested);
+ return (
+
+ );
+}
+
/** A section head: the engraved label, a count, then whatever acts on it. */
export function DeckHead({
label,
@@ -516,8 +638,15 @@ export function DeckHead({
count?: string | number | null;
children?: ReactNode;
}) {
+ // nested heads inside a section are group labels, one step quieter
+ const nested = useContext(InnerSection);
return (
-
+
{label}
@@ -527,21 +656,52 @@ export function DeckHead({
);
}
+/** A list of rows, or of poster cards. */
+export function Rows({
+ grid = false,
+ className,
+ hidden,
+ children,
+}: {
+ grid?: boolean;
+ /** A marker other rules still key on, such as `seasons`. */
+ className?: string;
+ hidden?: boolean;
+ children?: ReactNode;
+}) {
+ return (
+
+ );
+}
+
/** A group's one plain sentence, which opens to the long form on a tap. */
-export function GroupNote({ short, more }: { short: string; more: string }) {
+export function GroupNote({ short, more }: { short: string; more?: string }) {
const [open, setOpen] = useState(false);
return (
-
-
{short}
-
setOpen(!open)}
- />
-
- {more}
-
+
+
{short}
+ {more !== undefined && (
+ <>
+
setOpen(!open)}
+ className="size-chip-h min-w-chip-h min-h-chip-h border-transparent bg-none bg-transparent [box-shadow:none] text-ink-faint aria-expanded:border-accent aria-expanded:text-accent-bright"
+ />
+
+ {more}
+
+ >
+ )}
);
}
diff --git a/web/src/views/Library.tsx b/web/src/views/Library.tsx
index 8836e3d..67fa611 100644
--- a/web/src/views/Library.tsx
+++ b/web/src/views/Library.tsx
@@ -12,7 +12,7 @@ import {
} from "../library";
import { MovieCard, MovieRow, SeriesCard, SeriesRow } from "../rows";
import { allRoots, type LibraryMovie, type Root } from "../search";
-import { DeckHead, SkeletonRows, StatusSlot, useStatus } from "../ui";
+import { Deck, DeckHead, PageBar, Rows, Section, SkeletonRows, useStatus } from "../ui";
type LibraryShape = "grid" | "list";
@@ -49,7 +49,7 @@ let cached: LibraryData | null = null;
function GridSkeleton() {
return (
-
+
{Array.from({ length: 6 }, (_, index) => (
// biome-ignore lint/suspicious/noArrayIndexKey: placeholders have no identity
@@ -62,7 +62,7 @@ function GridSkeleton() {
))}
-
+
);
}
@@ -162,13 +162,12 @@ export function LibraryView({ hidden }: { hidden: boolean }) {
}
return (
-
-
- library
-
- {total === 0 ? "" : `${total} ${total === 1 ? "title" : "titles"}`}
-
-
+
+
-
+
{data === null && !failed && (shape === "grid" ?
:
)}
{shown !== null &&
grid.map((section) => (
-
+
-
+
{section.items.map((item) => (
{item.node}
))}
-
-
+
+
))}
-
-
+
{shape === "list" &&
seriesShown.map((series) => (
))}
-
-
+
+
-
-
+
{shape === "list" &&
moviesShown.map((movie) => (
))}
-
-
-
+
+
+
);
}
function ListSkeleton() {
return (
-
+
);
}
diff --git a/web/src/views/Movie.tsx b/web/src/views/Movie.tsx
index 0abb3f4..57eda83 100644
--- a/web/src/views/Movie.tsx
+++ b/web/src/views/Movie.tsx
@@ -45,12 +45,15 @@ import { useSubtitleSection } from "../subs-panel";
import { movieSubtitleStatus, type SubtitleStatus } from "../subtitles";
import {
Chip,
+ Deck,
DeckHead,
EmptyRow,
Expandable,
IconControl,
LampToggle,
Row,
+ Rows,
+ Section,
SkeletonRows,
StatusSlot,
useNote,
@@ -405,7 +408,7 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
const rootListed = movie !== null && movieRoots.some((root) => root.id === movie.root_id);
return (
-
+
-
+
-
+
-
+
{files === null && }
{files?.kind === "error" && (
@@ -569,14 +572,14 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
refresh={refreshSubtitles}
/>
))}
-
-
+
+
-
+
);
}
diff --git a/web/src/views/Queues.tsx b/web/src/views/Queues.tsx
index 2b15009..89492a8 100644
--- a/web/src/views/Queues.tsx
+++ b/web/src/views/Queues.tsx
@@ -25,12 +25,15 @@ import { missingChipLabel } from "../subtitles";
import {
Chip,
Control,
+ Deck,
DeckHead,
EmptyRow,
GroupNote,
+ PageBar,
Row,
+ Rows,
+ Section,
SkeletonRows,
- StatusSlot,
useNote,
useStatus,
} from "../ui";
@@ -208,11 +211,11 @@ function QueueGroup({
hidden: boolean;
}) {
return (
-
);
}
@@ -294,14 +297,12 @@ export function QueuesView({ hidden }: { hidden: boolean }) {
);
return (
-
-
- queues
-
- {loaded === null || total === 0 ? "" : `${total} waiting`}
-
-
-
+
+
,
)}
/>
-
+
);
}
diff --git a/web/src/views/Search.tsx b/web/src/views/Search.tsx
index 8639f7e..b4c847b 100644
--- a/web/src/views/Search.tsx
+++ b/web/src/views/Search.tsx
@@ -18,7 +18,19 @@ import {
type TmdbMovie,
type TmdbSeries,
} from "../search";
-import { Chip, Control, DeckHead, flag, LampToggle, Row, StatusSlot, useStatus } from "../ui";
+import {
+ Chip,
+ Control,
+ Deck,
+ DeckHead,
+ flag,
+ LampToggle,
+ PageBar,
+ Row,
+ Rows,
+ Section,
+ useStatus,
+} from "../ui";
/** Which kind the deck is showing. `all` is both, and the default. */
type KindFilter = "all" | "movie" | "series";
@@ -395,17 +407,8 @@ export function SearchView({
all.filter((hit) => filter === "all" || hit.kind === filter).length;
return (
-
-
+
+
-
+
-
+
{/* §9.2: in-library hits read as whatever they are — a movie or a
series — and hold the order the API ranked them in. */}
{library.map((hit) =>
@@ -448,22 +451,22 @@ export function SearchView({
),
)}
-
-
+
+
-
+
-
+
{tmdbHits.map((hit) => (
))}
-
-
+
+
-
+
);
}
diff --git a/web/src/views/Series.tsx b/web/src/views/Series.tsx
index d415dd3..16b7e13 100644
--- a/web/src/views/Series.tsx
+++ b/web/src/views/Series.tsx
@@ -52,11 +52,14 @@ import {
ArmedDeleteWord,
Chip,
Control,
+ Deck,
DeckHead,
EmptyRow,
IconControl,
LampToggle,
Row,
+ Rows,
+ Section,
SkeletonRows,
StatusSlot,
useNote,
@@ -695,7 +698,7 @@ export function SeriesView({ seriesId, covered }: { seriesId: number; covered: b
const rootListed = series !== null && tvRoots.some((root) => root.id === series.root_id);
return (
-
+
-
+
-
+
-
+
{seasons === null && }
{seasons?.map((season) => (
))}
{seasons !== null && seasons.length === 0 && seasonsEmpty}
-
-
-
+
+
+
);
}
diff --git a/web/src/views/Settings.tsx b/web/src/views/Settings.tsx
index 6f253be..7dff475 100644
--- a/web/src/views/Settings.tsx
+++ b/web/src/views/Settings.tsx
@@ -34,13 +34,16 @@ import {
Chip,
Control,
cx,
+ Deck,
DeckHead,
GroupNote,
IconControl,
type Note,
NoteLine,
+ PageBar,
Row,
- StatusSlot,
+ Rows,
+ Section,
useNote,
useStatus,
} from "../ui";
@@ -1116,33 +1119,31 @@ export function SettingsView({ hidden }: { hidden: boolean }) {
const reload = () => void load();
return (
-
-
- settings
-
- {loaded === null
- ? ""
- : `${loaded.roots.length} roots · ${loaded.policies.length} policies`}
-
-
-
+
+
-
-
+
setAddingRoot(true)}
>
add root
-
+
{loaded?.roots.map((root) => (
))}
-
+
{addingRoot && loaded !== null && (
setAddingRoot(false)}
/>
)}
-
+
-
+
setAddingPolicy(true)}
>
add policy
-
-
Editing a policy rescores every title's releases straight away.
-
-
+
+
{loaded?.policies.map((policy) => {
const bandCount = Object.keys(policy.size_bands).length;
return (
@@ -1207,7 +1206,7 @@ export function SettingsView({ hidden }: { hidden: boolean }) {
/>
);
})}
-
+
{addingPolicy && (
setAddingPolicy(false)}
/>
)}
-
+
-
-
-
+
+
);
}
diff --git a/web/src/views/TvDeck.tsx b/web/src/views/TvDeck.tsx
index 1c56c79..46f082d 100644
--- a/web/src/views/TvDeck.tsx
+++ b/web/src/views/TvDeck.tsx
@@ -16,7 +16,7 @@ import {
type SeasonPackState,
} from "../releases";
import { waiveAndGrabTv } from "../series";
-import { IconControl, type Status, StatusSlot } from "../ui";
+import { Deck, IconControl, type Status, StatusSlot } from "../ui";
/** §6.2: the sweep runs on the daemon's cadence. Poll modestly, give up softly. */
const TV_SWEEP_POLL_MS = 5000;
@@ -358,8 +358,9 @@ export function TvDeckView({ request }: { request: TvDeckRequest }) {
}
return (
-
-
+
+ {/* a detail page without a hero still gives its head room under the rail */}
+
{request.title}
@@ -376,7 +377,7 @@ export function TvDeckView({ request }: { request: TvDeckRequest }) {
search indexers
-
+
-
+
);
}