diff --git a/lumen/src/components/MoreActions.tsx b/lumen/src/components/MoreActions.tsx
new file mode 100644
index 0000000..eac31f4
--- /dev/null
+++ b/lumen/src/components/MoreActions.tsx
@@ -0,0 +1,136 @@
+import {
+ createContext,
+ useContext,
+ useLayoutEffect,
+ useRef,
+ useState,
+ type ReactNode,
+} from 'react';
+import { useLumenLocale } from '../i18n';
+import { Icon } from '../icons';
+import { Section } from './cards';
+import { FilterSheet, usePhone } from './PhoneFilters';
+
+// Phones keep a detail page's main actions in view and fold the occasional ones (indexer
+// search, blocklist, issue reports, associations and the like) into one More sheet; wider
+// screens show them inline as before. Each action keeps its own permission check: More only
+// shows when two or more of them have something to offer; a single one shows in place.
+export function MoreActions({ children }: { children: ReactNode }) {
+ const { t } = useLumenLocale();
+ const phone = usePhone();
+ const probe = useRef(null);
+ const [count, setCount] = useState(0);
+ const [open, setOpen] = useState(false);
+ useLayoutEffect(() => {
+ const node = probe.current;
+ if (!node) return;
+ const check = () => setCount(node.childElementCount);
+ check();
+ const watcher = new MutationObserver(check);
+ watcher.observe(node, { childList: true });
+ return () => watcher.disconnect();
+ }, [phone]);
+ if (!phone) return {children} ;
+ const label = t('lumen.detail.moreActions', 'More actions');
+ return (
+ <>
+ {/* one action needs no sheet: it shows in place */}
+
+ {children}
+
+ {count > 1 && (
+ setOpen(true)}
+ >
+
+ {t('lumen.detail.more', 'More')}
+
+ )}
+ {open && (
+ setOpen(false)}
+ done={t('lumen.detail.close', 'Close')}
+ >
+ {children}
+
+ )}
+ >
+ );
+}
+
+// Inside a folded phone group, PhoneSubsection shows a small heading instead of a section.
+const PhoneGroupContext = createContext(false);
+
+// A settings group that phones fold behind its title; wider screens keep the open section.
+// With splitOnWide, wider screens show each PhoneSubsection inside as its own section (as
+// before), while phones fold them together under one title.
+export function PhoneSection({
+ title,
+ id,
+ splitOnWide = false,
+ children,
+}: {
+ title: string;
+ id?: string;
+ splitOnWide?: boolean;
+ children: ReactNode;
+}) {
+ const phone = usePhone();
+ if (!phone)
+ return splitOnWide ? (
+ <>{children}>
+ ) : (
+
+ );
+ return (
+
+ {/* still a heading for screen readers and page outlines while folded */}
+
+
+ {title}
+
+
+
+ );
+}
+
+// One group inside a combined PhoneSection: its own section on wider screens, a small
+// heading inside the shared fold on phones.
+export function PhoneSubsection({
+ title,
+ id,
+ children,
+}: {
+ title: string;
+ id?: string;
+ children: ReactNode;
+}) {
+ const grouped = useContext(PhoneGroupContext);
+ if (!grouped)
+ return (
+
+ );
+ return (
+
+
{title}
+ {children}
+
+ );
+}
diff --git a/lumen/src/components/MusicPlayback.tsx b/lumen/src/components/MusicPlayback.tsx
index 5b0f021..d9461d6 100644
--- a/lumen/src/components/MusicPlayback.tsx
+++ b/lumen/src/components/MusicPlayback.tsx
@@ -1,18 +1,19 @@
-import { useRef, useState } from 'react';
-import { createPortal } from 'react-dom';
import type { MusicServiceSummary } from '../api';
import { useAuth } from '../auth';
import { useApi } from '../hooks';
import { useLumenLocale } from '../i18n';
import { Icon } from '../icons';
import {
+ allowedMusicPlayers,
+ asMusicPlayer,
aurralBaseUrl,
AVAILABLE_MUSIC_PLAYERS,
- MUSIC_PLAYERS,
+ isAndroid,
openPlayer,
playLink,
previewKey,
stopPreview,
+ storedMusicPlayer,
togglePreview,
usePreview,
usePreviewStatus,
@@ -22,27 +23,38 @@ import {
} from '../musicPlayback';
import { usePrefs } from '../settings';
import { Cover } from './cards';
-import { useDialog } from './useDialog';
-// Where Play goes for this person, and whether that app is reachable.
+// Where Play goes for this person. The picker offers the apps the admin allows (Lumen
+// settings), Aurral only with an Aurral service and Hearth only on Android phones; a saved
+// choice that is no longer offered falls back to the admin's default, then the first app.
+// With no app offered, Play has nowhere to go and songs keep their previews.
export function useMusicPlayer() {
const { user } = useAuth();
- const { prefs, set } = usePrefs();
+ const { prefs, set, adminConfig, locked } = usePrefs();
const services = useApi(
user ? '/service/music' : null
);
const aurralBase = aurralBaseUrl(services.data);
- const chosen: MusicPlayer = AVAILABLE_MUSIC_PLAYERS.includes(
- prefs.musicPlayer
- )
- ? prefs.musicPlayer
- : 'aurral';
- // no Aurral to open (a Lidarr setup): Play searches Plex instead
- const player: MusicPlayer =
- chosen === 'aurral' && services.data && !aurralBase ? 'plex' : chosen;
- const linkFor = (target: PlayTarget) => playLink(player, target, aurralBase);
+ const offered = allowedMusicPlayers(adminConfig.musicPlayers).filter(
+ (value) =>
+ AVAILABLE_MUSIC_PLAYERS.includes(value) &&
+ (value !== 'aurral' || !services.data || Boolean(aurralBase)) &&
+ (value !== 'hearth' || isAndroid())
+ );
+ const chosen = asMusicPlayer(prefs.musicPlayer);
+ const adminDefault = asMusicPlayer(adminConfig.defaults?.musicPlayer);
+ const player: MusicPlayer | null =
+ chosen && offered.includes(chosen)
+ ? chosen
+ : adminDefault && offered.includes(adminDefault)
+ ? adminDefault
+ : (offered[0] ?? null);
+ const linkFor = (target: PlayTarget) =>
+ player ? playLink(player, target, aurralBase) : null;
return {
player,
+ offered,
+ locked: locked.has('musicPlayer'),
previews: prefs.musicPreviews,
aurralBase,
linkFor,
@@ -50,49 +62,34 @@ export function useMusicPlayer() {
const url = linkFor(target);
if (url) openPlayer(url);
},
- setPlayer: (value: MusicPlayer) => set('musicPlayer', value),
+ setPlayer: (value: MusicPlayer) =>
+ set('musicPlayer', storedMusicPlayer(value)),
setPreviews: (value: boolean) => set('musicPreviews', value),
};
}
-const playerName = (
+export const playerName = (
player: MusicPlayer,
t: ReturnType['t']
) =>
player === 'plex'
? 'Plex'
- : player === 'shelf'
- ? t('lumen.music.player.shelf', 'Shelf app')
+ : player === 'hearth'
+ ? t('lumen.music.player.hearth', 'Hearth app')
: 'Aurral';
-export function PlayOpensIn() {
- const { t } = useLumenLocale();
- const { player } = useMusicPlayer();
- const [open, setOpen] = useState(false);
- return (
- <>
- setOpen(true)}
- aria-haspopup="dialog"
- >
-
- {t('lumen.music.playOpensIn', 'Play opens in: {app}', {
- app: playerName(player, t),
- })}
-
- {open && setOpen(false)} />}
- >
- );
-}
-
-function PlayOpensInSheet({ onClose }: { onClose: () => void }) {
+// "When you press Play" on the You page: the music app and the 30-second previews.
+export function MusicPlayerSettings() {
const { t } = useLumenLocale();
- const box = useRef(null);
- useDialog(box, onClose);
- const { player, previews, setPlayer, setPreviews, aurralBase } =
- useMusicPlayer();
+ const {
+ player,
+ offered,
+ locked,
+ previews,
+ setPlayer,
+ setPreviews,
+ aurralBase,
+ } = useMusicPlayer();
const help: Record = {
aurral: aurralBase
? t(
@@ -107,106 +104,71 @@ function PlayOpensInSheet({ onClose }: { onClose: () => void }) {
'lumen.music.player.plexHelp',
'Searches for it in Plex, in the same reused tab.'
),
- shelf: t(
- 'lumen.music.player.shelfHelp',
- 'The Shelf phone app. Coming once the app can open links.'
+ hearth: t(
+ 'lumen.music.player.hearthHelp',
+ 'Opens it in the Hearth app on this phone.'
),
};
- return createPortal(
-
-
-
-
-
-
- {t('lumen.music.whenYouPressPlay', 'When you press Play')}
-
- {t(
- 'lumen.music.playHandoff',
- 'Lumen hands songs you have to your music app. Saved for your account.'
- )}
-
-
-
- {MUSIC_PLAYERS.map((value) => {
- const available = AVAILABLE_MUSIC_PLAYERS.includes(value);
- return (
-
-
-
- {playerName(value, t)}
- {!available && (
-
- {t('lumen.music.comingSoon', 'Coming')}
-
- )}
-
- {help[value]}
-
- void setPlayer(value)}
- />
-
- );
- })}
-
-
+ return (
+ <>
+ {offered.length > 0 && (
+
+ {offered.map((value) => (
- {t('lumen.music.previews', '30-second previews')}
+ {playerName(value, t)}
- {t(
- 'lumen.music.previewsHelp',
- 'Hear songs you don’t have yet before you get them.'
- )}
+ {locked
+ ? t('lumen.me.setByAdmin', 'Set by your admin')
+ : help[value]}
{
- if (!event.target.checked) stopPreview();
- void setPreviews(event.target.checked);
- }}
+ type="radio"
+ name="music-player"
+ value={value}
+ checked={player === value}
+ disabled={locked}
+ onChange={() => void setPlayer(value)}
/>
-
-
-
- {t('lumen.common.done', 'Done')}
-
-
+ ))}
+ )}
+
+
+
+ {t('lumen.music.previews', '30-second previews')}
+
+ {t(
+ 'lumen.music.previewsHelp',
+ 'Hear songs you don’t have yet before you get them.'
+ )}
+
+
+ {
+ if (!event.target.checked) stopPreview();
+ void setPreviews(event.target.checked);
+ }}
+ />
+
-
,
- document.body
+ >
);
}
diff --git a/lumen/src/components/MusicRatings.tsx b/lumen/src/components/MusicRatings.tsx
index 8f788f5..44c2ab2 100644
--- a/lumen/src/components/MusicRatings.tsx
+++ b/lumen/src/components/MusicRatings.tsx
@@ -1,7 +1,6 @@
import { useEffect } from 'react';
import { useApi } from '../hooks';
import { useLumenLocale } from '../i18n';
-import { Section } from './cards';
type RatingSource = 'musicbrainz' | 'lidarr' | 'theaudiodb' | 'discogs';
type Rating = {
@@ -42,64 +41,77 @@ export default function MusicRatings({ albumId }: { albumId: string }) {
const timer = window.setInterval(revalidate, 60_000);
return () => window.clearInterval(timer);
}, [data?.failedSources?.length, revalidate]);
- if (!data && !error) return null;
- const ratings = new Map(
- (data?.ratings ?? []).map((rating) => [rating.source, rating])
- );
- const failed = new Set(data?.failedSources ?? []);
- if (error) {
- return (
-
-
- {t('lumen.music.ratingsFailed', 'Ratings could not be loaded.')}
-
-
- );
- }
+ if (!data || error) return null;
+ const failed = new Set(data.failedSources ?? []);
+ type Shown = {
+ id: RatingSource;
+ full: string;
+ short?: string;
+ href?: string;
+ };
+ const shown = SOURCES.flatMap(({ id, label }): Shown[] => {
+ const rating = (data.ratings ?? []).find((item) => item.source === id);
+ if (failed.has(id))
+ return [
+ {
+ id,
+ full: t(
+ 'lumen.music.ratingUnavailable',
+ '{source}: temporarily unavailable',
+ { source: label }
+ ),
+ },
+ ];
+ if (
+ !rating ||
+ !Number.isFinite(rating.score) ||
+ rating.score < 0 ||
+ rating.score > (rating.scale ?? 10)
+ )
+ return [];
+ const score = new Intl.NumberFormat(locale, {
+ maximumFractionDigits: 1,
+ }).format(rating.score);
+ return [
+ {
+ id,
+ full: t(
+ 'lumen.music.ratingScore',
+ '{source}: {score}/{scale} from {votes} votes',
+ {
+ source: label,
+ score,
+ scale: rating.scale ?? 10,
+ votes: new Intl.NumberFormat(locale).format(rating.votes),
+ }
+ ),
+ short: `${label} ${score}/${rating.scale ?? 10}`,
+ href: safeRatingUrl(rating.url),
+ },
+ ];
+ });
+ // sources with no rating show nothing; none at all hides the row
+ if (!shown.length) return null;
return (
-
-
- {SOURCES.map(({ id, label, fallback }) => {
- const rating = ratings.get(id);
- const text = failed.has(id)
- ? t(
- 'lumen.music.ratingUnavailable',
- '{source}: temporarily unavailable',
- { source: label }
- )
- : rating &&
- Number.isFinite(rating.score) &&
- rating.score >= 0 &&
- rating.score <= (rating.scale ?? 10)
- ? t(
- 'lumen.music.ratingScore',
- '{source}: {score}/{scale} from {votes} votes',
- {
- source: label,
- score: new Intl.NumberFormat(locale, {
- maximumFractionDigits: 1,
- }).format(rating.score),
- scale: rating.scale ?? 10,
- votes: new Intl.NumberFormat(locale).format(rating.votes),
- }
- )
- : t('lumen.music.noRating', '{source}: no rating available', {
- source: fallback,
- });
- const href = rating ? safeRatingUrl(rating.url) : undefined;
- return (
-
- {href ? (
-
- {text}
-
- ) : (
- text
- )}
-
- );
- })}
-
-
+
+ {shown.map(({ id, full, short, href }) => (
+
+ {href ? (
+
+ {short ?? full}
+
+ ) : short ? (
+ {short}
+ ) : (
+ full
+ )}
+
+ ))}
+
);
}
diff --git a/lumen/src/components/PhoneFilters.tsx b/lumen/src/components/PhoneFilters.tsx
new file mode 100644
index 0000000..03472f2
--- /dev/null
+++ b/lumen/src/components/PhoneFilters.tsx
@@ -0,0 +1,201 @@
+import { useRef, useState, useSyncExternalStore, type ReactNode } from 'react';
+import { createPortal } from 'react-dom';
+import { useLumenLocale } from '../i18n';
+import { Icon } from '../icons';
+import { useDialog } from './useDialog';
+
+// Phones (the same width as the genre sheet) keep a page's filters behind one Filters button:
+// the control people flip most stays on the page, the rest opens in a bottom sheet, and each
+// filter in use shows as a removable chip on one scrolling line. Wider screens keep the page's
+// own inline filters.
+const PHONE = '(max-width: 699px)';
+const subscribePhone = (cb: () => void) => {
+ const m = window.matchMedia(PHONE);
+ m.addEventListener('change', cb);
+ return () => m.removeEventListener('change', cb);
+};
+export const usePhone = () =>
+ useSyncExternalStore(subscribePhone, () => window.matchMedia(PHONE).matches);
+
+export type AppliedFilter = {
+ key: string;
+ label: string;
+ // the chip's accessible name; defaults to "Remove {label}"
+ aria?: string;
+ remove: () => void;
+};
+
+export function FilterSheet({
+ title,
+ onClose,
+ clear,
+ done,
+ children,
+}: {
+ title: string;
+ onClose: () => void;
+ clear?: ReactNode;
+ done: string;
+ children: ReactNode;
+}) {
+ const box = useRef
(null);
+ useDialog(box, onClose);
+ return createPortal(
+
+
+
+
+
+
+ {children}
+
+ {clear}
+
+ {done}
+
+
+
+
+
,
+ document.body
+ );
+}
+
+export function AppliedFilters({
+ chips,
+ leading,
+}: {
+ chips: AppliedFilter[];
+ leading?: ReactNode;
+}) {
+ const { t } = useLumenLocale();
+ if (!chips.length && !leading) return null;
+ return (
+
+ {leading}
+ {chips.map((chip) => (
+
+ {chip.label}
+
+
+ ))}
+
+ );
+}
+
+// The phone filter area: one row (the page's main switch, then Filters with a count), the
+// applied-filter chips, and the sheet. `children` are the sheet's inline controls (laid out
+// like the page's toolbar); `panel` is anything below them, such as a More Filters block.
+export function PhoneFilterBar({
+ primary,
+ chips,
+ count = chips.length,
+ leading,
+ clear,
+ onClear,
+ panel,
+ defaultOpen = false,
+ bodyLabel,
+ children,
+}: {
+ primary?: ReactNode;
+ chips: AppliedFilter[];
+ count?: number;
+ leading?: ReactNode;
+ clear?: ReactNode;
+ onClear?: () => void;
+ panel?: ReactNode;
+ // open from the start (Books: a genre picked on the landing keeps the picker open)
+ defaultOpen?: boolean;
+ // a name for the sheet's controls, where the page names its filter group
+ bodyLabel?: string;
+ children?: ReactNode;
+}) {
+ const { t } = useLumenLocale();
+ const [open, setOpen] = useState(defaultOpen);
+ const title = t('lumen.browse.filters', 'Filters');
+ const clearNode =
+ clear ??
+ (onClear ? (
+ {
+ if (count) onClear();
+ }}
+ >
+ {t('lumen.filters.clearAll', 'Clear all')}
+
+ ) : undefined);
+ const hasSheet = Boolean(children || panel);
+ return (
+
+ {(primary || hasSheet) && (
+
+ {primary}
+ {hasSheet && (
+ setOpen(true)}
+ >
+ {title}
+ {count > 0 && {count} }
+
+ )}
+
+ )}
+
+ {open && hasSheet && (
+
setOpen(false)}
+ clear={clearNode}
+ done={t('lumen.browse.filtersDone', 'Show results')}
+ >
+ {children && (
+
+ {children}
+
+ )}
+ {panel}
+
+ )}
+
+ );
+}
diff --git a/lumen/src/components/Podcasts.tsx b/lumen/src/components/Podcasts.tsx
index 5916fc9..30a195e 100644
--- a/lumen/src/components/Podcasts.tsx
+++ b/lumen/src/components/Podcasts.tsx
@@ -431,6 +431,8 @@ function NewEpisodes({ episodes }: { episodes: LatestEpisode[] }) {
function PodcastDiscover({ shows }: { shows: LibraryPodcast[] | null }) {
const { t, locale } = useLumenLocale();
const [genre, setGenre] = useState(null);
+ // the chart says which shows you follow: narrow it to those, or to the rest
+ const [following, setFollowing] = useState<'all' | 'yes' | 'no'>('all');
const genres = list(
useApi<{ genres: PodcastGenre[] }>('/podcast/genres').data?.genres
);
@@ -461,6 +463,10 @@ function PodcastDiscover({ shows }: { shows: LibraryPodcast[] | null }) {
.filter((show) => !show.inLibrary)
.slice(0, 12);
const charted = list(chart.data?.results);
+ const shownChart =
+ following === 'all'
+ ? charted
+ : charted.filter((show) => show.inLibrary === (following === 'yes'));
const genreInfo = genres.find((g) => g.id === genre);
const genreName =
genreInfo && podcastGenreName(genreInfo.id, genreInfo.name, locale);
@@ -516,6 +522,41 @@ function PodcastDiscover({ shows }: { shows: LibraryPodcast[] | null }) {
))}
)}
+
+ {(
+ [
+ ['all', t('lumen.podcasts.filterAll', 'All')],
+ ['yes', t('lumen.podcasts.filterFollowing', 'Following')],
+ ['no', t('lumen.podcasts.filterNotFollowing', 'Not following')],
+ ] as const
+ ).map(([value, label]) => (
+ setFollowing(value)}
+ >
+ {label}
+
+ ))}
+
+ {chart.data && charted.length > 0 && shownChart.length === 0 && (
+
+ {following === 'yes'
+ ? t(
+ 'lumen.podcasts.noneFollowed',
+ 'You don’t follow any of these shows yet.'
+ )
+ : t(
+ 'lumen.podcasts.allFollowed',
+ 'You already follow every show here.'
+ )}
+
+ )}
{chart.error && !chart.data && (
{chart.error}
@@ -532,7 +573,7 @@ function PodcastDiscover({ shows }: { shows: LibraryPodcast[] | null }) {
)}
- {charted.slice(0, 18).map((show, index) => (
+ {shownChart.slice(0, 18).map((show, index) => (
(`/user/${id}/quota`, { currentPathOnly: true });
const shown = categories ?? (Object.keys(labels) as Category[]);
+ // loaded but nothing to list: no empty heading
+ if (quota.data && !quota.error && !shown.some((key) => quota.data?.[key]))
+ return null;
return (
)}
+ {(extras.categoryEnabled('movie') ||
+ extras.categoryEnabled('tv')) && (
+
+
+ {t('i18n.providerDiscovery', 'Provider Discovery')}
+
+ )}
{administrator && versionStatus && (
{/* phones: detail pages hide the tab bar, so this is the way out (also while loading) */}
{detail && (
-
-
-
+
)}
);
}
+
+// Phones: the back button floats over the art at the top of a detail page. Scrolled down it
+// would sit on the content, so it joins a solid bar with the page's title instead.
+function DetailBack({ label, onBack }: { label: string; onBack: () => void }) {
+ const [title, setTitle] = useState('');
+ useEffect(() => {
+ const update = () => {
+ const heading = document.querySelector('.dtitle h1, .detail h1');
+ const below = heading
+ ? heading.getBoundingClientRect().bottom < 64
+ : window.scrollY > 240;
+ setTitle(below ? heading?.textContent?.trim() || ' ' : '');
+ };
+ update();
+ window.addEventListener('scroll', update, { passive: true });
+ return () => window.removeEventListener('scroll', update);
+ }, []);
+ return (
+
+
+
+
+ {title && (
+
+ {title}
+
+ )}
+
+ );
+}
diff --git a/lumen/src/components/TvCollectionLinks.tsx b/lumen/src/components/TvCollectionLinks.tsx
index 6dbff19..8b2ed70 100644
--- a/lumen/src/components/TvCollectionLinks.tsx
+++ b/lumen/src/components/TvCollectionLinks.tsx
@@ -1,40 +1,22 @@
-import { useState } from 'react';
import { Link } from 'react-router-dom';
import { useApi } from '../hooks';
import { useLumenLocale } from '../i18n';
-import { ServiceNote } from './extra';
+import { Icon } from '../icons';
export default function TvCollectionLinks({ id }: { id: number }) {
const { t } = useLumenLocale();
- const [expanded, setExpanded] = useState(false);
- const { data, error, reload } = useApi<{
+ // asked for up front so a series in no collection shows no empty box
+ const { data } = useApi<{
collections: { id: number; name: string }[];
- }>(expanded ? `/collection-catalog/tv/for-series/${id}` : null);
+ }>(`/collection-catalog/tv/for-series/${id}`);
+ if (!data?.collections?.length) return null;
return (
- setExpanded(event.currentTarget.open)}
- >
- {t('lumen.tv.collections.title', 'Series Collections')}
-
- {!data && !error && expanded && (
-
- {t('lumen.tv.collections.loading', 'Loading series collections…')}
-
- )}
- {data && !data.collections.length && (
-
- {t(
- 'lumen.tv.collections.empty',
- 'This series has no catalog collections.'
- )}
-
- )}
- {!!data?.collections.length && (
+
+
+
+ {t('lumen.tv.collections.title', 'Series Collections')}
+
+ {
{data.collections.map((group) => (
))}
- )}
+ }
);
}
diff --git a/lumen/src/components/VideoRatings.tsx b/lumen/src/components/VideoRatings.tsx
index 34bca76..4e2865b 100644
--- a/lumen/src/components/VideoRatings.tsx
+++ b/lumen/src/components/VideoRatings.tsx
@@ -3,6 +3,7 @@ import { createPortal } from 'react-dom';
import { useApi } from '../hooks';
import { useLumenLocale } from '../i18n';
import { Icon } from '../icons';
+import { usePhone } from './PhoneFilters';
type RatingResponse = {
rt?: { criticsScore?: number; audienceScore?: number; url?: string };
@@ -47,6 +48,9 @@ function preferredScore(primary: unknown, fallback: unknown, max: number) {
return score(primary, max) ?? score(fallback, max);
}
+// ratings shown on a phone before +N
+const RATINGS_PREVIEW = 1;
+
export default function VideoRatings({
mediaType,
id,
@@ -66,6 +70,8 @@ export default function VideoRatings({
className?: string;
showStatus?: boolean;
}) {
+ const phone = usePhone();
+ const [allRatings, setAllRatings] = useState(false);
const { t, locale } = useLumenLocale();
const [ready, setReady] = useState(delayMs === 0);
const [settled, setSettled] = useState(false);
@@ -171,6 +177,12 @@ export default function VideoRatings({
: t('lumen.videoRating.loading', 'Loading ratings…');
return {message} ;
}
+ const folded =
+ !className && phone && !allRatings && ratings.length > RATINGS_PREVIEW + 1;
+ // folded, the one chip is the best-known source: IMDb when there is one
+ const visible = folded
+ ? [ratings.find((rating) => rating.source === 'imdb') ?? ratings[0]]
+ : ratings;
return (
- {ratings.map((rating) => {
+ {visible.map((rating) => {
const href = safeUrl(rating.url);
const formattedScore = new Intl.NumberFormat(locale, {
maximumFractionDigits: rating.scale === 10 ? 1 : 0,
@@ -203,6 +215,25 @@ export default function VideoRatings({
);
})}
+ {folded && (
+
+ setAllRatings(true)}
+ >
+ +{ratings.length - RATINGS_PREVIEW}
+
+
+ )}
);
}
diff --git a/lumen/src/components/cards.tsx b/lumen/src/components/cards.tsx
index f6bd274..8998746 100644
--- a/lumen/src/components/cards.tsx
+++ b/lumen/src/components/cards.tsx
@@ -1,4 +1,6 @@
import {
+ createContext,
+ useContext,
useEffect,
useLayoutEffect,
useRef,
@@ -52,6 +54,7 @@ import {
type AvailabilityMode,
} from '../videoAvailability';
import { canRequestBook } from './detail';
+import { usePhone } from './PhoneFilters';
import { useQuickRequest } from './requestSheet';
import { useToast } from './toast';
import { VideoRatingsPopover } from './VideoRatings';
@@ -1162,6 +1165,19 @@ export function Rail({
);
}
+// Long settings pages fold each section behind its title on phones; a jump link or an
+// address with #section opens it (see openSection).
+const FoldContext = createContext(false);
+export function FoldSections({ children }: { children: ReactNode }) {
+ return {children} ;
+}
+export function openSection(id: string) {
+ const node = document.getElementById(id);
+ const fold = node?.querySelector(':scope > details.phone-section');
+ if (fold instanceof HTMLDetailsElement) fold.open = true;
+ node?.scrollIntoView({ block: 'start' });
+}
+
export function Section({
title,
id,
@@ -1175,6 +1191,30 @@ export function Section({
action?: ReactNode;
children: ReactNode;
}) {
+ const fold = useContext(FoldContext);
+ const phone = usePhone();
+ if (fold && phone)
+ return (
+
+
+
+ {title}
+
+
+ {(link || action) && (
+
+ {link && {link[0]}}
+ {action}
+
+ )}
+ {/* sections inside a folded one stay open */}
+
+ {children}
+
+
+
+
+ );
return (
diff --git a/lumen/src/components/detail.tsx b/lumen/src/components/detail.tsx
index aa57b92..a5bb915 100644
--- a/lumen/src/components/detail.tsx
+++ b/lumen/src/components/detail.tsx
@@ -28,6 +28,7 @@ import { useLumenLocale } from '../i18n';
import { Icon, type IconName } from '../icons';
import { sessionGeneration } from '../sessionState';
import { Glyph, type Stat } from './cards';
+import { ClampText } from './ClampText';
import { useToast } from './toast';
const hue = (s: string) =>
@@ -151,14 +152,47 @@ export function People({
);
}
+// Starring and Crew share one folded "Cast & Crew" box. It keeps the saved "Keep open" choice
+// of the old Starring box (cast) and also opens for people who kept the old Crew box open.
+export function CastCrewDisclosure({
+ media,
+ cast,
+ crew,
+}: {
+ media: 'movie' | 'tv';
+ cast?: Person[];
+ crew?: Person[];
+}) {
+ const { t } = useLumenLocale();
+ const { hash } = useLocation();
+ if (!cast?.length && !crew?.length && hash !== '#cast' && hash !== '#crew')
+ return null;
+ return (
+
+
+
+
+ );
+}
+
export function CreditsDisclosure({
media,
credit,
people,
+ bare = false,
}: {
media: 'movie' | 'tv';
credit: 'cast' | 'crew';
people?: Person[];
+ // a part of a combined box: a small heading instead of its own folded box
+ bare?: boolean;
}) {
const { t } = useLumenLocale();
const { hash } = useLocation();
@@ -167,6 +201,7 @@ export function CreditsDisclosure({
return (
(null);
const { hash, key } = useLocation();
const anchor = panel === 'subjectTags' ? undefined : panel;
+ const anchorList = anchors.join(' ');
useEffect(() => {
const element = disclosure.current;
- if (element && anchor && hash === `#${anchor}`) {
+ if (!element) return;
+ const target = [anchor, ...anchorList.split(' ')].find(
+ (name) => name && hash === `#${name}`
+ );
+ if (target) {
element.open = true;
- element.scrollIntoView();
+ (
+ element.querySelector(`[data-anchor="${target}"]`) ?? element
+ ).scrollIntoView();
}
- }, [anchor, hash, key]);
+ }, [anchor, anchorList, hash, key]);
const pending = useRef(false);
const legacy: Partial = {
@@ -318,9 +372,10 @@ export function VideoDisclosure({
crew: user?.settings?.detailDisclosureCrewPinned,
subjectTags: user?.settings?.detailDisclosureSubjectTagsPinned,
};
- const pinned =
- user?.settings?.detailDisclosurePins?.[media]?.[panel] ??
- (media === 'movie' && legacy[panel] === true);
+ const savedPin = (name: keyof VideoDetailPins) =>
+ user?.settings?.detailDisclosurePins?.[media]?.[name] ??
+ (media === 'movie' && legacy[name] === true);
+ const pinned = savedPin(panel) || alsoPinnedBy.some(savedPin);
const preference =
panel === 'subjectTags'
? t('lumen.detail.subjectTagPreference', 'subject tag')
@@ -346,9 +401,12 @@ export function VideoDisclosure({
pending.current = true;
setBusy(true);
try {
+ // closing for good also clears the merged boxes' old choices, so it stays closed
+ const body: Partial = { [panel]: !pinned };
+ if (pinned) for (const name of alsoPinnedBy) body[name] = false;
const result = await api(
`/user/${user.id}/settings/detail-disclosures/${media}`,
- { method: 'POST', body: JSON.stringify({ [panel]: !pinned }) }
+ { method: 'POST', body: JSON.stringify(body) }
);
if (generation !== sessionGeneration()) return;
if (result[panel] !== !pinned) {
@@ -377,6 +435,14 @@ export function VideoDisclosure({
}
}
+ if (bare)
+ return (
+
+ );
+
return (
{title}
{by && {by}
}
-
- {line.filter(Boolean).map((x, i) => (
-
{x}
- ))}
+
+
+ {line
+ .filter((x) => (Array.isArray(x) ? x.length > 0 : Boolean(x)))
+ .map((x, i) => (
+ {x}
+ ))}
+
- {navigation}
+ {navigation}
+ {overview && (
+
+ {overview}
+
+ )}
>
);
}
@@ -570,7 +648,14 @@ export function DiscoverDetailNavigation({
);
};
return (
-
+
{state.previous && (
= topZ) {
+ top = modal;
+ topZ = z;
+ }
+ }
+ return top;
+}
+
// Shared behaviour of the sheets that set aria-modal: focus moves in on open, Tab stays inside,
// Escape closes, the page behind can't be reached (inert) or scrolled, and focus goes back to
// whatever opened the dialog when it closes.
@@ -17,8 +36,8 @@ export function useDialog(
if (!box) return;
const opener = document.activeElement as HTMLElement | null;
const root = document.getElementById('root');
- const wasInert = root?.inert ?? false;
- const overflow = document.body.style.overflow;
+ if (openDialogs === 0) pageOverflow = document.body.style.overflow;
+ openDialogs += 1;
if (root) root.inert = true;
document.body.style.overflow = 'hidden';
if (!box.hasAttribute('tabindex')) box.tabIndex = -1;
@@ -32,6 +51,8 @@ export function useDialog(
preventScroll: true,
});
const onKey = (e: KeyboardEvent) => {
+ const top = topDialog();
+ if (top && top !== box) return;
if (e.key === 'Escape') {
e.stopPropagation();
closeRef.current();
@@ -59,8 +80,11 @@ export function useDialog(
document.addEventListener('keydown', onKey);
return () => {
document.removeEventListener('keydown', onKey);
- if (root) root.inert = wasInert;
- document.body.style.overflow = overflow;
+ openDialogs = Math.max(0, openDialogs - 1);
+ if (openDialogs === 0) {
+ if (root) root.inert = false;
+ document.body.style.overflow = pageOverflow;
+ }
if (opener && document.contains(opener))
opener.focus({ preventScroll: true });
};
diff --git a/lumen/src/i18n/locales/ar.generated.ts b/lumen/src/i18n/locales/ar.generated.ts
index ddb5ece..a03c0c1 100644
--- a/lumen/src/i18n/locales/ar.generated.ts
+++ b/lumen/src/i18n/locales/ar.generated.ts
@@ -3309,6 +3309,39 @@ export const messages = {
'lumen.browse.browseGenres': 'تصفح الأنواع',
'lumen.browse.checkedPopular': 'تم فحص {count} من أكثر {media} شيوعًا.',
'lumen.browse.clearFilters': 'مسح عوامل تصفية الاستكشاف',
+ 'lumen.browse.filters': 'عوامل التصفية',
+ 'lumen.browse.filtersDone': 'عرض النتائج',
+ 'lumen.browse.removeFilter': 'إزالة {name}',
+ 'lumen.browse.notFilter': 'باستثناء {name}',
+ 'lumen.browse.activeFilters': 'عوامل التصفية النشطة',
+ 'lumen.filters.clearAll': 'مسح الكل',
+ 'lumen.search.someSourcesFailed': 'لم تستجب بعض المصادر ({sources}).',
+ 'lumen.search.source.books': 'الكتب',
+ 'lumen.search.source.comics': 'القصص المصورة',
+ 'lumen.search.source.titles': 'الأفلام والمسلسلات والموسيقى',
+ 'lumen.search.source.some': 'بعض المزوّدين',
+ 'lumen.detail.moreActions': 'إجراءات أخرى',
+ 'lumen.detail.more': 'المزيد',
+ 'lumen.detail.close': 'إغلاق',
+ 'lumen.detail.showMore': 'عرض المزيد',
+ 'lumen.detail.showLess': 'عرض أقل',
+ 'lumen.account.jumpTo': 'انتقل إلى',
+ 'lumen.account.importLists': 'استيراد القوائم',
+ 'lumen.me.importLists': 'استيراد القوائم',
+ 'lumen.me.importListsHelp': 'قوائم IMDb ورفوف Goodreads وHardcover',
+ 'lumen.music.player.hearth': 'تطبيق Hearth',
+ 'lumen.music.player.hearthHelp': 'يفتحه في تطبيق Hearth على هذا الهاتف.',
+ 'lumen.music.backToDiscover': 'العودة إلى الاستكشاف',
+ 'lumen.adminSettings.musicAppsTitle': 'تطبيقات الموسيقى',
+ 'lumen.adminSettings.musicAppsHelp':
+ 'التطبيقات التي يمكن للأشخاص اختيارها للتشغيل. يظهر Aurral فقط عند إعداد خدمة Aurral، ويظهر Hearth فقط على هواتف Android. إذا لم يُفعَّل أي تطبيق يتوقف التشغيل وتبقى المقتطفات.',
+ 'lumen.adminSettings.musicDefaultApp': 'التطبيق الافتراضي',
+ 'lumen.podcasts.followingFilter': 'المتابَعة',
+ 'lumen.podcasts.filterAll': 'الكل',
+ 'lumen.podcasts.filterFollowing': 'المتابَعة',
+ 'lumen.podcasts.filterNotFollowing': 'غير المتابَعة',
+ 'lumen.podcasts.noneFollowed': 'لا تتابع أيًا من هذه البرامج بعد.',
+ 'lumen.podcasts.allFollowed': 'أنت تتابع كل البرامج هنا بالفعل.',
'lumen.browse.clearNetwork': 'مسح الشبكة {name}',
'lumen.browse.clearStudio': 'مسح الاستوديو {name}',
'lumen.browse.clearSubjectTags': 'مسح الوسوم',
@@ -7287,11 +7320,9 @@ export const messages = {
'lumen.mediaServerCollections.loadFailed':
'تعذر تحميل المجموعات أو تأكيد التغيير.',
'lumen.mediaServerCollections.retry': 'إعادة تحميل المجموعات',
- 'lumen.tv.episodeQueue.off': 'قائمة انتظار الحلقات · متوقفة · يديرها المسؤول',
- 'lumen.tv.episodeQueue.one':
- 'قائمة انتظار الحلقات · حلقة واحدة يحددها المسؤول',
- 'lumen.tv.episodeQueue.many':
- 'قائمة انتظار الحلقات · {count} حلقات يحددها المسؤول',
+ 'lumen.tv.episodeQueue.off': 'قائمة انتظار الحلقات: متوقفة',
+ 'lumen.tv.episodeQueue.one': 'قائمة انتظار الحلقات: حلقة واحدة',
+ 'lumen.tv.episodeQueue.many': 'قائمة انتظار الحلقات: {count} حلقات',
'lumen.videoPlayback.open': 'خيارات التشغيل',
'lumen.videoPlayback.title': 'تشغيل الفيلم',
'lumen.videoPlayback.quality4k': 'جودة التشغيل: 4K',
@@ -8137,4 +8168,20 @@ export const messages = {
'lumen.settings.confirmFailed':
'قبل الخادم التغيير، لكن تعذّر على Lumen تأكيد الحالة المحفوظة. أبقِ هذا النموذج مفتوحًا وأعد المحاولة.',
'components.Common.available': 'متاح',
+ 'lumen.music.allSongs': 'كل الأغاني ({count})',
+ 'lumen.detail.discoverNavigation': 'عناوين أخرى من الاستكشاف',
+ 'lumen.videoRating.showAll': 'عرض كل التقييمات ({count})',
+ 'lumen.status.hdAnd4k': 'HD + 4K',
+ 'lumen.detail.showAllCount': 'عرض الكل ({count})',
+ 'lumen.detail.castCrew': 'طاقم التمثيل والعمل',
+ 'lumen.detail.details': 'التفاصيل',
+ 'lumen.music.creditsDetails': 'الاعتمادات والتفاصيل',
+ 'lumen.me.libraryTools': 'المكتبة والأدوات',
+ 'lumen.admin.home.mediaServices': 'خدمات الوسائط',
+ 'lumen.detail.allEditions': 'كل الإصدارات ({count})',
+ 'lumen.detail.showFewer': 'عرض عدد أقل',
+ 'lumen.bookDetail.allNarrations': 'كل التسجيلات ({count})',
+ 'lumen.bookDetail.edition': 'الإصدار',
+ 'lumen.bookDetail.ebookEpub': 'كتاب إلكتروني · EPUB',
+ 'lumen.bookDetail.pageCount': '{count} صفحة',
} as const;
diff --git a/lumen/src/i18n/locales/en.generated.ts b/lumen/src/i18n/locales/en.generated.ts
index 211e750..f0942c8 100644
--- a/lumen/src/i18n/locales/en.generated.ts
+++ b/lumen/src/i18n/locales/en.generated.ts
@@ -3361,6 +3361,40 @@ export const messages = {
'lumen.browse.browseGenres': 'Browse Genres',
'lumen.browse.checkedPopular': 'Checked the {count} most popular {media}.',
'lumen.browse.clearFilters': 'Clear Discovery Filters',
+ 'lumen.browse.filters': 'Filters',
+ 'lumen.browse.filtersDone': 'Show results',
+ 'lumen.browse.removeFilter': 'Remove {name}',
+ 'lumen.browse.notFilter': 'Not {name}',
+ 'lumen.browse.activeFilters': 'Active filters',
+ 'lumen.filters.clearAll': 'Clear all',
+ 'lumen.search.someSourcesFailed': 'Some sources didn’t answer ({sources}).',
+ 'lumen.search.source.books': 'Books',
+ 'lumen.search.source.comics': 'Comics',
+ 'lumen.search.source.titles': 'Movies, series and music',
+ 'lumen.search.source.some': 'some providers',
+ 'lumen.detail.moreActions': 'More actions',
+ 'lumen.detail.more': 'More',
+ 'lumen.detail.close': 'Close',
+ 'lumen.detail.showMore': 'Show more',
+ 'lumen.detail.showLess': 'Show less',
+ 'lumen.account.jumpTo': 'Jump to',
+ 'lumen.account.importLists': 'Import lists',
+ 'lumen.me.importLists': 'Import lists',
+ 'lumen.me.importListsHelp':
+ 'IMDb watchlists, Goodreads and Hardcover shelves',
+ 'lumen.music.player.hearth': 'Hearth app',
+ 'lumen.music.player.hearthHelp': 'Opens it in the Hearth app on this phone.',
+ 'lumen.music.backToDiscover': 'Back to Discover',
+ 'lumen.adminSettings.musicAppsTitle': 'Music apps',
+ 'lumen.adminSettings.musicAppsHelp':
+ 'The apps people can pick for Play on music. Aurral is offered only when an Aurral service is set up, and Hearth only on Android phones. With none on, Play is off and songs keep their previews.',
+ 'lumen.adminSettings.musicDefaultApp': 'Default app',
+ 'lumen.podcasts.followingFilter': 'Following',
+ 'lumen.podcasts.filterAll': 'All',
+ 'lumen.podcasts.filterFollowing': 'Following',
+ 'lumen.podcasts.filterNotFollowing': 'Not following',
+ 'lumen.podcasts.noneFollowed': 'You don’t follow any of these shows yet.',
+ 'lumen.podcasts.allFollowed': 'You already follow every show here.',
'lumen.browse.clearNetwork': 'Clear Network {name}',
'lumen.browse.clearStudio': 'Clear Studio {name}',
'lumen.browse.clearSubjectTags': 'Clear Subject Tags',
@@ -7319,9 +7353,9 @@ export const messages = {
'lumen.mediaServerCollections.loadFailed':
'Collections could not be loaded or confirmed.',
'lumen.mediaServerCollections.retry': 'Reload collections',
- 'lumen.tv.episodeQueue.off': 'Episode Queue · off · managed by admin',
- 'lumen.tv.episodeQueue.one': 'Episode Queue · 1 episode set by admin',
- 'lumen.tv.episodeQueue.many': 'Episode Queue · {count} episodes set by admin',
+ 'lumen.tv.episodeQueue.off': 'Episode Queue: off',
+ 'lumen.tv.episodeQueue.one': 'Episode Queue: 1 episode',
+ 'lumen.tv.episodeQueue.many': 'Episode Queue: {count} episodes',
'lumen.videoPlayback.open': 'Playback Options',
'lumen.videoPlayback.title': 'Play Movie',
'lumen.videoPlayback.quality4k': 'Playback quality: 4K',
@@ -8038,4 +8072,20 @@ export const messages = {
'{category} is turned off on this server.',
'lumen.settings.confirmFailed':
'The server accepted the change, but Lumen could not confirm the saved state. Keep this form open and retry.',
+ 'lumen.music.allSongs': 'All {count} songs',
+ 'lumen.detail.discoverNavigation': 'Other titles from Discover',
+ 'lumen.videoRating.showAll': 'Show all {count} ratings',
+ 'lumen.status.hdAnd4k': 'HD + 4K',
+ 'lumen.detail.showAllCount': 'Show all ({count})',
+ 'lumen.detail.castCrew': 'Cast & Crew',
+ 'lumen.detail.details': 'Details',
+ 'lumen.music.creditsDetails': 'Credits & Details',
+ 'lumen.me.libraryTools': 'Library & Tools',
+ 'lumen.admin.home.mediaServices': 'Media Services',
+ 'lumen.detail.allEditions': 'All {count} editions',
+ 'lumen.detail.showFewer': 'Show fewer',
+ 'lumen.bookDetail.allNarrations': 'All {count} narrations',
+ 'lumen.bookDetail.edition': 'Edition',
+ 'lumen.bookDetail.ebookEpub': 'Ebook · EPUB',
+ 'lumen.bookDetail.pageCount': '{count} pages',
} as const;
diff --git a/lumen/src/i18n/locales/fr.generated.ts b/lumen/src/i18n/locales/fr.generated.ts
index fc405cd..92f7a82 100644
--- a/lumen/src/i18n/locales/fr.generated.ts
+++ b/lumen/src/i18n/locales/fr.generated.ts
@@ -3597,6 +3597,42 @@ export const messages = {
'lumen.browse.checkedPopular':
'Recherche parmi les {count} {media} les plus populaires.',
'lumen.browse.clearFilters': 'Effacer les filtres de découverte',
+ 'lumen.browse.filters': 'Filtres',
+ 'lumen.browse.filtersDone': 'Voir les résultats',
+ 'lumen.browse.removeFilter': 'Retirer {name}',
+ 'lumen.browse.notFilter': 'Sauf {name}',
+ 'lumen.browse.activeFilters': 'Filtres actifs',
+ 'lumen.filters.clearAll': 'Tout effacer',
+ 'lumen.search.someSourcesFailed':
+ 'Certaines sources n’ont pas répondu ({sources}).',
+ 'lumen.search.source.books': 'Livres',
+ 'lumen.search.source.comics': 'BD',
+ 'lumen.search.source.titles': 'Films, séries et musique',
+ 'lumen.search.source.some': 'certains fournisseurs',
+ 'lumen.detail.moreActions': 'Autres actions',
+ 'lumen.detail.more': 'Plus',
+ 'lumen.detail.close': 'Fermer',
+ 'lumen.detail.showMore': 'Afficher plus',
+ 'lumen.detail.showLess': 'Afficher moins',
+ 'lumen.account.jumpTo': 'Aller à',
+ 'lumen.account.importLists': 'Importer des listes',
+ 'lumen.me.importLists': 'Importer des listes',
+ 'lumen.me.importListsHelp': 'Listes IMDb, étagères Goodreads et Hardcover',
+ 'lumen.music.player.hearth': 'Appli Hearth',
+ 'lumen.music.player.hearthHelp':
+ 'L’ouvre dans l’appli Hearth sur ce téléphone.',
+ 'lumen.music.backToDiscover': 'Retour à Découvrir',
+ 'lumen.adminSettings.musicAppsTitle': 'Applis de musique',
+ 'lumen.adminSettings.musicAppsHelp':
+ 'Les applis que chacun peut choisir pour Lire la musique. Aurral n’apparaît que si un service Aurral est configuré, et Hearth seulement sur les téléphones Android. Sans aucune appli, Lire est désactivé et les extraits restent.',
+ 'lumen.adminSettings.musicDefaultApp': 'Appli par défaut',
+ 'lumen.podcasts.followingFilter': 'Abonnements',
+ 'lumen.podcasts.filterAll': 'Tous',
+ 'lumen.podcasts.filterFollowing': 'Suivis',
+ 'lumen.podcasts.filterNotFollowing': 'Non suivis',
+ 'lumen.podcasts.noneFollowed':
+ 'Vous ne suivez encore aucune de ces émissions.',
+ 'lumen.podcasts.allFollowed': 'Vous suivez déjà toutes ces émissions.',
'lumen.browse.clearNetwork': 'Effacer le réseau {name}',
'lumen.browse.clearStudio': 'Effacer le studio {name}',
'lumen.browse.clearSubjectTags': 'Effacer les mots-clés',
@@ -7907,12 +7943,10 @@ export const messages = {
'lumen.mediaServerCollections.loadFailed':
'Impossible de charger ou de confirmer les collections.',
'lumen.mediaServerCollections.retry': 'Recharger les collections',
- 'lumen.tv.episodeQueue.off':
- 'File d’attente des épisodes · désactivée · gérée par l’administrateur',
- 'lumen.tv.episodeQueue.one':
- 'File d’attente des épisodes · 1 épisode défini par l’administrateur',
+ 'lumen.tv.episodeQueue.off': 'File d’attente des épisodes : désactivée',
+ 'lumen.tv.episodeQueue.one': 'File d’attente des épisodes : 1 épisode',
'lumen.tv.episodeQueue.many':
- 'File d’attente des épisodes · {count} épisodes définis par l’administrateur',
+ 'File d’attente des épisodes : {count} épisodes',
'lumen.videoPlayback.open': 'Options de lecture',
'lumen.videoPlayback.title': 'Lire le film',
'lumen.videoPlayback.quality4k': 'Qualité de lecture : 4K',
@@ -8832,4 +8866,20 @@ export const messages = {
'lumen.settings.confirmFailed':
'Le serveur a accepté la modification, mais Lumen n’a pas pu confirmer l’enregistrement. Gardez ce formulaire ouvert et réessayez.',
'components.Common.available': 'Disponible',
+ 'lumen.music.allSongs': 'Les {count} titres',
+ 'lumen.detail.discoverNavigation': 'Autres titres de Découvrir',
+ 'lumen.videoRating.showAll': 'Afficher les {count} notes',
+ 'lumen.status.hdAnd4k': 'HD + 4K',
+ 'lumen.detail.showAllCount': 'Tout afficher ({count})',
+ 'lumen.detail.castCrew': 'Distribution et équipe',
+ 'lumen.detail.details': 'Détails',
+ 'lumen.music.creditsDetails': 'Crédits et détails',
+ 'lumen.me.libraryTools': 'Bibliothèque et outils',
+ 'lumen.admin.home.mediaServices': 'Services multimédias',
+ 'lumen.detail.allEditions': 'Les {count} éditions',
+ 'lumen.detail.showFewer': 'Afficher moins',
+ 'lumen.bookDetail.allNarrations': 'Les {count} narrations',
+ 'lumen.bookDetail.edition': 'Édition',
+ 'lumen.bookDetail.ebookEpub': 'Livre numérique · EPUB',
+ 'lumen.bookDetail.pageCount': '{count} pages',
} as const;
diff --git a/lumen/src/musicPlayback.ts b/lumen/src/musicPlayback.ts
index 577f81f..a5f0503 100644
--- a/lumen/src/musicPlayback.ts
+++ b/lumen/src/musicPlayback.ts
@@ -6,17 +6,37 @@ import { onSessionReset } from './sessionState';
// person picked (Aurral by default), and songs that are not downloaded yet get
// a 30-second preview here so people can check them before asking for them.
-export type MusicPlayer = 'aurral' | 'plex' | 'shelf';
+export type MusicPlayer = 'aurral' | 'plex' | 'hearth';
export const MUSIC_PLAYERS: readonly MusicPlayer[] = [
'aurral',
'plex',
- 'shelf',
+ 'hearth',
];
-// Shelf (the phone app) has no links yet; it stays visible as "coming".
export const AVAILABLE_MUSIC_PLAYERS: readonly MusicPlayer[] = [
'aurral',
'plex',
+ 'hearth',
];
+// Hearth was called Shelf: saved choices (and the account setting SeerrNG stores) still say
+// 'shelf', which reads as Hearth.
+export const asMusicPlayer = (value: unknown): MusicPlayer | null =>
+ value === 'shelf'
+ ? 'hearth'
+ : MUSIC_PLAYERS.includes(value as MusicPlayer)
+ ? (value as MusicPlayer)
+ : null;
+export const storedMusicPlayer = (player: MusicPlayer) =>
+ player === 'hearth' ? 'shelf' : player;
+// The apps an admin lets people pick (lumen-config.json "musicPlayers"); every app when the
+// file does not say.
+export const allowedMusicPlayers = (value: unknown): MusicPlayer[] => {
+ if (!Array.isArray(value)) return [...MUSIC_PLAYERS];
+ const picked = new Set(value.map(asMusicPlayer));
+ return MUSIC_PLAYERS.filter((player) => picked.has(player));
+};
+// Hearth is an Android app: its links only open on Android phones.
+export const isAndroid = () =>
+ typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
export interface PlayableTrack {
title: string;
@@ -116,16 +136,72 @@ const searchText = (target: PlayTarget) =>
export const plexLink = (target: PlayTarget) =>
`https://app.plex.tv/desktop/#!/search?${query({ query: searchText(target) })}`;
+// Hearth (package org.ncbudd.abswatch, 1.0.47 or newer) plays shelf://play links: an album
+// by its MusicBrainz release-group id, a song on its album when that id is known (the most
+// reliable), else by title and artist, an artist by MusicBrainz id. An artist without an id
+// opens Hearth's search instead.
+export const HEARTH_PACKAGE = 'org.ncbudd.abswatch';
+const linkParams = (values: [string, string | null | undefined][]) =>
+ values
+ .filter(([, value]) => value)
+ .map(([key, value]) => `${key}=${encodeURIComponent(value as string)}`)
+ .join('&');
+export const hearthPath = (target: PlayTarget): string => {
+ if (target.kind === 'artist') {
+ const { artist } = target;
+ return artist.mbid
+ ? `play?${linkParams([
+ ['artist', artist.mbid],
+ ['name', artist.name],
+ ])}`
+ : `search?q=${encodeURIComponent(artist.name)}`;
+ }
+ if (target.kind === 'album') {
+ const { album } = target;
+ return album.mbid
+ ? `play?${linkParams([
+ ['album', album.mbid],
+ ['by', album.artistName],
+ ['name', album.title],
+ ])}`
+ : `search?q=${encodeURIComponent(searchText(target))}`;
+ }
+ const { track } = target;
+ return track.albumMbid
+ ? `play?${linkParams([
+ ['album', track.albumMbid],
+ ['title', track.title],
+ ['by', track.artistName],
+ ['name', track.albumTitle],
+ ])}`
+ : `play?${linkParams([
+ ['title', track.title],
+ ['by', track.artistName],
+ ])}`;
+};
+// An Android intent: Chrome opens Hearth from a tap, or the fallback page without the app.
+export const hearthLink = (
+ target: PlayTarget,
+ fallback: string | null
+): string =>
+ `intent://${hearthPath(target)}#Intent;scheme=shelf;package=${HEARTH_PACKAGE};${
+ fallback ? `S.browser_fallback_url=${encodeURIComponent(fallback)};` : ''
+ }end`;
+
export const playLink = (
player: MusicPlayer,
target: PlayTarget,
aurralBase: string | null
): string | null => {
if (player === 'plex') return plexLink(target);
- if (player === 'aurral' && aurralBase) return aurralLink(aurralBase, target);
- // Shelf has no links yet: fall back to Aurral, or Plex without Aurral, so
- // Play still works
- return aurralBase ? aurralLink(aurralBase, target) : plexLink(target);
+ if (player === 'hearth')
+ return hearthLink(
+ target,
+ aurralBase ? aurralLink(aurralBase, target) : plexLink(target)
+ );
+ if (aurralBase) return aurralLink(aurralBase, target);
+ // no Aurral address after all: Plex, so Play still works
+ return plexLink(target);
};
// Every Play goes to the same named tab, so music keeps playing there while
@@ -134,6 +210,11 @@ export const PLAYER_WINDOW = 'lumen-music-player';
export function openPlayer(url: string) {
stopPreview();
+ // Hearth: the phone opens the app in place of this page; a tab would stay empty
+ if (url.startsWith('intent://')) {
+ window.location.href = url;
+ return;
+ }
const opened = window.open(url, PLAYER_WINDOW);
if (opened) {
try {
diff --git a/lumen/src/pages/AccountSettings.tsx b/lumen/src/pages/AccountSettings.tsx
index da0c54c..d7e9fb3 100644
--- a/lumen/src/pages/AccountSettings.tsx
+++ b/lumen/src/pages/AccountSettings.tsx
@@ -4,11 +4,12 @@ import { api, ApiError } from '../api';
import { isAdministrator, useAuth } from '../auth';
import AccountThemeOverrides from '../components/AccountThemeOverrides';
import { BookHomeSections } from '../components/BookHomeSections';
-import { Section } from '../components/cards';
+import { FoldSections, openSection, Section } from '../components/cards';
import { CardTitlePreferences } from '../components/CardTitlePreferences';
import { ExternalRequestLists } from '../components/ExternalRequestLists';
import { ServiceNote } from '../components/extra';
import ManagedMaturity from '../components/ManagedMaturity';
+import { usePhone } from '../components/PhoneFilters';
import { RequestRootFolders } from '../components/RequestRootFolders';
import { StreamingSubscriptions } from '../components/StreamingSubscriptions';
import { useApi, usePublicSettings } from '../hooks';
@@ -802,159 +803,160 @@ function Settings({ id, plex }: { id: number; plex: boolean }) {
hash === '#advanced-theme' ||
(loaded &&
(hash === '#password' ||
+ hash === '#import-lists' ||
hash === '#account-permissions' ||
hash === '#maturity-controls'))
) {
- document
- .getElementById(hash.slice(1))
- ?.scrollIntoView({ block: 'start' });
+ openSection(hash.slice(1));
}
}, [hash, loaded]);
return (
<>
-
-
- {accountType && (
+
+
+
+ {accountType && (
+
+
+
+ {t(
+ 'components.UserProfile.UserSettings.UserGeneralSettings.accounttype',
+ 'Account Type'
+ )}
+
+
+
+
+ {t(accountType, accountType, { mediaServerName })}
+
+
+
+ )}
{t(
- 'components.UserProfile.UserSettings.UserGeneralSettings.accounttype',
- 'Account Type'
+ 'components.UserProfile.UserSettings.UserGeneralSettings.role',
+ 'Role'
)}
-
- {t(accountType, accountType, { mediaServerName })}
-
+ {t(roleKey, role)}
- )}
-
-
-
+
+
+ {profile.data ? (
+
+ ) : (
+ !profile.error && (
+
{t(
- 'components.UserProfile.UserSettings.UserGeneralSettings.role',
- 'Role'
+ 'lumen.account.loadingProfileSettings',
+ 'Loading profile settings…'
)}
-
-
-
- {t(roleKey, role)}
-
-
-
-
+ )
)}
- retryLabel={t('lumen.account.retry', 'Retry')}
- retry={profile.reload}
- />
- {profile.data ? (
-
+ {profile.data && (
+
- ) : (
- !profile.error && (
-
- {t(
- 'lumen.account.loadingProfileSettings',
- 'Loading profile settings…'
- )}
-
- )
)}
-
- {profile.data && (
-
- )}
- {user && (
-
- )}
-
-
-
-
)}
- id="password"
- >
-
+
+
+
- {password.data ? (
-
+
- ) : (
- !password.error && (
-
+ {password.data ? (
+
+ ) : (
+ !password.error && (
+
+ {t(
+ 'lumen.account.loadingPasswordSettings',
+ 'Loading password settings…'
+ )}
+
+ )
+ )}
+
+
+ {isAdministrator(mask) ? (
+
{t(
- 'lumen.account.loadingPasswordSettings',
- 'Loading password settings…'
+ 'lumen.account.administratorAccess',
+ 'This account has administrator access.'
)}
- )
- )}
-
-
- {isAdministrator(mask) ? (
-
- {t(
- 'lumen.account.administratorAccess',
- 'This account has administrator access.'
- )}
-
- ) : grants.length ? (
-
- {grants.map(([bit, label, messageKey]) => (
-
- {t(messageKey, label)}
-
- ))}
-
- ) : (
-
- {t(
- 'lumen.account.noAdditionalPermissions',
- 'No additional permissions are assigned to this account.'
- )}
-
- )}
-
+ ) : grants.length ? (
+
+ {grants.map(([bit, label, messageKey]) => (
+
+ {t(messageKey, label)}
+
+ ))}
+
+ ) : (
+
+ {t(
+ 'lumen.account.noAdditionalPermissions',
+ 'No additional permissions are assigned to this account.'
+ )}
+
+ )}
+
+
>
);
}
@@ -965,76 +967,180 @@ export default function AccountSettings() {
const canManageTheme = isAdministrator(user?.permissions);
const canManageUsers =
isAdministrator(user?.permissions) || ((user?.permissions ?? 0) & 8) !== 0;
+ const phone = usePhone();
+ // phones: one scrolling row; the in-page entries open their folded section, the list
+ // imports first because that is what people come for most
+ const jump = (target: string) => (event: { preventDefault: () => void }) => {
+ event.preventDefault();
+ openSection(target);
+ };
+ const permissionsLabel = t(
+ 'components.UserProfile.UserSettings.menuPermissions',
+ 'Permissions'
+ );
+ const maturityLabel = t(
+ 'components.UserProfile.UserSettings.menuMaturityControls',
+ 'Maturity Controls'
+ );
+ const themeLabel = t(
+ 'components.UserProfile.UserSettings.menuAdvancedTheme',
+ 'Advanced Theme'
+ );
+ const pages = [
+ [
+ '/me/account/tv-requests',
+ t('lumen.account.tvRequestSettings', 'TV Request Settings'),
+ ],
+ [
+ '/me/account/linked-accounts',
+ t(
+ 'components.UserProfile.UserSettings.menuLinkedAccounts',
+ 'Linked Accounts'
+ ),
+ ],
+ [
+ '/me/account/client-tokens',
+ t(
+ 'components.UserProfile.UserSettings.menuClientTokens',
+ 'Client Tokens'
+ ),
+ ],
+ [
+ '/me/account/notifications',
+ t(
+ 'components.UserProfile.UserSettings.menuNotifications',
+ 'Notifications'
+ ),
+ ],
+ ['/me', t('lumen.account.backToYou', 'Back to You')],
+ ] as const;
return (
<>
{t('i18n.usersettings', 'User Settings')}
-
- {canManageTheme && (
-
+ {phone ? (
+
+
+ {t('lumen.account.importLists', 'Import lists')}
+
+
{t(
- 'components.UserProfile.UserSettings.menuAdvancedTheme',
- 'Advanced Theme'
+ 'components.UserProfile.UserSettings.menuChangePass',
+ 'Password'
)}
-
- )}
-
- {t(
- 'components.UserProfile.UserSettings.menuPermissions',
- 'Permissions'
+
+
+ {permissionsLabel}
+
+ {canManageUsers && (
+
+ {maturityLabel}
+
+ )}
+ {canManageTheme && (
+
+ {themeLabel}
+
)}
-
- {canManageUsers && (
-
+ {pages.map(([to, label]) => (
+
+ {label}
+
+ ))}
+
+ ) : (
+
+ {canManageTheme && (
+
+ {t(
+ 'components.UserProfile.UserSettings.menuAdvancedTheme',
+ 'Advanced Theme'
+ )}
+
+ )}
+
{t(
- 'components.UserProfile.UserSettings.menuMaturityControls',
- 'Maturity Controls'
+ 'components.UserProfile.UserSettings.menuPermissions',
+ 'Permissions'
)}
- )}
-
- {t('lumen.account.tvRequestSettings', 'TV Request Settings')}
-
-
- {t(
- 'components.UserProfile.UserSettings.menuLinkedAccounts',
- 'Linked Accounts'
- )}
-
-
- {t(
- 'components.UserProfile.UserSettings.menuClientTokens',
- 'Client Tokens'
- )}
-
-
- {t(
- 'components.UserProfile.UserSettings.menuNotifications',
- 'Notifications'
+ {canManageUsers && (
+
+ {t(
+ 'components.UserProfile.UserSettings.menuMaturityControls',
+ 'Maturity Controls'
+ )}
+
)}
-
-
- {t('lumen.account.backToYou', 'Back to You')}
-
-
+
+ {t('lumen.account.tvRequestSettings', 'TV Request Settings')}
+
+
+ {t(
+ 'components.UserProfile.UserSettings.menuLinkedAccounts',
+ 'Linked Accounts'
+ )}
+
+
+ {t(
+ 'components.UserProfile.UserSettings.menuClientTokens',
+ 'Client Tokens'
+ )}
+
+
+ {t(
+ 'components.UserProfile.UserSettings.menuNotifications',
+ 'Notifications'
+ )}
+
+
+ {t('lumen.account.backToYou', 'Back to You')}
+
+
+ )}
{user && (
)}
- {user && canManageUsers && (
-
- )}
- {user && canManageTheme && (
-
- )}
+ {/* phones fold these with the rest of the settings */}
+
+ {user && canManageUsers && (
+
+ )}
+ {user && canManageTheme && (
+
+ )}
+
>
);
}
diff --git a/lumen/src/pages/AdminHome.tsx b/lumen/src/pages/AdminHome.tsx
index e7ec1b6..3cd1f3b 100644
--- a/lumen/src/pages/AdminHome.tsx
+++ b/lumen/src/pages/AdminHome.tsx
@@ -1,6 +1,7 @@
import { useState } from 'react';
import { Link, Navigate, useLocation, useSearchParams } from 'react-router-dom';
import { Section } from '../components/cards';
+import { PhoneSection, PhoneSubsection } from '../components/MoreActions';
import { useLumenLocale } from '../i18n';
import { Icon } from '../icons';
@@ -333,16 +334,60 @@ export function AdminLinks({
);
}
-/** Every settings page once, grouped by what it is for (Administration home and You). */
-export function AdminGroups() {
+// Phones fold the groups; the per-kind service groups share one fold so the page is short.
+const phoneMerges: Partial<
+ Record<(typeof homeGroups)[number][0], (typeof homeGroups)[number][0][]>
+> = { 'tv-movies': ['tv-movies', 'books', 'music', 'software'] };
+const mergedAway = new Set(
+ Object.values(phoneMerges).flatMap((keys) => keys.slice(1))
+);
+
+/** Every settings page once, grouped by what it is for (Administration home and You).
+ * On You (fold), phones keep all of it in one folded box. */
+export function AdminGroups({ fold = false }: { fold?: boolean } = {}) {
const { t } = useLumenLocale();
+ const group = (key: (typeof homeGroups)[number][0]) =>
+ homeGroups.find(([name]) => name === key)!;
+ const sub = (key: (typeof homeGroups)[number][0]) => {
+ const [, label, paths] = group(key);
+ return (
+
+
+
+ );
+ };
+ if (fold)
+ return (
+
+
+ {homeGroups.map(([key]) => sub(key))}
+
+
+ );
return (
- {homeGroups.map(([key, label, paths]) => (
-
- ))}
+ {homeGroups.map(([key, label, paths]) => {
+ if (mergedAway.has(key)) return null;
+ const merged = phoneMerges[key];
+ if (merged)
+ return (
+
+ {merged.map(sub)}
+
+ );
+ return (
+
+
+
+ );
+ })}
);
}
diff --git a/lumen/src/pages/BookDetail.tsx b/lumen/src/pages/BookDetail.tsx
index ce2e6ed..f1c1a85 100644
--- a/lumen/src/pages/BookDetail.tsx
+++ b/lumen/src/pages/BookDetail.tsx
@@ -19,11 +19,13 @@ import {
type EditionList,
type RequestOptions,
} from '../api';
+import { cached } from '../apiCache';
import { isAdministrator, useAuth } from '../auth';
import BlocklistButton from '../components/BlocklistButton';
import BookRequestOptions from '../components/BookRequestOptions';
import BulkBookRequest from '../components/BulkBookRequest';
import { StatLabel, statusOf } from '../components/cards';
+import { ClampText } from '../components/ClampText';
import {
ActionBar,
canManageRequests,
@@ -34,10 +36,16 @@ import {
Pill,
VideoDisclosure,
} from '../components/detail';
+import {
+ foldsEditions,
+ MoreEditions,
+ previewRows,
+} from '../components/EditionPreview';
import { ServiceNote } from '../components/extra';
import FollowButton from '../components/FollowButton';
import IndexerSearchLink from '../components/IndexerSearchLink';
import { ManageMediaAction } from '../components/ManageMediaSheet';
+import { MoreActions } from '../components/MoreActions';
import OpenIssueReports from '../components/OpenIssueReports';
import ReaderDeliveryLink from '../components/ReaderDeliveryLink';
import ReportIssueButton from '../components/ReportIssueButton';
@@ -46,7 +54,7 @@ import { useToast } from '../components/toast';
import WatchlistButton from '../components/WatchlistButton';
import { friendlyError } from '../errors';
import { canViewFollowing } from '../followPermissions';
-import { dropBookStates, useApi } from '../hooks';
+import { cachedApi, dropBookStates, useApi } from '../hooks';
import { useLumenLocale } from '../i18n';
import { Icon } from '../icons';
import { usePrefs } from '../settings';
@@ -274,27 +282,53 @@ export default function BookDetail() {
`/book/${encodeURIComponent(plainId)}${lookup}`,
{ currentPathOnly: true }
);
+ // the same book already saved without the lookup title shows at once while this one loads,
+ // instead of a blank page
+ const firstData =
+ first.data ??
+ (lookup && !first.error
+ ? (cached(`/book/${encodeURIComponent(plainId)}`) ?? null)
+ : null);
const ratings = useApi(
- first.data ? `/book/${encodeURIComponent(plainId)}/ratings${lookup}` : null,
+ firstData ? `/book/${encodeURIComponent(plainId)}/ratings${lookup}` : null,
{ currentPathOnly: true }
);
+ const rating =
+ ratings.data ??
+ (lookup && !ratings.error
+ ? (cached(`/book/${encodeURIComponent(plainId)}/ratings`) ??
+ null)
+ : null);
const bookId = plainId;
// Books stored under a bare Hardcover id can come back without a description while the
// "hc:" form of the same work has one: ask for that form once, and only to fill the blurb.
- const altId =
- first.data && !first.data.description ? hcFormId(plainId) : null;
+ const altId = firstData && !firstData.description ? hcFormId(plainId) : null;
const alt = useApi(
altId ? `/book/${encodeURIComponent(altId)}${lookup}` : null
);
const b = useMemo(
() =>
- first.data && !first.data.description && altId && alt.data?.description
- ? { ...first.data, description: alt.data.description }
- : first.data,
- [first.data, alt.data, altId]
+ firstData && !firstData.description && altId && alt.data?.description
+ ? { ...firstData, description: alt.data.description }
+ : firstData,
+ [firstData, alt.data, altId]
);
const formatHref = (format: 'ebook' | 'audiobook') =>
bookDetailPath(id, format, lookupTitle ?? first.data?.title);
+ // Opened without a lookup title, the other format's link adds the resolved one: a new address
+ // SeerrNG looks up again (seconds on a first lookup). The page keeps showing this answer until
+ // that one is in (firstData above), and pointing at or touching the link asks for it ahead.
+ const nextLookupTitle =
+ !lookupTitle && plainId.startsWith('bookshelf:')
+ ? first.data?.title?.trim()
+ : undefined;
+ const prefetchOtherFormat = () => {
+ if (!nextLookupTitle || nextLookupTitle.length > 512) return;
+ const q = `?${new URLSearchParams({ lookupTitle: nextLookupTitle })}`;
+ void cachedApi(`/book/${encodeURIComponent(plainId)}${q}`)
+ .then(() => cachedApi(`/book/${encodeURIComponent(plainId)}/ratings${q}`))
+ .catch(() => undefined);
+ };
const error = first.error;
const progressMedia = useLiveMediaProgress(
bookMediaForFormat(b?.mediaInfo, f),
@@ -312,19 +346,8 @@ export default function BookDetail() {
() => narrations(eds.data?.editions || []),
[eds.data]
);
- const soloNarrators = new Map();
- if (showNarr && canViewFollowing(user?.permissions)) {
- for (const edition of allRows) {
- const name = edition.narrators?.[0]?.trim();
- if (
- edition.narrators?.length === 1 &&
- name &&
- name.toLowerCase() !== 'full cast'
- )
- soloNarrators.set(name.toLowerCase(), name);
- }
- }
const [pick, setPick] = useState(null);
+ const [allNarrations, setAllNarrations] = useState(false);
const [busy, setBusy] = useState(false);
const [requestOptions, setRequestOptions] = useState<{
format: 'ebook' | 'audiobook';
@@ -362,7 +385,7 @@ export default function BookDetail() {
const [justAsked, setJustAsked] = useState>(new Set());
// what SeerrNG says about the audiobook itself: requested or in the library at all?
const audioStatus = bookMediaForFormat(
- first.data?.mediaInfo,
+ firstData?.mediaInfo,
'audiobook'
)?.status;
const tracked =
@@ -429,6 +452,23 @@ export default function BookDetail() {
? ''
: ((requestable.find((r) => r.selected) || requestable[0])?.key ?? '*'));
const chosenRow = requestable.find((r) => r.key === chosen);
+ // one Follow button: the narrator of the selected recording, else of the copy already here,
+ // else the first solo narrator listed (a full cast or "any narrator" has no one to follow)
+ const soloNarrator = (r?: Edition) => {
+ const name = r?.narrators?.length === 1 ? r.narrators[0]?.trim() : '';
+ return name && name.toLowerCase() !== 'full cast' ? name : '';
+ };
+ const followNarrator =
+ showNarr && canViewFollowing(user?.permissions)
+ ? soloNarrator(chosenRow) ||
+ soloNarrator(ownedRows.find((r) => soloNarrator(r))) ||
+ soloNarrator(rows.find((r) => soloNarrator(r)))
+ : '';
+ const visibleRows = previewRows(
+ rows,
+ allNarrations,
+ (r) => r.key === chosen || stateOf(r) === 'library'
+ );
const longest = Math.max(0, ...rows.map((r) => r.durationSeconds || 0));
const series = b.series?.[0];
const bookSeries = (b.series ?? []).filter(
@@ -708,7 +748,7 @@ export default function BookDetail() {
? `${series.title}${series.position ? ' #' + series.position : ''}`
: '',
b.firstPublishYear,
- ratingLabel(ratings.data, b, t, locale),
+ ratingLabel(rating, b, t, locale),
audio && longest
? t('lumen.bookDetail.listenDuration', '{duration} listen', {
duration: fmtHrs(longest),
@@ -725,6 +765,9 @@ export default function BookDetail() {
replace
to={formatHref('ebook')}
aria-current={!audio ? 'page' : undefined}
+ onPointerEnter={prefetchOtherFormat}
+ onFocus={prefetchOtherFormat}
+ onTouchStart={prefetchOtherFormat}
>
@@ -738,6 +781,9 @@ export default function BookDetail() {
replace
to={formatHref('audiobook')}
aria-current={audio ? 'page' : undefined}
+ onPointerEnter={prefetchOtherFormat}
+ onFocus={prefetchOtherFormat}
+ onTouchStart={prefetchOtherFormat}
>
@@ -787,40 +833,46 @@ export default function BookDetail() {
)}
)}
- {
- dropBookStates();
- first.refresh();
- }}
- />
-
-
-
- {b.authorId && (
-
+ {
+ dropBookStates();
+ first.refresh();
+ }}
/>
- )}
-
+
+
+
+ {b.authorId && (
+
+ )}
+
+
{canViewFollowing(user?.permissions) && b.authorId && b.author && (
{/* phones: the action bar holds only the request, so the owned copy's link goes here */}
{alsoListen && {alsoListen}
}
- {bookSeries.length > 0 && (
-
- {bookSeries.map((entry) => (
-
- ))}
-
- )}
-
- {bookSubjects.length > 0 ? (
-
- {bookSubjects.map((subject) => (
-
- {subject}
-
- ))}
-
- ) : (
-
- {t('lumen.detail.noSubjectTags', 'No subject tags.')}
-
- )}
-
- {canCustomizeRequest && (
-
- )}
- {(bookQuota?.limit ?? 0) > 0 && (
-
- {quotaBlocked
- ? t(
- 'lumen.bookDetail.quotaReached',
- 'Your book request limit has been reached.'
- )
- : t(
- 'lumen.bookDetail.quotaRemaining',
- '{remaining} of {limit} book requests remaining.',
- {
- remaining: bookQuota?.remaining ?? 0,
- limit: bookQuota?.limit ?? 0,
- }
- )}
- {!!bookQuota?.days &&
- ` ${t('lumen.bookDetail.quotaPeriod', 'Quota period: {days} days.', { days: bookQuota.days })}`}
-
- )}
- {quota.error && (
-
- {t(
- 'lumen.bookDetail.quotaLoadFailure',
- 'Could not check the book request limit. Retry before requesting.'
- )}{' '}
-
- {t('lumen.bookDetail.recheckQuota', 'Recheck quota')}
-
-
- )}
- {!quotaReady && (
-
- {t('lumen.bookDetail.quotaLoading', 'Checking book request limit…')}
-
- )}
- {b.description &&
{b.description.trim()}
}
+ {b.description && (
+
+ {b.description.trim()}
+
+ )}
- {rows.map((r) => {
+ {visibleRows.map((r) => {
const st = stateOf(r);
const locked = !!st || !requestable.includes(r);
const on = !locked && chosen === r.key;
@@ -1187,39 +1158,162 @@ export default function BookDetail() {
)}
)}
- {soloNarrators.size > 0 && (
-
- {[...soloNarrators].map(([key, name]) => (
+ {((eds.data && !noChoice && foldsEditions(rows.length)) ||
+ followNarrator) && (
+
+ {eds.data && !noChoice && foldsEditions(rows.length) && (
+ setAllNarrations(!allNarrations)}
+ label={t(
+ 'lumen.bookDetail.allNarrations',
+ 'All {count} narrations',
+ { count: rows.length }
+ )}
+ />
+ )}
+ {followNarrator && (
- ))}
+ )}
)}
- ) : (
+ ) : audio ? (
- {audio
+ {t(
+ 'lumen.bookDetail.bestUnabridgedRecording',
+ 'We’ll grab the best available unabridged recording.'
+ )}
+
+ ) : (
+ // the ebook as one edition card, the way a manga with one edition shows
+
+
+
{t('lumen.bookDetail.edition', 'Edition')}
+
+
+
+
+ {b.posterPath ? (
+
+ ) : (
+
+ )}
+
+
+
+ {t('lumen.bookDetail.ebookEpub', 'Ebook · EPUB')}
+
+ {(b.publisher ||
+ b.firstPublishYear ||
+ (b.numberOfPages ?? 0) > 0) && (
+
+ {[
+ b.publisher,
+ b.firstPublishYear,
+ (b.numberOfPages ?? 0) > 0
+ ? t(
+ 'lumen.bookDetail.pageCount',
+ '{count} pages',
+ { count: b.numberOfPages ?? 0 }
+ )
+ : '',
+ ]
+ .filter(Boolean)
+ .join(' · ')}
+
+ )}
+
+ {t(
+ 'lumen.bookDetail.ebookInAudiobookshelf',
+ 'The ebook arrives as an EPUB in Audiobookshelf, ready to read or send to your Kindle.'
+ )}
+
+
+
+
+
+ )}
+ {/* the folded boxes come after the overview and the edition list */}
+ {bookSeries.length > 0 && (
+
+ {bookSeries.map((entry) => (
+
+ ))}
+
+ )}
+ {canCustomizeRequest && (
+
+ )}
+ {(bookQuota?.limit ?? 0) > 0 && (
+
+ {quotaBlocked
? t(
- 'lumen.bookDetail.bestUnabridgedRecording',
- 'We’ll grab the best available unabridged recording.'
+ 'lumen.bookDetail.quotaReached',
+ 'Your book request limit has been reached.'
)
: t(
- 'lumen.bookDetail.ebookInAudiobookshelf',
- 'The ebook arrives as an EPUB in Audiobookshelf, ready to read or send to your Kindle.'
+ 'lumen.bookDetail.quotaRemaining',
+ '{remaining} of {limit} book requests remaining.',
+ {
+ remaining: bookQuota?.remaining ?? 0,
+ limit: bookQuota?.limit ?? 0,
+ }
)}
+ {!!bookQuota?.days &&
+ ` ${t('lumen.bookDetail.quotaPeriod', 'Quota period: {days} days.', { days: bookQuota.days })}`}
+
+ )}
+ {quota.error && (
+
+ {t(
+ 'lumen.bookDetail.quotaLoadFailure',
+ 'Could not check the book request limit. Retry before requesting.'
+ )}{' '}
+
+ {t('lumen.bookDetail.recheckQuota', 'Recheck quota')}
+
+
+ )}
+ {!quotaReady && (
+
+ {t(
+ 'lumen.bookDetail.quotaLoading',
+ 'Checking book request limit…'
+ )}
)}
@@ -1231,148 +1325,184 @@ export default function BookDetail() {
- {(() => {
- const openLibraryWork =
- ratings.data?.source === 'openlibrary' &&
- /^OL[0-9]+W$/.test(ratings.data.workId ?? '')
- ? ratings.data.workId
- : b.provider === 'openlibrary' && /^OL[0-9]+W$/.test(b.id)
- ? b.id
- : undefined;
- const unavailable = t(
- 'components.BookDetails.Layout.notAvailable',
- 'Not Available'
- );
- const number = (value?: number) =>
- typeof value === 'number' && value > 0
- ? new Intl.NumberFormat(locale).format(value)
- : unavailable;
+
+ {(() => {
+ const openLibraryWork =
+ rating?.source === 'openlibrary' &&
+ /^OL[0-9]+W$/.test(rating.workId ?? '')
+ ? rating.workId
+ : b.provider === 'openlibrary' && /^OL[0-9]+W$/.test(b.id)
+ ? b.id
+ : undefined;
+ const unavailable = t(
+ 'components.BookDetails.Layout.notAvailable',
+ 'Not Available'
+ );
+ const number = (value?: number) =>
+ typeof value === 'number' && value > 0
+ ? new Intl.NumberFormat(locale).format(value)
+ : unavailable;
- return (
-
- {series.title}
- {series.position ? ` #${series.position}` : ''}
-
- ) : series?.title ? (
- `${series.title}${series.position ? ' #' + series.position : ''}`
- ) : (
- ''
- ),
- ],
- [
- t('components.BookDetails.Layout.author', 'Author'),
- b.author ? (
- b.authorId ? (
+ return (
+
- {b.author}
+ {series.title}
+ {series.position ? ` #${series.position}` : ''}
+ ) : series?.title ? (
+ `${series.title}${series.position ? ' #' + series.position : ''}`
) : (
- b.author
- )
- ) : (
- unavailable
- ),
- ],
- [
- t(
- 'components.BookDetails.Layout.firstPublished',
- 'First Published'
- ),
- b.firstPublishYear ?? unavailable,
- ],
- [
- t(
- 'components.BookDetails.Layout.publisher',
- 'Publisher'
- ),
- b.publisher || unavailable,
- ],
- [
- t('components.BookDetails.Layout.pages', 'Pages'),
- audio ? unavailable : number(b.numberOfPages),
- ],
- [
- t('components.BookDetails.Layout.editions', 'Editions'),
- number(b.editionCount),
- ],
- [
- t('components.BookDetails.Layout.isbn', 'ISBN'),
- b.isbn13 || unavailable,
- ],
- [
- t('components.BookDetails.Layout.edition', 'Edition'),
- b.editionId || unavailable,
- ],
- [
- t(
- 'components.BookDetails.Layout.openLibrary',
- 'Open Library'
- ),
- openLibraryWork ? (
-
- {openLibraryWork}
-
- ) : (
- unavailable
- ),
- ],
- [
- t('lumen.bookDetail.listeningTime', 'Listening time'),
- audio
- ? longest
- ? fmtHrs(longest)
- : unavailable
- : unavailable,
- ],
- [
- t('lumen.bookDetail.subjects', 'Subjects'),
- (b.subjects || [])
- .filter((t) => !FORMAT_TAG.test(t))
- .slice(0, 4)
- .join(', ') || unavailable,
- ],
- [
- t(
- 'components.BookDetails.Layout.isbnCandidates',
- 'ISBN Candidates'
- ),
- b.isbnCandidates?.length
- ? b.isbnCandidates.slice(0, 4).map((candidate) => (
-
- {candidate.isbn}
-
- ))
- : unavailable,
- ],
- ]}
- />
- );
- })()}
+ {b.author}
+
+ ) : (
+ b.author
+ )
+ ) : (
+ unavailable
+ ),
+ ],
+ [
+ t(
+ 'components.BookDetails.Layout.firstPublished',
+ 'First Published'
+ ),
+ b.firstPublishYear ?? unavailable,
+ ],
+ [
+ t(
+ 'components.BookDetails.Layout.publisher',
+ 'Publisher'
+ ),
+ b.publisher || unavailable,
+ ],
+ [
+ t('components.BookDetails.Layout.pages', 'Pages'),
+ audio ? unavailable : number(b.numberOfPages),
+ ],
+ [
+ t(
+ 'components.BookDetails.Layout.editions',
+ 'Editions'
+ ),
+ number(b.editionCount),
+ ],
+ [
+ t('components.BookDetails.Layout.isbn', 'ISBN'),
+ b.isbn13 || unavailable,
+ ],
+ [
+ t('components.BookDetails.Layout.edition', 'Edition'),
+ b.editionId || unavailable,
+ ],
+ [
+ t(
+ 'components.BookDetails.Layout.openLibrary',
+ 'Open Library'
+ ),
+ openLibraryWork ? (
+
+ {openLibraryWork}
+
+ ) : (
+ unavailable
+ ),
+ ],
+ [
+ t('lumen.bookDetail.listeningTime', 'Listening time'),
+ audio
+ ? longest
+ ? fmtHrs(longest)
+ : unavailable
+ : unavailable,
+ ],
+ [
+ t('lumen.bookDetail.subjects', 'Subjects'),
+ (b.subjects || [])
+ .filter((t) => !FORMAT_TAG.test(t))
+ .slice(0, 4)
+ .join(', ') || unavailable,
+ ],
+ [
+ t(
+ 'components.BookDetails.Layout.isbnCandidates',
+ 'ISBN Candidates'
+ ),
+ b.isbnCandidates?.length
+ ? b.isbnCandidates.slice(0, 4).map((candidate) => (
+
+ {candidate.isbn}
+
+ ))
+ : unavailable,
+ ],
+ ]}
+ />
+ );
+ })()}
+
+
+ {bookSubjects.length > 0 ? (
+
+ {bookSubjects.map((subject) => (
+
+ {subject}
+
+ ))}
+
+ ) : (
+
+ {t('lumen.detail.noSubjectTags', 'No subject tags.')}
+
+ )}
+
diff --git a/lumen/src/pages/BookGrouping.tsx b/lumen/src/pages/BookGrouping.tsx
index 8651aaf..b86e854 100644
--- a/lumen/src/pages/BookGrouping.tsx
+++ b/lumen/src/pages/BookGrouping.tsx
@@ -8,6 +8,7 @@ import {
} from '../api';
import BulkBookRequest from '../components/BulkBookRequest';
import { BookCard, GridSkeleton, Section } from '../components/cards';
+import { ClampText } from '../components/ClampText';
import { DetailTop } from '../components/detail';
import { ServiceNote } from '../components/extra';
import ReaderShelf from '../components/ReaderShelf';
@@ -137,7 +138,7 @@ function AuthorDetail({ id }: { id: string }) {
target={{ type: 'author', id: data.id, name: data.name }}
/>
- {data.biography && {data.biography}
}
+ {data.biography && {data.biography} }
)}
- {data.description &&
{data.description}
}
+ {data.description &&
{data.description} }
{books.length > 0 ? (
) : (
diff --git a/lumen/src/pages/BookSeriesSearch.tsx b/lumen/src/pages/BookSeriesSearch.tsx
index 2fa264d..c6d0b16 100644
--- a/lumen/src/pages/BookSeriesSearch.tsx
+++ b/lumen/src/pages/BookSeriesSearch.tsx
@@ -1,4 +1,5 @@
import { Link, useSearchParams } from 'react-router-dom';
+import { Section } from '../components/cards';
import { ExtraHeader, ServiceNote } from '../components/extra';
import { useApi } from '../hooks';
import { useLumenLocale } from '../i18n';
@@ -95,10 +96,14 @@ export function BookSeriesResults({
query,
format,
limit,
+ section,
}: {
query: string;
format?: string;
limit?: number;
+ // inside Search and Books: a titled section only when there are series; with none, at most
+ // one quiet line that some services could not be searched
+ section?: { title: string; link: [string, string] };
}) {
const { t } = useLumenLocale();
const path =
@@ -117,6 +122,68 @@ export function BookSeriesResults({
const results = Array.isArray(search.data?.results)
? search.data.results
: undefined;
+ if (section) {
+ const shown = (results ?? []).flatMap((result) =>
+ result.variants?.length ? result.variants : [result]
+ );
+ const incomplete =
+ !!search.error ||
+ (!!search.data && !results) ||
+ search.data?.status === 'partial' ||
+ search.data?.status === 'unavailable';
+ if (!shown.length)
+ return incomplete ? (
+
+ {t(
+ 'lumen.bookSeries.partial',
+ 'Some book services could not be searched.'
+ )}
+
+ ) : null;
+ return (
+
+
+ {shown.slice(0, limit ?? Infinity).map((result) => {
+ const href = resultLink(result);
+ return (
+
+
+
{result.title}
+
+ {result.serverName} · {result.format} ·{' '}
+ {result.source === 'library'
+ ? t('lumen.bookSeries.library', 'Library')
+ : t('lumen.bookSeries.catalog', 'Catalog')}
+
+
+ {href && (
+
+ {t('lumen.bookSeries.open', 'Open')}
+
+ )}
+
+ );
+ })}
+
+ {incomplete && (
+
+ {t(
+ 'lumen.bookSeries.partial',
+ 'Some book services could not be searched.'
+ )}
+
+ )}
+
+ );
+ }
return (
<>
-
+
{canUseRequestAccess(user?.permissions) && (
<>
@@ -309,9 +314,9 @@ function LibrarySeg({
}
// the Sort menu; the landing has no sort of its own, so it shows a prompt instead
-function SortMenu({ sort, pick }: { sort: string; pick: (v: string) => void }) {
+function useBookSortLabels(): Record
{
const { t } = useLumenLocale();
- const sortLabels: Record = {
+ return {
ranked: t('lumen.books.sort.popular', 'Popular'),
trending: t('lumen.books.sort.trending', 'Trending'),
newest: t('lumen.books.sort.newest', 'Newest'),
@@ -323,6 +328,11 @@ function SortMenu({ sort, pick }: { sort: string; pick: (v: string) => void }) {
'editions.asc': t('lumen.books.sort.fewestEditions', 'Fewest Editions'),
random: t('lumen.books.sort.random', 'Random'),
};
+}
+
+function SortMenu({ sort, pick }: { sort: string; pick: (v: string) => void }) {
+ const { t } = useLumenLocale();
+ const sortLabels = useBookSortLabels();
return (
{/* nothing picked yet (the landing): the menu itself says "Sort by…" */}
@@ -386,6 +396,7 @@ function BooksLanding({
const [p, setP] = useSearchParams();
const base = format === 'ebook' ? '/books' : '/audiobooks';
const feed = `/discover/books?format=${format}`;
+ const phone = usePhone();
// pushed entries, so Back from the list (In library, Not yet, a sort or a genre) returns
// to the rows; a genre keeps the genre picker open on the list, for picking more
const open = (key: string, v: string) => {
@@ -398,11 +409,21 @@ function BooksLanding({
<>
{note}
-
- open('show', v)} />
- open('sort', v)} />
- open('genre', v.join(','))} />
-
+ {phone ? (
+ open('show', v)} />}
+ chips={[]}
+ >
+ open('sort', v)} />
+ open('genre', v.join(','))} />
+
+ ) : (
+
+ open('show', v)} />
+ open('sort', v)} />
+ open('genre', v.join(','))} />
+
+ )}
{/* the same first page the owned list reads, so it is asked for once */}
{
+ event.preventDefault();
+ const form = new FormData(event.currentTarget);
+ const next = new URLSearchParams(p);
+ for (const { key } of searchFields) {
+ const value = String(form.get(key) ?? '').trim();
+ if (value) next.set(key, value);
+ else next.delete(key);
+ }
+ keepList(next);
+ }}
+ >
+ {searchFields.map(({ key, apiKey, label, pattern, maxLength, hint }) => (
+
+ {label}
+
+
+ ))}
+
+ {t('lumen.books.searchBooksButton', 'Search Books')}
+
+ {filters.size > 0 && (
+ {
+ const next = new URLSearchParams(p);
+ for (const { key } of searchFields) next.delete(key);
+ keepList(next);
+ }}
+ >
+ {t('lumen.books.clearBookSearch', 'Clear Book Search')}
+
+ )}
+
+ );
+ const bookChips: AppliedFilter[] = [];
+ if (phone) {
+ if (subject)
+ bookChips.push({
+ key: 'subject',
+ label: subject,
+ aria: t('lumen.books.clearSubject', 'Clear Subject'),
+ remove: () => setGenres([]),
+ });
+ for (const genre of genres)
+ bookChips.push({
+ key: `genre:${genre}`,
+ label: t(
+ `lumen.books.genre.${genre.replace(/\s+/g, '-')}`,
+ genreLabel(genre)
+ ),
+ remove: () => setGenres(genres.filter((value) => value !== genre)),
+ });
+ if (filters.size)
+ bookChips.push({
+ key: 'search',
+ label: t('lumen.books.discoverySearch', 'Book Discovery Search'),
+ aria: t('lumen.books.clearBookSearch', 'Clear Book Search'),
+ remove: () => {
+ const next = new URLSearchParams(p);
+ for (const { key } of searchFields) next.delete(key);
+ keepList(next);
+ },
+ });
+ }
+
return (
@@ -693,86 +795,68 @@ function BooksGrid({
{note}
{search.length >= 2 && search.length <= 200 && (
-
- )}
- {show !== 'have' && (
-
+
+ ) : (
+ <>
+ {bookSearch}
+
+ {subject && (
+ setGenres([])}
+ >
+ {t('lumen.books.clearSubject', 'Clear Subject')}
+
+ )}
+
+ {show !== 'have' && }
+ {show !== 'have' && (
+
+ )}
+
+ >
)}
-
- {subject && (
- setGenres([])}>
- {t('lumen.books.clearSubject', 'Clear Subject')}
-
- )}
-
- {show !== 'have' && }
- {show !== 'have' && (
-
- )}
-
{list.error && !items.length && (
{t('lumen.books.loadError', 'Couldn’t load books')}
diff --git a/lumen/src/pages/Browse.tsx b/lumen/src/pages/Browse.tsx
index f342905..5c2d8d6 100644
--- a/lumen/src/pages/Browse.tsx
+++ b/lumen/src/pages/Browse.tsx
@@ -7,6 +7,11 @@ import { ServiceNote } from '../components/extra';
import FollowButton from '../components/FollowButton';
import { GenrePicker } from '../components/GenrePicker';
import GenreTiles from '../components/GenreTiles';
+import {
+ PhoneFilterBar,
+ usePhone,
+ type AppliedFilter,
+} from '../components/PhoneFilters';
import { useAsksRequestOptions } from '../components/requestSheet';
import { Avatar } from '../components/Shell';
import { StreamingDiscoveryFilter } from '../components/StreamingDiscoveryFilter';
@@ -273,6 +278,43 @@ const BROWSE_FILTER_PARAMS = [
'certificationMode',
] as const;
+// modifiers and the availability switch, which the phone Filters count leaves out
+const FILTER_COUNT_SKIP = new Set
([
+ 'show',
+ 'sort',
+ 'match',
+ 'excludeGenre',
+ 'excludeKeywords',
+ 'excludeStatus',
+ 'excludeStudio',
+ 'watchRegion',
+ 'watchProviderMode',
+ 'certificationCountry',
+ 'certificationMode',
+]);
+
+// the More Filters panel's own params (subject tags and streaming services get their own chips)
+const MORE_FILTER_PARAMS = [
+ 'search',
+ 'certification',
+ 'certificationGte',
+ 'certificationLte',
+ 'certificationCountry',
+ 'certificationMode',
+ 'language',
+ 'country',
+ 'voteAverageGte',
+ 'voteAverageLte',
+ 'withRuntimeGte',
+ 'withRuntimeLte',
+ 'voteCountGte',
+ 'voteCountLte',
+ 'primaryReleaseDateGte',
+ 'primaryReleaseDateLte',
+ 'firstAirDateGte',
+ 'firstAirDateLte',
+];
+
const SERIES_STATUSES = [
'Returning Series',
'Planned',
@@ -462,6 +504,7 @@ export default function Browse({ kind }: { kind: 'movie' | 'tv' }) {
const [showStudios, setShowStudios] = useState(false);
const [showTags, setShowTags] = useState(false);
const [showProviders, setShowProviders] = useState(false);
+ const phone = usePhone();
const providerParam = p.get('watchProviders') ?? '';
const providers = /^\d{1,10}(?:[|,]\d{1,10}){0,49}$/.test(providerParam)
? [...new Set(providerParam.split(/[|,]/))]
@@ -744,6 +787,127 @@ export default function Browse({ kind }: { kind: 'movie' | 'tv' }) {
setP(n, { replace: true });
};
const hasFilters = BROWSE_FILTER_PARAMS.some((param) => p.has(param));
+ // the phone Filters button counts each filter in use once (a range or a mode flag
+ // belongs to the filter it changes; the availability switch stays on the page)
+ const activeFilters = new Set(
+ BROWSE_FILTER_PARAMS.filter(
+ (param) => p.has(param) && !FILTER_COUNT_SKIP.has(param)
+ ).map((param) => param.replace(/(Gte|Lte)$/, ''))
+ ).size;
+ // phones: one removable chip per filter in use, so what sits in the sheet stays visible
+ const withoutParams = (...names: string[]) => {
+ const next = new URLSearchParams(p);
+ for (const name of names) next.delete(name);
+ setP(next, { replace: true });
+ };
+ const removeLabel = (name: string) =>
+ t('lumen.browse.removeFilter', 'Remove {name}', { name });
+ const applied: AppliedFilter[] = [];
+ if (phone) {
+ if (wants4k)
+ applied.push({
+ key: 'quality',
+ label: t('lumen.browse.4k', '4K'),
+ aria: removeLabel(t('lumen.browse.4k', '4K')),
+ remove: () => withoutParams('quality'),
+ });
+ for (const id of picked) {
+ const name = genres.find((g) => String(g.id) === id)?.name ?? `#${id}`;
+ const label = excludeGenre
+ ? t('lumen.browse.notFilter', 'Not {name}', { name })
+ : name;
+ applied.push({
+ key: `genre:${id}`,
+ label,
+ aria: removeLabel(label),
+ remove: () => {
+ const rest = picked.filter((value) => value !== id);
+ const next = new URLSearchParams(p);
+ if (rest.length) next.set('genre', rest.join(','));
+ else {
+ next.delete('genre');
+ next.delete('match');
+ next.delete('excludeGenre');
+ }
+ setP(next, { replace: true });
+ },
+ });
+ }
+ if (network)
+ applied.push({
+ key: 'network',
+ label: networkLabel,
+ aria: t('lumen.browse.clearNetwork', 'Clear Network {name}', {
+ name: networkLabel,
+ }),
+ remove: () => withoutParams('network'),
+ });
+ if (studio) {
+ const label = excludeStudio
+ ? t('lumen.browse.notFilter', 'Not {name}', { name: studioLabel })
+ : studioLabel;
+ applied.push({
+ key: 'studio',
+ label,
+ aria: t('lumen.browse.clearStudio', 'Clear Studio {name}', {
+ name: studioLabel,
+ }),
+ remove: () => withoutParams('studio', 'excludeStudio'),
+ });
+ }
+ if (status) {
+ const name = t(
+ `lumen.browse.seriesStatusOption.${status}`,
+ SERIES_STATUSES[Number(status)]
+ );
+ const label = excludeStatus
+ ? t('lumen.browse.notFilter', 'Not {name}', { name })
+ : name;
+ applied.push({
+ key: 'status',
+ label,
+ aria: removeLabel(label),
+ remove: () => withoutParams('status', 'excludeStatus'),
+ });
+ }
+ if (keywords || excludeKeywords) {
+ const label = t('lumen.browse.subjectTags', 'Subject Tags');
+ applied.push({
+ key: 'keywords',
+ label,
+ aria: t('lumen.browse.clearSubjectTags', 'Clear Subject Tags'),
+ remove: () => withoutParams('keywords', 'excludeKeywords'),
+ });
+ }
+ if (providers.length) {
+ const label = `${t('lumen.browse.streamingServices', 'Streaming Services')} (${providers.length})`;
+ applied.push({
+ key: 'providers',
+ label,
+ aria: removeLabel(label),
+ remove: () =>
+ withoutParams('watchProviders', 'watchRegion', 'watchProviderMode'),
+ });
+ }
+ const moreInUse = MORE_FILTER_PARAMS.filter((param) => p.has(param));
+ const moreCount = new Set(
+ moreInUse
+ .filter((param) => !FILTER_COUNT_SKIP.has(param))
+ .map((param) => param.replace(/(Gte|Lte)$/, ''))
+ ).size;
+ if (moreCount) {
+ const label = `${t('lumen.browse.moreFilters', 'More Filters')} (${moreCount})`;
+ applied.push({
+ key: 'more',
+ label,
+ aria: removeLabel(label),
+ remove: () => {
+ setFilterReset((value) => value + 1);
+ withoutParams(...moreInUse);
+ },
+ });
+ }
+ }
const clearFilters = () => {
const next = new URLSearchParams(p);
for (const param of BROWSE_FILTER_PARAMS) next.delete(param);
@@ -837,566 +1001,614 @@ export default function Browse({ kind }: { kind: 'movie' | 'tv' }) {
? (studioInfo.data?.name ?? defaultStudio?.name ?? studioLabel)
: (networkInfo.data?.name ?? defaultNetwork?.name ?? networkLabel);
- return (
+ const availabilitySwitch = (
+
+ {[
+ ['all', t('lumen.browse.all', 'All')],
+ [
+ 'have',
+ t('lumen.browse.onServer', 'On {server}', {
+ server: serverName(),
+ }),
+ ],
+ [
+ 'not',
+ t('lumen.browse.notOnServer', 'Not on {server}', {
+ server: serverName(),
+ }),
+ ],
+ ].map(([v, t]) => (
+ upd('show', v)}
+ >
+ {t}
+
+ ))}
+
+ );
+ const followButtons = (
<>
-
-
- {subtitle}
-
-
- {searchHint}
-
-
- {companyLogo && (
-
-
-
+ {canViewFollowing(user?.permissions) && (
+ <>
+ {followedGenre && (
+
+ )}
+ {followedStudio && (
+
+ )}
+ {followedNetwork && (
+
+ )}
+ >
)}
-
- {canViewFollowing(user?.permissions) && (
- <>
- {followedGenre && (
-
- )}
- {followedStudio && (
-
+ >
+ );
+ const sortControls = (
+ <>
+ {qualityEnabled && (show === 'have' || show === 'not') && (
+
+
+ {t('lumen.browse.availabilityQuality', 'Availability Quality')}
+
+
+ value={quality}
+ onChange={(event) =>
+ upd('quality', event.target.value === '4k' ? '4k' : '')
+ }
+ >
+ {t('lumen.browse.hd', 'HD')}
+ {t('lumen.browse.4k', '4K')}
+
+
+ )}
+
+ {t('lumen.browse.sort', 'Sort')}
+ upd('sort', e.target.value)}>
+ {SORTS[kind].map(([v, label]) => (
+
+ {libraryFirst && v === 'popularity.desc'
+ ? t('lumen.browse.libraryOrder', 'Library Order')
+ : t(`lumen.browse.sortOption.${sortOptionMessages[v]}`, label)}
+
+ ))}
+
+
+
({ value: String(g.id), label: g.name }))}
+ picked={picked}
+ onChange={(next) => {
+ const n = new URLSearchParams(p);
+ if (next.length) n.set('genre', next.join(','));
+ else n.delete('genre');
+ // All genres starts over: the match switch goes back to any
+ if (!next.length) {
+ n.delete('match');
+ n.delete('excludeGenre');
+ }
+ setP(n, { replace: true });
+ }}
+ match={{ all: matchAll, set: setMatch }}
+ exclusion={{
+ active: excludeGenre,
+ toggle: () => upd('excludeGenre', excludeGenre ? '' : 'true'),
+ }}
+ />
+ {kind === 'tv' && (
+
+ {t('lumen.browse.network', 'Network')}
+ upd('network', event.target.value)}
+ >
+
+ {t('lumen.browse.anyNetwork', 'Any Network')}
+
+ {network && !knownNetwork && (
+ {networkLabel}
)}
- >
- )}
- (
+
+ {name}
+
+ ))}
+
+
+ )}
+ >
+ );
+ const activeChips = (
+ <>
+ {network && (
+ upd('network', '')}
>
- {[
- ['all', t('lumen.browse.all', 'All')],
- [
- 'have',
- t('lumen.browse.onServer', 'On {server}', {
- server: serverName(),
- }),
- ],
- [
- 'not',
- t('lumen.browse.notOnServer', 'Not on {server}', {
- server: serverName(),
- }),
- ],
- ].map(([v, t]) => (
- upd('show', v)}
- >
- {t}
-
- ))}
-
- {qualityEnabled && (show === 'have' || show === 'not') && (
+ {t('lumen.browse.clearNetwork', 'Clear Network {name}', {
+ name: networkLabel,
+ })}
+
+ )}
+ {studio && (
+ {
+ const next = new URLSearchParams(p);
+ next.delete('studio');
+ next.delete('excludeStudio');
+ setP(next, { replace: true });
+ }}
+ >
+ {t('lumen.browse.clearStudio', 'Clear Studio {name}', {
+ name: studioLabel,
+ })}
+
+ )}
+ {studio && (
+ upd('excludeStudio', excludeStudio ? '' : 'true')}
+ >
+ {t('lumen.browse.excludeStudio', 'Exclude Studio')}
+
+ )}
+ {(keywords || excludeKeywords) && (
+ {
+ const next = new URLSearchParams(p);
+ next.delete('keywords');
+ next.delete('excludeKeywords');
+ setP(next, { replace: true });
+ }}
+ >
+ {t('lumen.browse.clearSubjectTags', 'Clear Subject Tags')}
+
+ )}
+ >
+ );
+ const statusControls = (
+ <>
+ {kind === 'tv' && (
+ <>
- {t('lumen.browse.availabilityQuality', 'Availability Quality')}
+ {t('lumen.browse.seriesStatus', 'Series Status')}
- upd('quality', event.target.value === '4k' ? '4k' : '')
- }
+ aria-label={t('lumen.browse.seriesStatus', 'Series Status')}
+ value={status}
+ onChange={(event) => {
+ const next = new URLSearchParams(p);
+ if (event.target.value) next.set('status', event.target.value);
+ else {
+ next.delete('status');
+ next.delete('excludeStatus');
+ }
+ setP(next, { replace: true });
+ }}
>
- {t('lumen.browse.hd', 'HD')}
- {t('lumen.browse.4k', '4K')}
+
+ {t('lumen.browse.anyStatus', 'Any Status')}
+
+ {SERIES_STATUSES.map((label, index) => (
+
+ {t(`lumen.browse.seriesStatusOption.${index}`, label)}
+
+ ))}
- )}
-
- {t('lumen.browse.sort', 'Sort')}
- upd('sort', e.target.value)}>
- {SORTS[kind].map(([v, label]) => (
-
- {libraryFirst && v === 'popularity.desc'
- ? t('lumen.browse.libraryOrder', 'Library Order')
- : t(
- `lumen.browse.sortOption.${sortOptionMessages[v]}`,
- label
- )}
-
- ))}
-
-
- ({ value: String(g.id), label: g.name }))}
- picked={picked}
- onChange={(next) => {
- const n = new URLSearchParams(p);
- if (next.length) n.set('genre', next.join(','));
- else n.delete('genre');
- // All genres starts over: the match switch goes back to any
- if (!next.length) {
- n.delete('match');
- n.delete('excludeGenre');
- }
- setP(n, { replace: true });
+ upd('excludeStatus', excludeStatus ? '' : 'true')}
+ >
+ {t('lumen.browse.excludeStatus', 'Exclude Status')}
+
+ >
+ )}
+ >
+ );
+ const clearButton = (
+ {
+ if (hasFilters) clearFilters();
+ }}
+ >
+ {t('lumen.browse.clearFilters', 'Clear Discovery Filters')}
+
+ );
+ const morePanel = (
+
+ {t('lumen.browse.moreFilters', 'More Filters')}
+
+
upd('excludeGenre', excludeGenre ? '' : 'true'),
+ invalidSavedDate={invalidSavedDate}
+ apply={(values) => {
+ const next = new URLSearchParams(p);
+ const put = (key: string, value: string) => {
+ if (value) next.set(key, value);
+ else next.delete(key);
+ };
+ put('search', values.search);
+ put(startKey, values.dates[0]);
+ put(endKey, values.dates[1]);
+ put('voteAverageGte', values.rating[0]);
+ put('voteAverageLte', values.rating[1]);
+ put('withRuntimeGte', values.runtime[0]);
+ put('withRuntimeLte', values.runtime[1]);
+ put('voteCountGte', values.votes[0]);
+ put('voteCountLte', values.votes[1]);
+ setP(next, { replace: true });
}}
- />
- {kind === 'tv' && (
-
- {t('lumen.browse.network', 'Network')}
+ >
+
+
+ {t('lumen.browse.contentRating', 'Content Rating')}
+
upd('network', event.target.value)}
+ className="cfg-select"
+ value={certificationRange ? 'range' : certification}
+ onChange={(event) => {
+ const next = new URLSearchParams(p);
+ for (const key of [
+ 'certification',
+ 'certificationGte',
+ 'certificationLte',
+ 'certificationCountry',
+ 'certificationMode',
+ ])
+ next.delete(key);
+ if (event.target.value) {
+ next.set('certification', event.target.value);
+ next.set('certificationCountry', 'US');
+ }
+ setP(next, { replace: true });
+ }}
>
- {t('lumen.browse.anyNetwork', 'Any Network')}
+ {t('lumen.browse.anyRating', 'Any Rating')}
- {network && !knownNetwork && (
- {networkLabel}
+ {certificationRange && (
+
+ {t('lumen.browse.ratingRange', '{low} to {high}', {
+ low:
+ certificationFilters.certificationGte ||
+ t('lumen.browse.any', 'Any'),
+ high:
+ certificationFilters.certificationLte ||
+ t('lumen.browse.any', 'Any'),
+ })}
+
)}
- {NETWORK_OPTIONS.map(({ id, name }) => (
-
- {name}
+ {certification &&
+ (!ratingOptions.includes(certification) ||
+ (certificationCountry && certificationCountry !== 'US')) && (
+
+ {certification}
+ {certificationCountry
+ ? ' (' + certificationCountry + ')'
+ : ''}
+
+ )}
+ {ratingOptions
+ .filter(
+ (value) =>
+ value !== certification ||
+ !certificationCountry ||
+ certificationCountry === 'US'
+ )
+ .map((value) => (
+
+ {value}
+
+ ))}
+
+
+
+
+ {t('lumen.browse.originalLanguage', 'Original Language')}
+
+ {
+ const next = new URLSearchParams(p);
+ if (event.target.value)
+ next.set('language', event.target.value);
+ else next.delete('language');
+ setP(next, { replace: true });
+ }}
+ >
+
+ {t('lumen.browse.useSavedDefault', 'Use Saved Default')}
+
+
+ {t('lumen.browse.allLanguages', 'All Languages')}
+
+ {language &&
+ language !== 'all' &&
+ !languageOptions.some(
+ (option) => option.iso_639_1 === language
+ ) && {language} }
+ {languageOptions.map(({ iso_639_1, english_name }) => (
+
+ {displayName(languageNames, iso_639_1, english_name)}
))}
- )}
- {network && (
-
+
+ {t('lumen.browse.countryOfOrigin', 'Country of Origin')}
+
+ upd('country', event.target.value)}
+ >
+
+ {t('lumen.browse.anyCountry', 'Any Country')}
+
+ {country &&
+ !countryOptions.some(
+ ({ iso_3166_1 }) => iso_3166_1 === country
+ ) && {country} }
+ {countryOptions.map(({ iso_3166_1, english_name }) => (
+
+ {displayName(countryNames, iso_3166_1, english_name)}
+
+ ))}
+
+
+
+
+ upd('network', '')}
+ to={kind === 'movie' ? '/movies/genres' : '/series/genres'}
>
- {t('lumen.browse.clearNetwork', 'Clear Network {name}', {
- name: networkLabel,
- })}
-
- )}
- {studio && (
+ {t('lumen.browse.browseGenres', 'Browse Genres')}
+
+ {kind === 'movie' && (
+ setShowStudios(!showStudios)}
+ >
+ {t('lumen.browse.productionStudios', 'Production Studios')}
+
+ )}
{
- const next = new URLSearchParams(p);
- next.delete('studio');
- next.delete('excludeStudio');
- setP(next, { replace: true });
- }}
+ className="chip"
+ aria-expanded={showProviders}
+ onClick={() => setShowProviders(!showProviders)}
>
- {t('lumen.browse.clearStudio', 'Clear Studio {name}', {
- name: studioLabel,
- })}
+ {t('lumen.browse.streamingServices', 'Streaming Services')}
+ {providers.length ? ` (${providers.length})` : ''}
- )}
- {studio && (
upd('excludeStudio', excludeStudio ? '' : 'true')}
+ aria-expanded={showTags}
+ onClick={() => setShowTags(!showTags)}
>
- {t('lumen.browse.excludeStudio', 'Exclude Studio')}
+ {t('lumen.browse.subjectTags', 'Subject Tags')}
+
+ {showProviders && regionPending && (
+
+ {t(
+ 'lumen.browse.loadingStreamingRegion',
+ 'Loading streaming region…'
+ )}
+
)}
- {(keywords || excludeKeywords) && (
-
{
+ {showProviders && !regionPending && (
+ {
const next = new URLSearchParams(p);
- next.delete('keywords');
- next.delete('excludeKeywords');
+ next.delete('watchProviders');
+ next.delete('watchRegion');
+ next.delete('watchProviderMode');
+ if (ids.length) {
+ next.set('watchProviders', ids.join('|'));
+ next.set('watchRegion', nextRegion);
+ next.set('watchProviderMode', exclude ? 'exclude' : 'include');
+ }
setP(next, { replace: true });
}}
- >
- {t('lumen.browse.clearSubjectTags', 'Clear Subject Tags')}
-
- )}
- {kind === 'tv' && (
- <>
-
-
- {t('lumen.browse.seriesStatus', 'Series Status')}
-
- {
- const next = new URLSearchParams(p);
- if (event.target.value)
- next.set('status', event.target.value);
- else {
- next.delete('status');
- next.delete('excludeStatus');
- }
- setP(next, { replace: true });
- }}
- >
-
- {t('lumen.browse.anyStatus', 'Any Status')}
-
- {SERIES_STATUSES.map((label, index) => (
-
- {t(`lumen.browse.seriesStatusOption.${index}`, label)}
-
- ))}
-
-
-
upd('excludeStatus', excludeStatus ? '' : 'true')}
- >
- {t('lumen.browse.excludeStatus', 'Exclude Status')}
-
- >
+ />
)}
-
{
- if (hasFilters) clearFilters();
- }}
- >
- {t('lumen.browse.clearFilters', 'Clear Discovery Filters')}
-
-
-
- {t('lumen.browse.moreFilters', 'More Filters')}
-
-
{
+ {showTags && (
+ {
const next = new URLSearchParams(p);
- const put = (key: string, value: string) => {
- if (value) next.set(key, value);
- else next.delete(key);
- };
- put('search', values.search);
- put(startKey, values.dates[0]);
- put(endKey, values.dates[1]);
- put('voteAverageGte', values.rating[0]);
- put('voteAverageLte', values.rating[1]);
- put('withRuntimeGte', values.runtime[0]);
- put('withRuntimeLte', values.runtime[1]);
- put('voteCountGte', values.votes[0]);
- put('voteCountLte', values.votes[1]);
+ if (included.length) next.set('keywords', included.join(','));
+ else next.delete('keywords');
+ if (excluded.length)
+ next.set('excludeKeywords', excluded.join(','));
+ else next.delete('excludeKeywords');
setP(next, { replace: true });
}}
- >
-
-
- {t('lumen.browse.contentRating', 'Content Rating')}
-
- {
- const next = new URLSearchParams(p);
- for (const key of [
- 'certification',
- 'certificationGte',
- 'certificationLte',
- 'certificationCountry',
- 'certificationMode',
- ])
- next.delete(key);
- if (event.target.value) {
- next.set('certification', event.target.value);
- next.set('certificationCountry', 'US');
- }
- setP(next, { replace: true });
- }}
- >
-
- {t('lumen.browse.anyRating', 'Any Rating')}
-
- {certificationRange && (
-
- {t('lumen.browse.ratingRange', '{low} to {high}', {
- low:
- certificationFilters.certificationGte ||
- t('lumen.browse.any', 'Any'),
- high:
- certificationFilters.certificationLte ||
- t('lumen.browse.any', 'Any'),
- })}
-
- )}
- {certification &&
- (!ratingOptions.includes(certification) ||
- (certificationCountry &&
- certificationCountry !== 'US')) && (
-
- {certification}
- {certificationCountry
- ? ' (' + certificationCountry + ')'
- : ''}
-
- )}
- {ratingOptions
- .filter(
- (value) =>
- value !== certification ||
- !certificationCountry ||
- certificationCountry === 'US'
- )
- .map((value) => (
-
- {value}
-
- ))}
-
-
-
-
- {t('lumen.browse.originalLanguage', 'Original Language')}
-
- {
- const next = new URLSearchParams(p);
- if (event.target.value)
- next.set('language', event.target.value);
- else next.delete('language');
- setP(next, { replace: true });
- }}
- >
-
- {t('lumen.browse.useSavedDefault', 'Use Saved Default')}
-
-
- {t('lumen.browse.allLanguages', 'All Languages')}
-
- {language &&
- language !== 'all' &&
- !languageOptions.some(
- (option) => option.iso_639_1 === language
- ) && {language} }
- {languageOptions.map(({ iso_639_1, english_name }) => (
-
- {displayName(languageNames, iso_639_1, english_name)}
-
- ))}
-
-
-
-
- {t('lumen.browse.countryOfOrigin', 'Country of Origin')}
-
- upd('country', event.target.value)}
- >
-
- {t('lumen.browse.anyCountry', 'Any Country')}
-
- {country &&
- !countryOptions.some(
- ({ iso_3166_1 }) => iso_3166_1 === country
- ) && {country} }
- {countryOptions.map(({ iso_3166_1, english_name }) => (
-
- {displayName(countryNames, iso_3166_1, english_name)}
-
- ))}
-
-
-
-
-
- {t('lumen.browse.browseGenres', 'Browse Genres')}
-
- {kind === 'movie' && (
- setShowStudios(!showStudios)}
- >
- {t('lumen.browse.productionStudios', 'Production Studios')}
-
- )}
- setShowProviders(!showProviders)}
- >
- {t('lumen.browse.streamingServices', 'Streaming Services')}
- {providers.length ? ` (${providers.length})` : ''}
-
+ />
+ )}
+
+
+ {kind === 'movie' && showStudios && (
+ upd('studio', id)} />
+ )}
+
+
+ );
+
+ return (
+ <>
+
+
+ {subtitle}
+
+
+ {searchHint}
+
+
+ {companyLogo && (
+
+
+
+ )}
+ {phone ? (
+
+ {sortControls}
+ {studio && (
setShowTags(!showTags)}
+ aria-pressed={excludeStudio}
+ onClick={() => upd('excludeStudio', excludeStudio ? '' : 'true')}
>
- {t('lumen.browse.subjectTags', 'Subject Tags')}
+ {t('lumen.browse.excludeStudio', 'Exclude Studio')}
-
- {showProviders && regionPending && (
-
- {t(
- 'lumen.browse.loadingStreamingRegion',
- 'Loading streaming region…'
- )}
-
- )}
- {showProviders && !regionPending && (
- {
- const next = new URLSearchParams(p);
- next.delete('watchProviders');
- next.delete('watchRegion');
- next.delete('watchProviderMode');
- if (ids.length) {
- next.set('watchProviders', ids.join('|'));
- next.set('watchRegion', nextRegion);
- next.set(
- 'watchProviderMode',
- exclude ? 'exclude' : 'include'
- );
- }
- setP(next, { replace: true });
- }}
- />
- )}
- {showTags && (
- {
- const next = new URLSearchParams(p);
- if (included.length) next.set('keywords', included.join(','));
- else next.delete('keywords');
- if (excluded.length)
- next.set('excludeKeywords', excluded.join(','));
- else next.delete('excludeKeywords');
- setP(next, { replace: true });
- }}
- />
- )}
-
-
- {kind === 'movie' && showStudios && (
- upd('studio', id)} />
)}
-
-
+ {statusControls}
+
+ ) : (
+ <>
+
+ {followButtons}
+ {availabilitySwitch}
+ {sortControls}
+ {activeChips}
+ {statusControls}
+ {clearButton}
+
+ {morePanel}
+ >
+ )}
{!items.length && (
)}
- {data.overview && {data.overview}
}
+ {data.overview && {data.overview} }
{data.parts.length ? (
diff --git a/lumen/src/pages/Comics.tsx b/lumen/src/pages/Comics.tsx
index e2bc39b..dc2186e 100644
--- a/lumen/src/pages/Comics.tsx
+++ b/lumen/src/pages/Comics.tsx
@@ -12,6 +12,7 @@ import {
shortDate,
StatLabel,
} from '../components/cards';
+import { ClampText } from '../components/ClampText';
import {
ComicCard,
ComicRequestOptionsSheet,
@@ -29,6 +30,11 @@ import {
Facts,
Pill,
} from '../components/detail';
+import {
+ foldsEditions,
+ MoreEditions,
+ previewRows,
+} from '../components/EditionPreview';
import {
comicState,
ExtraGate,
@@ -42,7 +48,13 @@ import {
import { GenrePicker } from '../components/GenrePicker';
import IndexerSearchLink from '../components/IndexerSearchLink';
import { ManageMediaAction } from '../components/ManageMediaSheet';
+import { MoreActions } from '../components/MoreActions';
import OpenIssueReports from '../components/OpenIssueReports';
+import {
+ PhoneFilterBar,
+ usePhone,
+ type AppliedFilter,
+} from '../components/PhoneFilters';
import ReaderDeliveryLink from '../components/ReaderDeliveryLink';
import ReaderShelf from '../components/ReaderShelf';
import ReportIssueButton from '../components/ReportIssueButton';
@@ -285,6 +297,269 @@ export function Comics() {
? t('lumen.comics.manga', 'Manga')
: t('lumen.comics.popularManga', 'Popular manga');
+ const typeSwitch = (
+
+ {(
+ [
+ ['', t('lumen.comics.all', 'All')],
+ ['manga', t('lumen.comics.manga', 'Manga')],
+ ['comic', t('components.Discover.DiscoverComics.comics', 'Comics')],
+ ] as const
+ ).map(([v, t]) => (
+
+ upd({
+ type: v || null,
+ sort: null,
+ // manga filters don't apply to Western comics and back
+ ...(v === 'comic' ? { genre: null, status: null } : {}),
+ ...(v !== 'comic' ? { publisher: null } : {}),
+ })
+ }
+ >
+ {t}
+
+ ))}
+
+ );
+ const comicFilters = (
+ <>
+
+ {(
+ [
+ ['', t('lumen.comics.all', 'All')],
+ ['library', t('lumen.comics.inLibrary', 'In library')],
+ ['not', t('lumen.comics.notYet', 'Not yet')],
+ ] as const
+ ).map(([v, t]) => (
+ upd({ show: v || null })}
+ >
+ {t}
+
+ ))}
+
+ {show !== 'library' && (
+
+ {t('lumen.comics.sort', 'Sort')}
+
+ kind === 'comic'
+ ? upd({
+ sort: e.target.value === 'issues' ? null : e.target.value,
+ })
+ : mangaOnly({
+ sort:
+ e.target.value === 'popular' && type
+ ? null
+ : e.target.value,
+ })
+ }
+ >
+ {sorts.map(([v, t]) => (
+
+ {t}
+
+ ))}
+
+
+ )}
+ {kind === 'manga' && show !== 'library' && (
+
+ {t('lumen.comics.status', 'Status')}
+ mangaOnly({ status: e.target.value || null })}
+ >
+ {t('lumen.comics.any', 'Any')}
+
+ {t('lumen.comics.ongoing', 'Ongoing')}
+
+
+ {t('lumen.comics.finished', 'Finished')}
+
+
+
+ )}
+ {kind === 'comic' && !!publishers.length && (
+
+
+ {t('components.Discover.DiscoverComics.publisher', 'Publisher')}
+
+ upd({ publisher: e.target.value || null })}
+ >
+ {t('lumen.comics.all', 'All')}
+ {publishers.map((x) => (
+
+ {x}
+
+ ))}
+
+
+ )}
+ {kind === 'manga' && (
+ ({ value: g, label: g }))}
+ picked={picked}
+ // a genre narrows All to manga; All genres only clears the genres
+ onChange={(next) =>
+ next.length
+ ? mangaOnly({ genre: next.join(',') })
+ : upd({ genre: null })
+ }
+ />
+ )}
+ >
+ );
+ const catalogueSearch = (
+
+
+ {t('lumen.comics.searchCatalogue', 'Search the Comics Catalogue')}
+
+
+
+
+
+ );
+ const phone = usePhone();
+ const comicChips: AppliedFilter[] = [];
+ if (phone) {
+ if (catalogMode)
+ comicChips.push({
+ key: 'catalog',
+ label: t('lumen.comics.catalogue', 'Comics Catalogue'),
+ remove: () => setP({}, { replace: true }),
+ });
+ if (show)
+ comicChips.push({
+ key: 'show',
+ label:
+ show === 'library'
+ ? t('lumen.comics.inLibrary', 'In library')
+ : t('lumen.comics.notYet', 'Not yet'),
+ remove: () => upd({ show: null }),
+ });
+ if (kind === 'manga' && status)
+ comicChips.push({
+ key: 'status',
+ label:
+ status === 'ongoing'
+ ? t('lumen.comics.ongoing', 'Ongoing')
+ : t('lumen.comics.finished', 'Finished'),
+ remove: () => upd({ status: null }),
+ });
+ if (kind === 'comic' && publisher)
+ comicChips.push({
+ key: 'publisher',
+ label: publisher,
+ remove: () => upd({ publisher: null }),
+ });
+ if (kind === 'manga')
+ for (const genre of picked)
+ comicChips.push({
+ key: `genre:${genre}`,
+ label: genre,
+ remove: () => {
+ const next = picked.filter((value) => value !== genre);
+ upd({ genre: next.length ? next.join(',') : null });
+ },
+ });
+ }
+
return (
)}
- {!catalogMode && (
-
-
- {(
- [
- ['', t('lumen.comics.all', 'All')],
- ['manga', t('lumen.comics.manga', 'Manga')],
- [
- 'comic',
- t('components.Discover.DiscoverComics.comics', 'Comics'),
- ],
- ] as const
- ).map(([v, t]) => (
-
- upd({
- type: v || null,
- sort: null,
- // manga filters don't apply to Western comics and back
- ...(v === 'comic' ? { genre: null, status: null } : {}),
- ...(v !== 'comic' ? { publisher: null } : {}),
- })
- }
- >
- {t}
-
- ))}
-
-
- {(
- [
- ['', t('lumen.comics.all', 'All')],
- ['library', t('lumen.comics.inLibrary', 'In library')],
- ['not', t('lumen.comics.notYet', 'Not yet')],
- ] as const
- ).map(([v, t]) => (
- upd({ show: v || null })}
- >
- {t}
-
- ))}
-
- {show !== 'library' && (
-
- {t('lumen.comics.sort', 'Sort')}
-
- kind === 'comic'
- ? upd({
- sort:
- e.target.value === 'issues' ? null : e.target.value,
- })
- : mangaOnly({
- sort:
- e.target.value === 'popular' && type
- ? null
- : e.target.value,
- })
- }
- >
- {sorts.map(([v, t]) => (
-
- {t}
-
- ))}
-
-
- )}
- {kind === 'manga' && show !== 'library' && (
-
- {t('lumen.comics.status', 'Status')}
- mangaOnly({ status: e.target.value || null })}
- >
- {t('lumen.comics.any', 'Any')}
-
- {t('lumen.comics.ongoing', 'Ongoing')}
-
-
- {t('lumen.comics.finished', 'Finished')}
-
-
-
- )}
- {kind === 'comic' && !!publishers.length && (
-
-
- {t('components.Discover.DiscoverComics.publisher', 'Publisher')}
-
- upd({ publisher: e.target.value || null })}
- >
- {t('lumen.comics.all', 'All')}
- {publishers.map((x) => (
-
- {x}
-
- ))}
-
-
- )}
- {kind === 'manga' && (
-
({ value: g, label: g }))}
- picked={picked}
- // a genre narrows All to manga; All genres only clears the genres
- onChange={(next) =>
- next.length
- ? mangaOnly({ genre: next.join(',') })
- : upd({ genre: null })
- }
- />
+ {phone ? (
+ setP(type ? { type } : {}, { replace: true })}
+ panel={catalogueSearch}
+ >
+ {!catalogMode && comicFilters}
+
+ ) : (
+ <>
+ {!catalogMode && (
+
+ {typeSwitch}
+ {comicFilters}
+
)}
-
+ {catalogueSearch}
+ >
)}
-
-
- {t('lumen.comics.searchCatalogue', 'Search the Comics Catalogue')}
-
-
-
-
-
{!filtered && (
<>
(null);
+ const [allEditions, setAllEditions] = useState(false);
const [asked, setAsked] = useState>(new Set());
const { user } = useAuth();
const mayRequest = canRequestComic(user?.permissions);
@@ -806,7 +881,10 @@ export function ComicDetail() {
prefs.requestOptions && canChooseRequestOptions(user?.permissions);
// set at once, unlike busy: a double tap can't send the request twice
const sending = useRef(false);
- useEffect(() => setPick(null), [id]);
+ useEffect(() => {
+ setPick(null);
+ setAllEditions(window.location.hash === '#editions');
+ }, [id]);
// #editions (from a card's "Choose edition") scrolls to the picker once it's there
const workLoaded = !!work;
useEffect(() => {
@@ -996,15 +1074,6 @@ export function ComicDetail() {
/>
-
{
- refreshEdition();
- reload();
- }}
- />
{cs.detail && {cs.detail} }
{(work.genres || []).slice(0, 4).map((g) => (
@@ -1012,54 +1081,65 @@ export function ComicDetail() {
{g}
))}
-
- {comicVineDetailUrl && (
-
- {t(
- 'components.ComicDetails.viewOnComicVine',
- 'View on ComicVine'
- )}
-
- )}
- {
- refreshEdition();
- reload();
- }}
- />
- {chosen && (
-
- )}
-
+
+ {
+ refreshEdition();
+ reload();
+ }}
+ />
+
+ {comicVineDetailUrl && (
+
+ {t(
+ 'components.ComicDetails.viewOnComicVine',
+ 'View on ComicVine'
+ )}
+
+ )}
+ {
+ refreshEdition();
+ reload();
+ }}
+ />
+ {chosen && (
+
+ )}
+
+
{c && chosen && (
{c.deck}
)}
- {about.slice(0, 4).map((t, i) => (
-
- {t}
-
- ))}
+ {about.length > 0 && (
+
+ {about.slice(0, 4).join('\n\n')}
+
+ )}
@@ -1180,7 +1260,11 @@ export function ComicDetail() {
role="radiogroup"
aria-label={t('lumen.comicDetail.editions', 'Editions')}
>
- {editions.map((e) => {
+ {previewRows(
+ editions,
+ allEditions,
+ (e) => e.id === chosenId
+ ).map((e) => {
const st = stateOf(e.id);
const on = chosenId === e.id;
return (
@@ -1276,6 +1360,19 @@ export function ComicDetail() {
})}
)}
+ {foldsEditions(editions.length) && (
+
+ setAllEditions(!allEditions)}
+ label={t(
+ 'lumen.detail.allEditions',
+ 'All {count} editions',
+ { count: editions.length }
+ )}
+ />
+
+ )}
{main}
diff --git a/lumen/src/pages/CuratedCollection.tsx b/lumen/src/pages/CuratedCollection.tsx
index c4bd971..ee73639 100644
--- a/lumen/src/pages/CuratedCollection.tsx
+++ b/lumen/src/pages/CuratedCollection.tsx
@@ -12,6 +12,7 @@ import {
import { isAdministrator, useAuth } from '../auth';
import { canManageBlocklist, notifyBlocklistChanged } from '../blocklist';
import { Section, TitleCard } from '../components/cards';
+import { ClampText } from '../components/ClampText';
import CollectionServerActions, {
type CollectionSync,
} from '../components/CollectionServerSheet';
@@ -577,7 +578,7 @@ function Content({ kind, id }: { kind: Kind; id: string }) {
onComplete={() => void refreshAvailability()}
/>
)}
- {data.overview &&
{data.overview}
}
+ {data.overview &&
{data.overview} }
{music ? (
) : (
diff --git a/lumen/src/pages/Discover.tsx b/lumen/src/pages/Discover.tsx
index 172a1c5..7c690dd 100644
--- a/lumen/src/pages/Discover.tsx
+++ b/lumen/src/pages/Discover.tsx
@@ -20,9 +20,7 @@ import {
shortDate,
TitleCard,
} from '../components/cards';
-import { CardTitleToggle } from '../components/CardTitleToggle';
import { ConfiguredDiscoverShelves } from '../components/ConfiguredDiscoverShelves';
-import { canUseShare } from '../components/detail';
import { ServiceNote } from '../components/extra';
import GenreTiles from '../components/GenreTiles';
import { Avatar } from '../components/Shell';
@@ -112,14 +110,13 @@ const RowError = ({ retry }: { retry: () => void }) => {
);
};
+// the media types this server has, each linking to its own page (Coming Soon, Provider
+// Discovery and Share & Identify live in the sidebar / More menu)
const CHIPS: [IconName, string, string, string][] = [
['film', 'components.Persius.movies', 'Movies', '/movies'],
['tv', 'components.Persius.series', 'Series', '/series'],
['book', 'components.Persius.books', 'Books', '/books'],
['headphones', 'components.Persius.audiobooks', 'Audiobooks', '/audiobooks'],
- ['cal', 'components.Persius.comingSoon', 'Coming soon', '/soon'],
- ['list', 'i18n.providerDiscovery', 'Provider Discovery', '/providers'],
- ['list', 'components.Layout.Sidebar.share', 'Share', '/share'],
];
export default function Discover() {
@@ -263,10 +260,8 @@ export default function Discover() {
(books_ || (h !== '/books' && h !== '/audiobooks')) &&
(h !== '/movies' || movieEnabled) &&
(h !== '/series' || tvEnabled) &&
- (h !== '/soon' || movieEnabled || tvEnabled) &&
(h !== '/books' || ebookEnabled) &&
- (h !== '/audiobooks' || audiobookEnabled) &&
- (h !== '/share' || canUseShare(user?.permissions))
+ (h !== '/audiobooks' || audiobookEnabled)
).map(([i, message, fallback, h]) => (
@@ -343,21 +338,6 @@ export default function Discover() {
- item.mediaType === 'tv'
- ? ('tv' as const)
- : ('movie' as const)
- )
- ),
- ]}
- />
- ) : undefined
- }
>
{fresh ? (
@@ -388,7 +368,6 @@ export default function Discover() {
!empty(movieCards) && (
}
link={[t('components.Persius.seeAll'), '/movies']}
>
{movieCards ? (
@@ -417,7 +396,6 @@ export default function Discover() {
!empty(seriesCards) && (
}
link={[t('components.Persius.seeAll'), '/series']}
>
{seriesCards ? (
@@ -447,7 +425,6 @@ export default function Discover() {
!empty(audio.data ? withCovers(audio.data) : undefined) && (
}
link={[t('components.Persius.seeAll'), '/audiobooks']}
>
{audio.data ? (
@@ -472,7 +449,6 @@ export default function Discover() {
!empty(books.data ? ebookCards : undefined) && (
}
link={[t('components.Persius.seeAll'), '/books']}
>
{books.data ? (
@@ -499,7 +475,6 @@ export default function Discover() {
!empty(upcomingCards) && (
}
link={[t('components.Persius.seeAll'), '/soon']}
>
{upcomingCards ? (
@@ -529,7 +504,6 @@ export default function Discover() {
!empty(upcomingSeriesCards) && (
}
link={[t('components.Persius.seeAll'), '/soon?media=tv']}
>
{upcomingSeriesCards ? (
diff --git a/lumen/src/pages/LumenSettings.tsx b/lumen/src/pages/LumenSettings.tsx
index f8d185c..644bb40 100644
--- a/lumen/src/pages/LumenSettings.tsx
+++ b/lumen/src/pages/LumenSettings.tsx
@@ -2,13 +2,20 @@ import { useEffect, useMemo, useRef, useState } from 'react';
import { Link } from 'react-router-dom';
import { csrfHeaders } from '../api';
import { isAdministrator, useAuth } from '../auth';
-import { Section } from '../components/cards';
+import { FoldSections, Section } from '../components/cards';
+import { playerName } from '../components/MusicPlayback';
import { useToast } from '../components/toast';
import { isCompanionBrandingPath, parseCompanionConfig } from '../configImport';
import { embedded, lumenAdminUrl } from '../deployment';
import { useLumenLocale } from '../i18n';
import { Icon } from '../icons';
import { logoShapeOf, mediaServer, type LogoShape } from '../mediaServer';
+import {
+ allowedMusicPlayers,
+ asMusicPlayer,
+ MUSIC_PLAYERS,
+ type MusicPlayer,
+} from '../musicPlayback';
import {
DEFAULT_PREFS,
DISCOVER_ROWS,
@@ -255,6 +262,16 @@ export default function LumenSettings() {
return { ...c, branding: b };
});
const shape = logoShapeOf(cfg.branding?.logoShape);
+ const musicApps = allowedMusicPlayers(cfg.musicPlayers);
+ const savedDefault = asMusicPlayer(cfg.defaults?.musicPlayer) ?? 'aurral';
+ const musicDefault = musicApps.includes(savedDefault)
+ ? savedDefault
+ : (musicApps[0] ?? savedDefault);
+ const setMusicApps = (apps: MusicPlayer[]) =>
+ setCfg((c) => ({
+ ...c,
+ musicPlayers: MUSIC_PLAYERS.filter((app) => apps.includes(app)),
+ }));
const setTop = (k: string, v: string | undefined) =>
setCfg((c) => {
const n = { ...c };
@@ -460,546 +477,608 @@ export default function LumenSettings() {
)}
-
- {saveState && !saveState.canSave && (
-
-
- {embedded
- ? (saveState.message ??
- admin(
- 'storageIncluded',
- 'Included Lumen cannot save its settings. Check that SeerrNG’s config volume is writable.'
- ))
- : saveState.folder === 'readonly'
- ? admin(
- 'storageReadOnly',
- 'Lumen cannot write to /lumen-data. Mount it read-write and give its host folder to UID:GID {uid}:{gid}.',
- {
- uid: saveState.uid ?? 'the container user',
- gid: saveState.gid ?? 'the container group',
- }
- )
- : saveState.folder === 'missing'
+
+ {saveState && !saveState.canSave && (
+
+
+ {embedded
+ ? (saveState.message ??
+ admin(
+ 'storageIncluded',
+ 'Included Lumen cannot save its settings. Check that SeerrNG’s config volume is writable.'
+ ))
+ : saveState.folder === 'readonly'
? admin(
- 'storageMissing',
- 'Mount a writable host folder at /lumen-data to enable Save and Upload.'
+ 'storageReadOnly',
+ 'Lumen cannot write to /lumen-data. Mount it read-write and give its host folder to UID:GID {uid}:{gid}.',
+ {
+ uid: saveState.uid ?? 'the container user',
+ gid: saveState.gid ?? 'the container group',
+ }
)
- : admin(
- 'storageUnknown',
- 'Could not check Lumen storage. Check the container logs, then try again.'
- )}
-
- {embedded && saveState.uid != null && saveState.gid != null && (
+ : saveState.folder === 'missing'
+ ? admin(
+ 'storageMissing',
+ 'Mount a writable host folder at /lumen-data to enable Save and Upload.'
+ )
+ : admin(
+ 'storageUnknown',
+ 'Could not check Lumen storage. Check the container logs, then try again.'
+ )}
+
+ {embedded && saveState.uid != null && saveState.gid != null && (
+
+ {admin(
+ 'containerIdentity',
+ 'SeerrNG runs as UID {uid} and GID {gid}.',
+ { uid: saveState.uid, gid: saveState.gid }
+ )}
+
+ )}
+
setStorageCheck((n) => n + 1)}
+ >
+ {admin('checkStorage', 'Check storage again')}
+
+ {!embedded && (
+
+ {admin('composePrefix', 'Compose: put')}{' '}
+ user: "1000:1000"{' '}
+ {admin('composeMiddle', 'beside')} environment:
+ {admin(
+ 'composeSuffix',
+ ', with the same indentation. It is not an environment variable.'
+ )}
+
+ )}
- {admin(
- 'containerIdentity',
- 'SeerrNG runs as UID {uid} and GID {gid}.',
- { uid: saveState.uid, gid: saveState.gid }
- )}
+ {admin('draftRetained', 'Your draft stays here while you check.')}
- )}
-
setStorageCheck((n) => n + 1)}
- >
- {admin('checkStorage', 'Check storage again')}
-
- {!embedded && (
+
+ )}
+
+ {adminConfigState === 'failed' ? (
+
- {admin('composePrefix', 'Compose: put')}{' '}
- user: "1000:1000" {admin('composeMiddle', 'beside')}{' '}
- environment:
{admin(
- 'composeSuffix',
- ', with the same indentation. It is not an environment variable.'
+ 'loadFailed',
+ 'Couldn’t load the current settings, so Save and Upload are off: they would replace settings this page hasn’t seen.'
)}
- )}
-
- {admin('draftRetained', 'Your draft stays here while you check.')}
-
-
- )}
+
+ {admin('tryAgain', 'Try again')}
+
+
+ ) : (
+ adminConfigState === 'loading' && (
+
+
{admin('loading', 'Loading the current settings…')}
+
+ )
+ )}
- {adminConfigState === 'failed' ? (
-
-
- {admin(
- 'loadFailed',
- 'Couldn’t load the current settings, so Save and Upload are off: they would replace settings this page hasn’t seen.'
- )}
-
-
- {admin('tryAgain', 'Try again')}
-
-
- ) : (
- adminConfigState === 'loading' && (
-
-
{admin('loading', 'Loading the current settings…')}
+
+
+
+
+
+ {admin(
+ 'requestSettingsSummary',
+ '4K, partial series and episode rules'
+ )}
+
+
+ {admin(
+ 'requestSettingsHelp',
+ 'These are SeerrNG server settings for everyone.'
+ )}
+
+
+
+ {admin('requestDefaultsLink', 'Request Defaults')}{' '}
+
+
+
- )
- )}
+
-
-
-
-
-
- {admin(
- 'requestSettingsSummary',
- '4K, partial series and episode rules'
- )}
-
-
- {admin(
- 'requestSettingsHelp',
- 'These are SeerrNG server settings for everyone.'
+
+
+
+
+ {admin('mediaServer', 'Media server')}
+
+ {admin(
+ 'mediaServerHelp',
+ 'Names in every label and the sign-in button. SeerrNG reports {server}.',
+ {
+ server:
+ mediaServer().source === 'seerrng'
+ ? mediaServer().product
+ : 'its own server',
+ }
+ )}{' '}
+
+
+
+ setTop(
+ 'mediaServer',
+ e.target.value === 'auto' ? undefined : e.target.value
+ )
+ }
+ >
+
+ {admin('followSeerr', 'Follow SeerrNG')}
+
+ Plex
+ Jellyfin
+ Emby
+
+
+
+
+ {admin('mediaServerName', 'Media server name')}
+
+ {admin(
+ 'mediaServerNameHelp',
+ 'Replaces “{product}” everywhere: “On …”, “Watch on …”, filters and sign-in. Leave empty to keep it.',
+ { product: mediaServer().product }
+ )}
+
+
+ setTop('mediaServerName', e.target.value)}
+ />
+
+
+
+ {admin('signInPage', 'Sign-in page')}
+
+ {admin(
+ 'signInHelp',
+ 'Jellyfin and Emby: show the username and password boxes straight away, without naming the media server. With buttons, each device opens the way it last signed in.'
+ )}
+
+
+
+ setTop(
+ 'loginStyle',
+ e.target.value === 'buttons' ? undefined : e.target.value
+ )
+ }
+ >
+
+ {admin('signInButtons', 'Buttons (Continue with …)')}
+
+
+ {admin('signInForm', 'Username and password form')}
+
+
+
+
+
+ {admin('fullSeerrAddress', 'Full SeerrNG address')}
+
+ {admin(
+ 'fullSeerrAddressHelp',
+ 'Where “Open full SeerrNG” goes'
+ )}
+
+
+ setTop('seerrPublicUrl', e.target.value)}
+ />
+
+
+
+
+ {admin('audiobookshelfAddress', 'Audiobookshelf address')}
+
+
+ {admin(
+ 'audiobookshelfAddressHelp',
+ 'Where “Listen in Audiobookshelf” goes'
+ )}
+
+
+
-
-
- {admin('requestDefaultsLink', 'Request Defaults')}{' '}
-
-
+ placeholder="https://books.example.com"
+ value={(cfg.audiobookshelfUrl as string) || ''}
+ onChange={(e) => setTop('audiobookshelfUrl', e.target.value)}
+ />
+
+
+
+ {admin('kavitaAddress', 'Kavita address')}
+
+ {admin(
+ 'kavitaAddressHelp',
+ 'Where “Read in Kavita” goes. Leave empty to use SeerrNG’s Kavita address'
+ )}
+
+
+ setTop('kavitaUrl', e.target.value)}
+ />
+
-
-
+
-
-
-
-
- {admin('mediaServer', 'Media server')}
-
- {admin(
- 'mediaServerHelp',
- 'Names in every label and the sign-in button. SeerrNG reports {server}.',
- {
- server:
- mediaServer().source === 'seerrng'
- ? mediaServer().product
- : 'its own server',
- }
- )}{' '}
-
-
-
- setTop(
- 'mediaServer',
- e.target.value === 'auto' ? undefined : e.target.value
- )
- }
- >
-
- {admin('followSeerr', 'Follow SeerrNG')}
-
- Plex
- Jellyfin
- Emby
-
-
-
-
- {admin('mediaServerName', 'Media server name')}
-
- {admin(
- 'mediaServerNameHelp',
- 'Replaces “{product}” everywhere: “On …”, “Watch on …”, filters and sign-in. Leave empty to keep it.',
- { product: mediaServer().product }
- )}
-
-
- setTop('mediaServerName', e.target.value)}
- />
-
-
-
- {admin('signInPage', 'Sign-in page')}
-
- {admin(
- 'signInHelp',
- 'Jellyfin and Emby: show the username and password boxes straight away, without naming the media server. With buttons, each device opens the way it last signed in.'
- )}
-
-
-
- setTop(
- 'loginStyle',
- e.target.value === 'buttons' ? undefined : e.target.value
+
+ {missingBranding.length > 0 && (
+
+ {admin('missingBrandingPrefix', 'Upload the companion')}{' '}
+ {missingBranding
+ .map((kind) =>
+ kind === 'icon'
+ ? admin('tabIcon', 'tab icon')
+ : admin('logo', 'logo')
)
- }
- >
-
- {admin('signInButtons', 'Buttons (Continue with …)')}
-
-
- {admin('signInForm', 'Username and password form')}
-
-
-
-
-
- {admin('fullSeerrAddress', 'Full SeerrNG address')}
-
- {admin(
- 'fullSeerrAddressHelp',
- 'Where “Open full SeerrNG” goes'
- )}
-
-
- setTop('seerrPublicUrl', e.target.value)}
- />
-
-
-
- {admin('audiobookshelfAddress', 'Audiobookshelf address')}
-
- {admin(
- 'audiobookshelfAddressHelp',
- 'Where “Listen in Audiobookshelf” goes'
- )}
-
-
- setTop('audiobookshelfUrl', e.target.value)}
- />
-
-
-
- {admin('kavitaAddress', 'Kavita address')}
-
- {admin(
- 'kavitaAddressHelp',
- 'Where “Read in Kavita” goes. Leave empty to use SeerrNG’s Kavita address'
- )}
-
-
- setTop('kavitaUrl', e.target.value)}
- />
-
-
-
-
-
- {missingBranding.length > 0 && (
-
- {admin('missingBrandingPrefix', 'Upload the companion')}{' '}
- {missingBranding
- .map((kind) =>
- kind === 'icon'
- ? admin('tabIcon', 'tab icon')
- : admin('logo', 'logo')
- )
- .join(' and ')}{' '}
- {admin(
- 'missingBrandingSuffix',
- 'as PNG, JPEG, or WebP before saving.'
- )}
-
- )}
-
-
-
- {admin('name', 'Name')}
-
- {admin(
- 'nameHelp',
- 'Next to the logo and in the browser tab. Leave empty to hide the text.'
- )}
-
-
- setBrand('name', e.target.value)}
- />
-
-
-
- {admin('logo', 'Logo')}
-
- {saveState?.canSave
- ? admin(
- 'logoUploadHelp',
- 'Square image: upload one, or an address such as /branding/logo.png or https://…'
- )
- : admin(
- 'logoManualHelp',
- 'Square image, e.g. /branding/logo.png (mount a branding folder) or an https address'
- )}
-
-
- setBrand('logo', e.target.value)}
- />
-
-
-
-
- {admin('tabIcon', 'Tab icon')}
-
- {saveState?.canSave
- ? embedded
+
+ )}
+
+
+
+ {admin('name', 'Name')}
+
+ {admin(
+ 'nameHelp',
+ 'Next to the logo and in the browser tab. Leave empty to hide the text.'
+ )}
+
+
+ setBrand('name', e.target.value)}
+ />
+
+
+
+ {admin('logo', 'Logo')}
+
+ {saveState?.canSave
? admin(
- 'iconUploadEmbedded',
- 'Square PNG, JPEG or WebP: upload one, or use an image address'
+ 'logoUploadHelp',
+ 'Square image: upload one, or an address such as /branding/logo.png or https://…'
)
: admin(
- 'iconUploadCompanion',
- 'Square PNG or SVG: upload one, or an address such as /branding/icon.png'
- )
- : admin(
- 'iconManualHelp',
- 'PNG or SVG, e.g. /branding/icon.png'
- )}
-
-
-
setBrand('icon', e.target.value)}
- />
- {cfg.branding?.icon && (
-
- )}
-
-
-
-
- {admin('logoShape', 'Logo shape')}
-
- {admin(
- 'logoShapeHelp',
- 'How the logo is framed next to the name. “As uploaded” keeps the file as it is: transparent, uncropped and as wide as it is.'
- )}
-
-
-
- {(
- [
- ['rounded', 'roundedSquare'],
- ['circle', 'circle'],
- ['raw', 'asUploaded'],
- ] as [LogoShape, string][]
- ).map(([v, t]) => (
- setBrand('logoShape', v)}
- >
+ 'logoManualHelp',
+ 'Square image, e.g. /branding/logo.png (mount a branding folder) or an https address'
+ )}
+
+
+ setBrand('logo', e.target.value)}
+ />
+
+
+
+
+ {admin('tabIcon', 'Tab icon')}
+
+ {saveState?.canSave
+ ? embedded
+ ? admin(
+ 'iconUploadEmbedded',
+ 'Square PNG, JPEG or WebP: upload one, or use an image address'
+ )
+ : admin(
+ 'iconUploadCompanion',
+ 'Square PNG or SVG: upload one, or an address such as /branding/icon.png'
+ )
+ : admin(
+ 'iconManualHelp',
+ 'PNG or SVG, e.g. /branding/icon.png'
+ )}
+
+
+
setBrand('icon', e.target.value)}
+ />
+ {cfg.branding?.icon && (
+
+ )}
+
+
+
+
+ {admin('logoShape', 'Logo shape')}
+
{admin(
- `shape.${t}`,
- t === 'roundedSquare'
- ? 'Rounded square'
- : t === 'circle'
- ? 'Circle'
- : 'As uploaded'
+ 'logoShapeHelp',
+ 'How the logo is framed next to the name. “As uploaded” keeps the file as it is: transparent, uncropped and as wide as it is.'
)}
-
- ))}
+
+
+
+ {(
+ [
+ ['rounded', 'roundedSquare'],
+ ['circle', 'circle'],
+ ['raw', 'asUploaded'],
+ ] as [LogoShape, string][]
+ ).map(([v, t]) => (
+ setBrand('logoShape', v)}
+ >
+ {admin(
+ `shape.${t}`,
+ t === 'roundedSquare'
+ ? 'Rounded square'
+ : t === 'circle'
+ ? 'Circle'
+ : 'As uploaded'
+ )}
+
+ ))}
+
+ {(cfg.branding?.logo || cfg.branding?.name !== undefined) && (
+
+
+ {admin('preview', 'Preview')}
+
+
+ {cfg.branding?.logo ? (
+
+ ) : (
+
+
+
+ )}
+ {cfg.branding?.name ?? 'SeerrNG'}
+
+
+ )}
- {(cfg.branding?.logo || cfg.branding?.name !== undefined) && (
+
+
+
+
+ {SWITCHES.map(([k, key]) => (
+
|
+ ))}
- {admin('preview', 'Preview')}
+ {admin('theme', 'Theme')}
-
setDefault('theme', e.target.value)}
>
- {cfg.branding?.logo ? (
-
- ) : (
-
-
-
- )}
- {cfg.branding?.name ?? 'SeerrNG'}
-
+
{admin('dark', 'Dark')}
+
{admin('light', 'Light')}
+
{admin('device', 'Device')}
+
+
setLock('theme', lock)}
+ />
- )}
-
-
+
+
-
-
- {SWITCHES.map(([k, key]) => (
-
|
- ))}
-
-
- {admin('theme', 'Theme')}
-
-
setDefault('theme', e.target.value)}
- >
- {admin('dark', 'Dark')}
- {admin('light', 'Light')}
- {admin('device', 'Device')}
-
-
setLock('theme', lock)}
- />
+
+
+ {(Object.keys(DISCOVER_ROWS) as DiscoverRow[]).map((r) => (
+
+ ))}
-
-
+
-
-
- {(Object.keys(DISCOVER_ROWS) as DiscoverRow[]).map((r) => (
-
- ))}
-
-
+
+
+ {admin(
+ 'musicAppsHelp',
+ 'The apps people can pick for Play on music. Aurral is offered only when an Aurral service is set up, and Hearth only on Android phones. With none on, Play is off and songs keep their previews.'
+ )}
+
+
+ {MUSIC_PLAYERS.map((app) => (
+
+
+ {playerName(app, t)}
+
+
+ setMusicApps(
+ event.target.checked
+ ? [...musicApps, app]
+ : musicApps.filter((value) => value !== app)
+ )
+ }
+ />
+
+ ))}
+ {musicApps.length > 0 && (
+
+
+ {admin('musicDefaultApp', 'Default app')}
+
+
+ setDefault('musicPlayer', event.target.value)
+ }
+ >
+ {musicApps.map((app) => (
+
+ {playerName(app, t)}
+
+ ))}
+
+
+ )}
+ {musicApps.length > 0 && (
+
+ setLock('musicPlayer', lock)}
+ />
+
+ )}
+
+
-
-
-
0 ||
- !canWrite
- }
- title={
- !saveState?.canSave
- ? admin(
- 'saveStorageTitle',
- 'Saving needs writable storage. See the storage message above.'
- )
- : !loaded
+
+ : !loaded
+ ? admin(
+ 'saveLoadTitle',
+ 'Saving waits for the current settings. See the message above.'
+ )
+ : undefined
+ }
+ >
+ {saving
+ ? admin('saving', 'Saving…')
+ : admin('saveForEveryone', 'Save for everyone')}
+
+
+ {admin('download', 'Download lumen-config.json')}
+
+
+ {admin('copy', 'Copy')}
+
+ {embedded && (
+
+ {importing
+ ? admin('reading', 'Reading…')
+ : admin('import', 'Import lumen-config.json')}
+ {
+ const file = event.target.files?.[0];
+ event.target.value = '';
+ if (file) void importConfig(file);
+ }}
+ />
+
+ )}
+
+
+
+
>
);
}
diff --git a/lumen/src/pages/Me.tsx b/lumen/src/pages/Me.tsx
index a162cd8..afee9d6 100644
--- a/lumen/src/pages/Me.tsx
+++ b/lumen/src/pages/Me.tsx
@@ -12,6 +12,8 @@ import {
canUseRequestAccess,
useShareAvailable,
} from '../components/detail';
+import { PhoneSection, PhoneSubsection } from '../components/MoreActions';
+import { MusicPlayerSettings } from '../components/MusicPlayback';
import RequestLimits from '../components/RequestLimits';
import { fullSeerrUrl } from '../components/Shell';
import { useToast } from '../components/toast';
@@ -183,185 +185,154 @@ export default function Me() {
)}
- {isAdmin && }
+ {isAdmin && }
- {shareAvailable && (
-
+ {/* phones fold Discover, Library, Acquisition and Support into one box */}
+
+ {shareAvailable && (
+
+
+
+
+ {t('components.Layout.Sidebar.share', 'Share & Identify')}
+
+
+ {open}
+
+
+
+
+ )}
+
+
- {t('components.Layout.Sidebar.share', 'Share & Identify')}
+ {t('components.Layout.Sidebar.myMedia', 'My Media')}
{open}
-
-
- )}
-
-
-
-
- {t('components.Layout.Sidebar.myMedia', 'My Media')}
-
+ {t('components.Layout.Sidebar.swipe', 'Swipe')}
+
+ {open}
+
+
)}
- >
- {open}
-
-
- {publicSettings?.swipeEnabled &&
- canUseRequestAccess(user?.permissions) && (
+ {canRequestMovies(user?.permissions) && (
+
+
+ {t(
+ 'components.Layout.Sidebar.watchSessions',
+ 'Watch Sessions'
+ )}
+
+
+ {open}
+
+
+ )}
+ {liveTv.data?.configured && (
- {t('components.Layout.Sidebar.swipe', 'Swipe')}
+
+ {t('components.LiveTv.RecordingList.title', 'Recordings')}
+
{open}
)}
- {canRequestMovies(user?.permissions) && (
-
- {t('components.Layout.Sidebar.watchSessions', 'Watch Sessions')}
-
+ {me('releaseCalendar', 'Release Calendar')}
{open}
- )}
- {liveTv.data?.configured && (
- {t('components.LiveTv.RecordingList.title', 'Recordings')}
+ {t('components.Layout.Sidebar.comingSoon', 'Coming soon')}
{open}
- )}
-
- {me('releaseCalendar', 'Release Calendar')}
-
- {open}
-
-
-
- {t('components.Layout.Sidebar.comingSoon', 'Coming soon')}
-
- {open}
-
-
-
- {t('library.watchlist', 'Watchlist')}
-
- {open}
-
-
- {extras.list.some((item) => item.key === 'game') && (
- {t('components.Layout.Sidebar.gamesLibrary', 'My Games')}
+ {t('library.watchlist', 'Watchlist')}
{open}
- )}
- {canViewFollowing(user?.permissions) && (
-
- {t('components.Layout.Sidebar.following', 'Following')}
-
- {open}
-
-
- )}
-
-
-
- {(canManageDownloads(user?.permissions) ||
- canSearchIndexers(user?.permissions)) && (
-
-
- {canManageDownloads(user?.permissions) && (
+ {extras.list.some((item) => item.key === 'game') && (
-
- {t('components.Layout.Sidebar.downloads', 'Download Inbox')}
-
+ {t('components.Layout.Sidebar.gamesLibrary', 'My Games')}
{open}
)}
- {canSearchIndexers(user?.permissions) && (
+ {canViewFollowing(user?.permissions) && (
-
- {t(
- 'components.Layout.Sidebar.indexerSearch',
- 'Indexer Search'
- )}
-
+ {t('components.Layout.Sidebar.following', 'Following')}
{open}
@@ -369,43 +340,89 @@ export default function Me() {
)}
-
- )}
+
- {(showBlocklist || canReadIssues(user?.permissions)) && (
-
-
- {showBlocklist && (
-
- {t('components.Layout.Sidebar.blocklist', 'Blocklist')}
-
- {open}
-
-
- )}
- {canReadIssues(user?.permissions) && (
-
- {t('components.Layout.Sidebar.issues', 'Issues')}
-
- {open}
-
-
- )}
-
-
- )}
+ {(canManageDownloads(user?.permissions) ||
+ canSearchIndexers(user?.permissions)) && (
+
+
+ {canManageDownloads(user?.permissions) && (
+
+
+ {t('components.Layout.Sidebar.downloads', 'Download Inbox')}
+
+
+ {open}
+
+
+ )}
+ {canSearchIndexers(user?.permissions) && (
+
+
+ {t(
+ 'components.Layout.Sidebar.indexerSearch',
+ 'Indexer Search'
+ )}
+
+
+ {open}
+
+
+ )}
+
+
+ )}
+
+ {(showBlocklist || canReadIssues(user?.permissions)) && (
+
+
+ {showBlocklist && (
+
+ {t('components.Layout.Sidebar.blocklist', 'Blocklist')}
+
+ {open}
+
+
+ )}
+ {canReadIssues(user?.permissions) && (
+
+ {t('components.Layout.Sidebar.issues', 'Issues')}
+
+ {open}
+
+
+ )}
+
+
+ )}
+
@@ -431,6 +448,24 @@ export default function Me() {
{open}
+
+
+ {me('importLists', 'Import lists')}
+
+ {me(
+ 'importListsHelp',
+ 'IMDb watchlists, Goodreads and Hardcover shelves'
+ )}
+
+
+
+ {open}
+
+
{user && (
@@ -442,7 +477,7 @@ export default function Me() {
/>
)}
-
+
@@ -471,9 +506,17 @@ export default function Me() {
-
+
-
+ {extras.list.some((extra) => extra.key === 'music') && (
+
+ )}
+
+
)}
-
+
-
+
{(Object.keys(DISCOVER_ROWS) as DiscoverRow[])
.filter(
@@ -562,7 +605,7 @@ export default function Me() {
>
{me('resetDefaults', 'Reset to defaults')}
-
+
{askReset && (
)}
-
+
@@ -623,7 +666,7 @@ export default function Me() {
)}
-
+
: null;
+ // both qualities on the server: one chip says so instead of two
+ const bothOnServer =
+ visibleStatus?.k === 'ok' &&
+ visible4k &&
+ !shared4k &&
+ s4k !== MediaStatus.PARTIAL;
return (
}
+ overview={
+ m.overview ? (
+ <>
+ {m.tagline && {m.tagline} }
+ {m.overview}
+ >
+ ) : (
+ t('lumen.detail.overviewUnavailable', 'Overview unavailable')
+ )
+ }
status={visibleStatus}
backdrop={tmdbImg(m.backdropPath, 'w1280')}
poster={tmdbImg(m.posterPath)}
@@ -411,86 +428,102 @@ export default function MovieDetail() {
)}
- {visibleStatus && (
-
-
-
- )}
- {visible4k && (
-
- {shared4k
- ? `4K · ${t('lumen.status.shared', 'Available to Other Users')}`
- : s4k === MediaStatus.PARTIAL
- ? `4K · ${t(
- 'lumen.status.partlyOnServer',
- 'Partly on {server}',
- {
+
+ {bothOnServer ? (
+
+ ·{' '}
+ {t('lumen.status.hdAnd4k', 'HD + 4K')}
+
+ ) : (
+ visibleStatus && (
+
+
+
+ )
+ )}
+ {visible4k && !bothOnServer && (
+
+ {shared4k
+ ? `4K · ${t('lumen.status.shared', 'Available to Other Users')}`
+ : s4k === MediaStatus.PARTIAL
+ ? `4K · ${t(
+ 'lumen.status.partlyOnServer',
+ 'Partly on {server}',
+ {
+ server: serverName,
+ }
+ )}`
+ : t('lumen.status.on4kServer', '4K on {server}', {
server: serverName,
- }
- )}`
- : t('lumen.status.on4kServer', '4K on {server}', {
- server: serverName,
- })}
-
- )}
- {(s4k === MediaStatus.PENDING || s4k === MediaStatus.PROCESSING) && (
-
- {progress4k ? (
- <>
- 4K ·
- >
- ) : (
- <>4K · {t('lumen.movie.fact.requested', 'Requested')}>
+ })}
+
+ )}
+ {(s4k === MediaStatus.PENDING ||
+ s4k === MediaStatus.PROCESSING) && (
+
+ {progress4k ? (
+ <>
+ 4K ·
+ >
+ ) : (
+ <>4K · {t('lumen.movie.fact.requested', 'Requested')}>
+ )}
+
+ )}
+
+
+
+
+ {m.mediaInfo?.id &&
+ user &&
+ canRequestMovies(user.permissions) &&
+ canPlaySelectedQuality &&
+ (!selected4k ||
+ (visible4k && !!pub?.movie4kEnabled && can4k)) && (
+
)}
-
- )}
-
-
-
-
-
+
+
+
+
- {m.mediaInfo?.id &&
- user &&
- canRequestMovies(user.permissions) &&
- canPlaySelectedQuality &&
- (!selected4k || (visible4k && !!pub?.movie4kEnabled && can4k)) && (
-
- )}
{m.mediaInfo?.id && canManageRequests(user?.permissions) && (
@@ -532,27 +565,11 @@ export default function MovieDetail() {
)}
- {m.tagline &&
{m.tagline}
}
-
- {m.overview ||
- t('lumen.detail.overviewUnavailable', 'Overview unavailable')}
-
-
-
-
{(fourK || trailerBtn) && (
@@ -565,118 +582,142 @@ export default function MovieDetail() {
- (
-
- {index > 0 && ', '}
- {Number.isSafeInteger(id) &&
- id > 0 &&
- id <= 1_000_000_000 ? (
- {name}
- ) : (
- name
- )}
-
- ))
- : null,
- ],
- [t('lumen.movie.fact.status', 'Status'), m.status],
- [t('lumen.movie.fact.runtime', 'Runtime'), fmtRun(m.runtime)],
- [
- t('lumen.movie.fact.budget', 'Budget'),
- movieCurrency(m.budget, locale),
- ],
- [
- t('lumen.movie.fact.revenue', 'Revenue'),
- movieCurrency(m.revenue, locale),
- ],
- [
- releaseDates.size > 1
- ? t('lumen.movie.fact.releaseDates', 'Release Dates')
- : t('lumen.movie.fact.released', 'Released'),
- releaseDates.size
- ? [...releaseDates.values()].map(
- ({ label, date }, index) => (
-
- {index > 0 && }
- {label} · {shortDate(date, false, locale)},{' '}
- {date.slice(0, 4)}
+
+ (
+
+ {index > 0 && ', '}
+ {Number.isSafeInteger(id) &&
+ id > 0 &&
+ id <= 1_000_000_000 ? (
+ {name}
+ ) : (
+ name
+ )}
+ ))
+ : null,
+ ],
+ [t('lumen.movie.fact.status', 'Status'), m.status],
+ [
+ t('lumen.movie.fact.runtime', 'Runtime'),
+ fmtRun(m.runtime),
+ ],
+ [
+ t('lumen.movie.fact.budget', 'Budget'),
+ movieCurrency(m.budget, locale),
+ ],
+ [
+ t('lumen.movie.fact.revenue', 'Revenue'),
+ movieCurrency(m.revenue, locale),
+ ],
+ [
+ releaseDates.size > 1
+ ? t('lumen.movie.fact.releaseDates', 'Release Dates')
+ : t('lumen.movie.fact.released', 'Released'),
+ releaseDates.size
+ ? [...releaseDates.values()].map(
+ ({ label, date }, index) => (
+
+ {index > 0 && }
+ {label} · {shortDate(date, false, locale)},{' '}
+ {date.slice(0, 4)}
+
+ )
)
- )
- : date
- ? `${shortDate(date, false, locale)}, ${date.slice(0, 4)}`
- : '',
- ],
- [t('lumen.movie.fact.director', 'Director'), director],
- [
- t('components.MovieSummaryCard.screenplay', 'Screenplay'),
- screenplay && (
-
- {screenplay.name}
-
- ),
- ],
- [t('lumen.movie.fact.rated', 'Rated'), certification],
- [
- t('lumen.movie.fact.collection', 'Collection'),
- m.collection && (
-
- {m.collection.name}
-
+ : date
+ ? `${shortDate(date, false, locale)}, ${date.slice(0, 4)}`
+ : '',
+ ],
+ [t('lumen.movie.fact.director', 'Director'), director],
+ [
+ t('components.MovieSummaryCard.screenplay', 'Screenplay'),
+ screenplay && (
+
+ {screenplay.name}
+
+ ),
+ ],
+ [t('lumen.movie.fact.rated', 'Rated'), certification],
+ [
+ t('lumen.movie.fact.collection', 'Collection'),
+ m.collection && (
+
+ {m.collection.name}
+
+ ),
+ ],
+ ...videoMetadataRows(
+ m.metadataSources,
+ m.supplementalMetadata,
+ (m.credits?.crew ?? []).map(({ name }) => name),
+ locale,
+ t
),
- ],
- ...videoMetadataRows(
- m.metadataSources,
- m.supplementalMetadata,
- (m.credits?.crew ?? []).map(({ name }) => name),
- locale,
- t
- ),
- [
- '4K',
- pub?.movie4kEnabled
- ? available4k
- ? visible4k
- ? fourKLabel
- : ''
- : has4k
- ? t('lumen.movie.fact.requested', 'Requested')
- : t('lumen.movie.fact.notYet', 'Not yet')
- : '',
- ],
- ]}
+ [
+ '4K',
+ pub?.movie4kEnabled
+ ? available4k
+ ? visible4k
+ ? fourKLabel
+ : ''
+ : has4k
+ ? t('lumen.movie.fact.requested', 'Requested')
+ : t('lumen.movie.fact.notYet', 'Not yet')
+ : '',
+ ],
+ ]}
+ />
+
+
@@ -718,12 +759,15 @@ export default function MovieDetail() {
>
{m.mediaInfo?.id && canManageRequests(user?.permissions) && (
setManageOpen(true)}
>
- {t('lumen.manageVideo.open', 'Manage')}
+
+ {t('lumen.manageVideo.open', 'Manage')}
+
)}
{main}
diff --git a/lumen/src/pages/Music.tsx b/lumen/src/pages/Music.tsx
index 25e2e2e..31b8397 100644
--- a/lumen/src/pages/Music.tsx
+++ b/lumen/src/pages/Music.tsx
@@ -33,6 +33,7 @@ import {
type QualityStatus,
type Stat,
} from '../components/cards';
+import { ClampText } from '../components/ClampText';
import { ConfirmSheet } from '../components/ConfirmSheet';
import {
AdvancedOptions,
@@ -58,6 +59,7 @@ import FollowButton from '../components/FollowButton';
import { GenrePicker } from '../components/GenrePicker';
import IndexerSearchLink from '../components/IndexerSearchLink';
import { ManageMediaAction } from '../components/ManageMediaSheet';
+import { MoreActions } from '../components/MoreActions';
import MusicEditionCompare from '../components/MusicEditionCompare';
import {
ActivityTab,
@@ -71,7 +73,6 @@ import {
} from '../components/MusicHome';
import {
PlayButton,
- PlayOpensIn,
PreviewButton,
useMusicPlayer,
} from '../components/MusicPlayback';
@@ -92,6 +93,11 @@ import {
YourMusicRequests,
} from '../components/MusicSections';
import OpenIssueReports from '../components/OpenIssueReports';
+import {
+ PhoneFilterBar,
+ usePhone,
+ type AppliedFilter,
+} from '../components/PhoneFilters';
import ReportIssueButton from '../components/ReportIssueButton';
import { useToast } from '../components/toast';
import WatchlistButton from '../components/WatchlistButton';
@@ -975,6 +981,7 @@ const isSearchable = (term: string) =>
term.length >= 2 || /[^\u0020-\u024f]/u.test(term);
export function Music() {
+ const phone = usePhone();
const { t, locale } = useLumenLocale();
const navigate = useNavigate();
const releaseTypeOptions = RELEASE_TYPES.map(({ value, label }) => ({
@@ -1057,13 +1064,6 @@ export function Music() {
const catalogParam = p.get('catalog');
const catalogOpen =
catalogParam === '1' || (catalogParam !== '0' && catalogAsked);
- const setCatalogOpen = (open: boolean) => {
- if (open === catalogOpen) return;
- const next = new URLSearchParams(p);
- if (open === catalogAsked) next.delete('catalog');
- else next.set('catalog', open ? '1' : '0');
- setP(next, { replace: true });
- };
const upd = (k: string, v: string) => {
const n = new URLSearchParams(p);
@@ -1298,130 +1298,211 @@ export function Music() {
? wantedSearchTab
: 'all';
- const renderCatalogBrowser = () => (
- <>
-
+ const catalogSort = (
+
+ {t('lumen.music.sort', 'Sort')}
+ upd('sort', e.target.value)}>
+ {SORTS.map(([v, key, fallback]) => (
+
+ {t(key, fallback)}
+
+ ))}
+
+
+ );
+ const catalogTypes = (
+ upd('type', value.join(','))}
+ />
+ );
+ const catalogMore = (
+ 0 && (catalogOpen || !showingAurralDiscovery)) ||
+ undefined
+ }
+ >
+ {t('lumen.browse.moreFilters', 'More Filters')}
+
-
0 || undefined}
- >
- {t('lumen.browse.moreFilters', 'More Filters')}
-
-
+ )}
+ {filters.has('artistId') && (
+
upd('artistId', '')}
+ >
+ {t('lumen.music.clearExactArtist', 'Clear Exact Artist')}
+
+ )}
+ {filters.size > 0 && (
+
{
+ const next = new URLSearchParams(p);
+ for (const key of filters.keys()) next.delete(key);
+ setP(next, { replace: true });
+ }}
+ >
+ {t('lumen.music.clearFilters', 'Clear Music Filters')}
+
+ )}
+
+
+ );
+ // Discover's list view: back to the rows clears what opened it
+ const closeCatalog = () => {
+ const next = new URLSearchParams(p);
+ for (const key of [
+ 'sort',
+ 'sortBy',
+ 'type',
+ 'releaseType',
+ 'catalog',
+ ...filters.keys(),
+ ])
+ next.delete(key);
+ setP(next, { replace: true });
+ };
+ const catalogChips: AppliedFilter[] = [];
+ if (phone) {
+ if (showingAurralDiscovery && catalogOpen)
+ catalogChips.push({
+ key: 'catalog',
+ label: t('lumen.music.browseCatalog', 'Browse catalog'),
+ aria: t('lumen.music.backToDiscover', 'Back to Discover'),
+ remove: closeCatalog,
+ });
+ for (const [key, value] of filters) {
+ // Your genres shows its own pick on Discover's rows
+ if (key === 'genre' && showingAurralDiscovery && !catalogOpen) continue;
+ const field = MUSIC_FILTERS.find((item) => item.key === key);
+ const label = field
+ ? `${t(field.label, field.fallback)}: ${value}`
+ : key === 'artistId'
+ ? t('lumen.music.clearExactArtist', 'Clear Exact Artist')
+ : key === 'availability'
+ ? value.toUpperCase()
+ : `${key}: ${value}`;
+ catalogChips.push({
+ key,
+ label,
+ aria:
+ key === 'genre'
+ ? t('lumen.music.clearGenre', 'Clear Genre: {genre}', {
+ genre: value,
+ })
+ : undefined,
+ remove: () => upd(key, ''),
+ });
+ }
+ }
+ const renderCatalogControls = () => (
+ <>
+ {phone ? (
+
+ {catalogSort}
+
+ ) : (
+ <>
+
+ {catalogSort}
+ {catalogTypes}
+ {showingAurralDiscovery && catalogOpen && (
+
+ {t('lumen.music.backToDiscover', 'Back to Discover')}
+
+ )}
+
+ {catalogMore}
+ >
+ )}
+ >
+ );
+ const renderCatalogResults = () => (
+ <>
>
);
+ const renderCatalogBrowser = () => (
+ <>
+ {renderCatalogControls()}
+ {renderCatalogResults()}
+ >
+ );
const shortcuts = (
>
)}
- {aurralAvailable &&
}
);
@@ -1986,6 +2072,7 @@ export function Music() {
>
{homeTab === 'discover' && (
<>
+ {renderCatalogControls()}
{recent.length > 0 && (
)}
- {aurralTrending.error && !aurralTrending.data && (
-
- )}
+ {!catalogOpen && (
+ <>
+ {aurralTrending.error && !aurralTrending.data && (
+
+ )}
- {trendingAlbums.length > 0 && (
-
-
- {trendingAlbums.map((album, index) => (
-
- ))}
-
-
- )}
+ {trendingAlbums.length > 0 && (
+
+
+ {trendingAlbums.map((album, index) => (
+
+ ))}
+
+
+ )}
- {trendingTracks.length > 0 && (
-
- )}
- {!aurralTrending.data && !aurralTrending.error && (
-
-
-
-
- )}
+ {trendingTracks.length > 0 && (
+
+ )}
+ {!aurralTrending.data && !aurralTrending.error && (
+
+
+
+
+ )}
-
+
-
+
-
+
- {(genreTags.length > 0 || selectedGenre) && (
-
pickGenre('')}
- >
- {t('lumen.music.clearGenre', 'Clear genre')}
-
- ) : undefined
- }
- >
-
- {genreTags.slice(0, 16).map((tag) => (
-
- pickGenre(selectedGenre === tag ? '' : tag)
- }
+ {(genreTags.length > 0 || selectedGenre) && (
+ pickGenre('')}
+ >
+ {t('lumen.music.clearGenre', 'Clear genre')}
+
+ ) : undefined
+ }
+ >
+
- {genreLabel(tag)}
-
- ))}
-
- {selectedGenre && (
-
-
{genreLabel(selectedGenre)}
- {!aurralGenreArtists.data &&
- !aurralGenreArtists.error &&
}
- {aurralGenreArtists.error && (
-
- )}
- {aurralGenreArtists.data &&
- (genreArtists.length > 0 ? (
-
- {genreArtists.map((artist, index) => (
-
- ))}
-
- ) : (
-
- {t(
- 'lumen.music.noGenreMatches',
- 'No artists found for this genre.'
- )}
-
+ {genreTags.slice(0, 16).map((tag) => (
+
+ pickGenre(selectedGenre === tag ? '' : tag)
+ }
+ >
+ {genreLabel(tag)}
+
))}
-
+
+ {selectedGenre && (
+
+
{genreLabel(selectedGenre)}
+ {!aurralGenreArtists.data &&
+ !aurralGenreArtists.error && (
+
+ )}
+ {aurralGenreArtists.error && (
+
+ )}
+ {aurralGenreArtists.data &&
+ (genreArtists.length > 0 ? (
+
+ {genreArtists.map((artist, index) => (
+
+ ))}
+
+ ) : (
+
+ {t(
+ 'lumen.music.noGenreMatches',
+ 'No artists found for this genre.'
+ )}
+
+ ))}
+
+ )}
+
)}
-
- )}
-
-
- {aurralBase && (
-
{
- if (event.metaKey || event.ctrlKey || event.shiftKey)
- return;
- event.preventDefault();
- openPlayer(`${aurralBase}/flows`);
- }}
- >
-
-
- {t(
- 'lumen.music.madeForYou',
- 'Made for you in Aurral'
- )}
-
-
- {t(
- 'lumen.music.madeForYouHelp',
- 'Your mixes, Discover Weekly and Release Radar live in Aurral and download their own songs.'
- )}
-
-
-
-
- )}
+
-
- setCatalogOpen(event.currentTarget.open)
- }
- >
-
- {t('lumen.music.browseCatalog', 'Browse catalog')}
-
- {renderCatalogBrowser()}
-
+ {aurralBase && (
+
{
+ if (
+ event.metaKey ||
+ event.ctrlKey ||
+ event.shiftKey
+ )
+ return;
+ event.preventDefault();
+ openPlayer(`${aurralBase}/flows`);
+ }}
+ >
+
+
+ {t(
+ 'lumen.music.madeForYou',
+ 'Made for you in Aurral'
+ )}
+
+
+ {t(
+ 'lumen.music.madeForYouHelp',
+ 'Your mixes, Discover Weekly and Release Radar live in Aurral and download their own songs.'
+ )}
+
+
+
+
+ )}
+ >
+ )}
+ {catalogOpen && renderCatalogResults()}
>
)}
@@ -2240,6 +2329,9 @@ function useAurralConfigured() {
return !user || (servicesSettled && statusSettled) ? false : undefined;
}
+// songs shown before All N songs on a long album
+const TRACK_PREVIEW = 10;
+
export function AlbumDetail() {
const { id } = useParams();
const { user } = useAuth();
@@ -2256,6 +2348,7 @@ export function AlbumDetail() {
const ALBUM_PENDING_POLL_MS = 15_000;
function AlbumDetailPage() {
+ const phone = usePhone();
const { t, locale } = useLumenLocale();
const { id } = useParams();
const { user } = useAuth();
@@ -2279,6 +2372,8 @@ function AlbumDetailPage() {
);
const { previews } = useMusicPlayer();
// every song asked for and not answered yet stays busy, however many are tapped
+ // long albums show their first songs; All N songs opens the rest in place
+ const [allTracks, setAllTracks] = useState(false);
const [requestingTracks, setRequestingTracks] = useState
>(
() => new Set()
);
@@ -2680,6 +2775,7 @@ function AlbumDetailPage() {
/>
)}
@@ -2770,52 +2867,8 @@ function AlbumDetailPage() {
{aurralConfigured === false && main && (
{main}
)}
- {artistContributors.length > 0 && (
-
-
- {artistContributors.map((artist) => (
-
- {artist.name} · {artist.role}
-
- ))}
-
-
- )}
-
- {musicTags.length > 0 ? (
-
- {musicTags.map(({ tag }) => (
-
- {tag}
-
- ))}
-
- ) : (
-
- {t('lumen.detail.noSubjectTags', 'No subject tags.')}
-
- )}
-
-
-
+ {!phone &&
}
+
)}
- {a.tracks.map((track, index) => {
+ {(allTracks || a.tracks.length <= TRACK_PREVIEW + 2
+ ? a.tracks
+ : a.tracks.slice(0, TRACK_PREVIEW)
+ ).map((track, index) => {
const key =
track.recordingMbid ||
`${track.position}:${track.name}`;
@@ -2945,14 +3001,10 @@ function AlbumDetailPage() {
)}
/>
)}
- {canRequestTrack && (
- void requestTrack(track)}
- >
- {busy
+ {canRequestTrack &&
+ (() => {
+ // a small icon button; the state is its name
+ const label = busy
? t(
'lumen.music.requestingTrack',
'Requesting…'
@@ -2970,9 +3022,30 @@ function AlbumDetailPage() {
: t(
'lumen.music.getSong',
'Get song'
- )}
-
- )}
+ );
+ return (
+
+ void requestTrack(track)
+ }
+ >
+
+
+ );
+ })()}
>
)}
@@ -2981,74 +3054,145 @@ function AlbumDetailPage() {
);
})}
+ {a.tracks.length > TRACK_PREVIEW + 2 && (
+ setAllTracks(!allTracks)}
+ >
+ {allTracks
+ ? t('lumen.detail.showLess', 'Show less')
+ : t('lumen.music.allSongs', 'All {count} songs', {
+ count: a.tracks.length,
+ })}
+
+ )}
>
)}
-
+ {/* one box after the songs: the album facts, its artists and its tags */}
-
+
+ {a.id}
+
+ ) : (
+ ''
+ ),
+ ],
+ [
+ t('lumen.music.fact.artist', 'Artist'),
+
- {a.id}
-
- ) : (
- ''
- ),
- ],
- [
- t('lumen.music.fact.artist', 'Artist'),
-
- {a.artist.name}
- ,
- ],
- [t('lumen.music.fact.released', 'Released'), a.releaseDate],
- [t('lumen.music.fact.label', 'Label'), a.recordLabel],
- [
- t(
- 'components.MusicDetails.Layout.artistType',
- 'Artist Type'
- ),
- a.artist.type,
- ],
- [
- t('components.MusicDetails.Layout.origin', 'Origin'),
- a.artist.area ? (
- ,
+ ],
+ [
+ t('lumen.music.fact.released', 'Released'),
+ a.releaseDate,
+ ],
+ [t('lumen.music.fact.label', 'Label'), a.recordLabel],
+ [
+ t(
+ 'components.MusicDetails.Layout.artistType',
+ 'Artist Type'
+ ),
+ a.artist.type,
+ ],
+ [
+ t('components.MusicDetails.Layout.origin', 'Origin'),
+ a.artist.area ? (
+
+ {a.artist.area}
+
+ ) : (
+ ''
+ ),
+ ],
+ [t('lumen.music.fact.type', 'Type'), a.type],
+ ]}
+ />
+
+ {artistContributors.length > 0 && (
+
+
+ {artistContributors.map((artist) => (
+
- {a.artist.area}
-
- ) : (
- ''
- ),
- ],
- [t('lumen.music.fact.type', 'Type'), a.type],
- ]}
- />
+ {artist.name} · {artist.role}
+
+ ))}
+
+
+ )}
+
+ {musicTags.length > 0 ? (
+
+ {musicTags.map(({ tag }) => (
+
+ {tag}
+
+ ))}
+
+ ) : (
+
+ {t('lumen.detail.noSubjectTags', 'No subject tags.')}
+
+ )}
+
@@ -3291,29 +3435,31 @@ export function Artist() {
)}
)}
-
- {t('lumen.music.viewDiscography', 'View Discography')}
-
-
- {t('lumen.music.filterByArtist', 'Filter Music by Artist')}
-
-
-
+
+
+ {t('lumen.music.viewDiscography', 'View Discography')}
+
+
+ {t('lumen.music.filterByArtist', 'Filter Music by Artist')}
+
+
+
+
{(a.wikipedia?.content || a.wikipedia?.extract) && (
- {a.wikipedia.content || a.wikipedia.extract}
+ {a.wikipedia.content || a.wikipedia.extract}
)}
{topTracks.length > 0 && (
diff --git a/lumen/src/pages/People.tsx b/lumen/src/pages/People.tsx
index 216c1d3..b222ed9 100644
--- a/lumen/src/pages/People.tsx
+++ b/lumen/src/pages/People.tsx
@@ -16,6 +16,9 @@ import { useLumenLocale } from '../i18n';
import { Icon } from '../icons';
import { sessionGeneration } from '../sessionState';
+// credits shown per group before Show all
+const CREDIT_PREVIEW = 12;
+
export function PersonCard({ person }: { person: TitleResult }) {
const { t } = useLumenLocale();
const image = tmdbImg(person.profilePath);
@@ -156,6 +159,8 @@ function Filmography({
const { t } = useLumenLocale();
const [filter, setFilter] = useState('all');
const [sort, setSort] = useState('voteCount.desc');
+ // a long filmography shows its first titles; Show all opens the rest in place
+ const [opened, setOpened] = useState([]);
const creditSorts = [
['voteCount', t('lumen.people.votes', 'Votes')],
['popularity', t('lumen.people.popularity', 'Popularity')],
@@ -253,7 +258,10 @@ function Filmography({
entries.length > 0 && (
- {entries.map(({ title, roles }) => (
+ {(opened.includes(label) || entries.length <= CREDIT_PREVIEW + 2
+ ? entries
+ : entries.slice(0, CREDIT_PREVIEW)
+ ).map(({ title, roles }) => (
))}
+ {entries.length > CREDIT_PREVIEW + 2 &&
+ !opened.includes(label) && (
+ setOpened((list) => [...list, label])}
+ >
+ {t('lumen.detail.showAllCount', 'Show all ({count})', {
+ count: entries.length,
+ })}
+
+ )}
)
)}
@@ -410,8 +430,10 @@ export default function PersonDetail() {
? `/person/${id}`
: null;
const person = useApi(path);
+ // kept while it refreshes, so the bulk request's result (in the header) stays on screen
const credits = useApi(
- path ? `${path}/combined_credits` : null
+ path ? `${path}/combined_credits` : null,
+ { keepDuringRefresh: true }
);
const movieIds = [
diff --git a/lumen/src/pages/Requests.tsx b/lumen/src/pages/Requests.tsx
index 3acfe0a..d3b853c 100644
--- a/lumen/src/pages/Requests.tsx
+++ b/lumen/src/pages/Requests.tsx
@@ -30,6 +30,11 @@ import {
Pill,
} from '../components/detail';
import { songArt } from '../components/MusicSections';
+import {
+ PhoneFilterBar,
+ usePhone,
+ type AppliedFilter,
+} from '../components/PhoneFilters';
import { RequestEditSheet } from '../components/requestEdit';
import RequestEpisodeQueueSheet, {
canEditEpisodeQueue,
@@ -1542,6 +1547,7 @@ function normalizeClassicRequestFilters(params: URLSearchParams) {
}
export default function Requests() {
+ const phone = usePhone();
const { t, locale } = useLumenLocale();
const serverName = useMediaServerName();
const { user } = useAuth();
@@ -2454,6 +2460,186 @@ export default function Requests() {
);
};
+ const requestFilters = (
+ <>
+ setRequestFilter('requestedBy', value)}
+ />
+ {show !== 'software' && (
+ <>
+
+
+ {t('components.Requests.mediaType', 'Media Type')}
+
+
+ setRequestFilter('mediaType', event.target.value)
+ }
+ >
+ {mediaTypes.map(([value, label, message]) => (
+
+ {t(message, label)}
+
+ ))}
+
+
+ {mediaType === 'book' && (
+
+
+ {t('components.Requests.format', 'Format')}
+
+
+ setRequestFilter('bookFormat', event.target.value)
+ }
+ >
+
+ {t('lumen.requests.filters.allFormats', 'All formats')}
+
+
+ {t('components.Requests.ebook', 'Book')}
+
+
+ {t('lumen.requests.filters.audiobook', 'Audiobook')}
+
+
+
+ )}
+
+
+ {t('components.Requests.sortBy', 'Sort By')}
+
+
+ setRequestFilter('order', event.target.value)
+ }
+ >
+ {REQUEST_SORTS.map(([value, label, message]) => (
+
+ {t(message, label)}
+
+ ))}
+
+
+
+
+ {t('lumen.requests.filters.dateAdded', 'Date Added')}
+
+
+ setRequestFilter('timeFrame', event.target.value)
+ }
+ >
+ {REQUEST_TIME_FRAMES.map(([value, label, message]) => (
+
+ {t(message, label)}
+
+ ))}
+
+
+
+ >
+ )}
+ >
+ );
+ const whichChips = (
+
+ {EVERYONE_FILTERS.map(([v, label, key, translationKey]) => (
+ setRequestFilter('show', v)}
+ >
+ {t(translationKey, label)}
+ {!mediaQuery && counts?.[key] != null && (
+ {counts[key]}
+ )}
+
+ ))}
+
+ );
+ const requestChips: AppliedFilter[] = [];
+ if (phone && everyone) {
+ const chip = (key: string, label: string) =>
+ requestChips.push({
+ key,
+ label,
+ remove: () => setRequestFilter(key, key === 'search' ? '' : 'all'),
+ });
+ if (p.has('requestedBy'))
+ chip('requestedBy', t('lumen.requests.filters.requester', 'Requester'));
+ if (show !== 'software') {
+ const type = mediaTypes.find(([value]) => value === mediaType);
+ if (p.has('mediaType') && type) chip('mediaType', t(type[2], type[1]));
+ if (bookFormat !== 'all')
+ chip(
+ 'bookFormat',
+ bookFormat === 'audiobook'
+ ? t('lumen.requests.filters.audiobook', 'Audiobook')
+ : t('components.Requests.ebook', 'Book')
+ );
+ const frame = REQUEST_TIME_FRAMES.find(([value]) => value === timeFrame);
+ if (p.has('timeFrame') && frame) chip('timeFrame', t(frame[2], frame[1]));
+ if (search) chip('search', `“${search}”`);
+ }
+ }
return (
<>
@@ -2464,7 +2650,7 @@ export default function Requests() {
-
+
{ownSoftware
? t(
'lumen.requests.page.softwareSubtitle',
@@ -2592,165 +2778,30 @@ export default function Requests() {
)}
- {everyone && (
-
- {EVERYONE_FILTERS.map(([v, label, key, translationKey]) => (
- setRequestFilter('show', v)}
- >
- {t(translationKey, label)}
- {!mediaQuery && counts?.[key] != null && (
- {counts[key]}
- )}
-
- ))}
-
- )}
- {everyone && (
-
-
setRequestFilter('requestedBy', value)}
- />
- {show !== 'software' && (
- <>
-
-
- {t('components.Requests.mediaType', 'Media Type')}
-
-
- setRequestFilter('mediaType', event.target.value)
- }
- >
- {mediaTypes.map(([value, label, message]) => (
-
- {t(message, label)}
-
- ))}
-
-
- {mediaType === 'book' && (
-
-
- {t('components.Requests.format', 'Format')}
-
-
- setRequestFilter('bookFormat', event.target.value)
- }
- >
-
- {t('lumen.requests.filters.allFormats', 'All formats')}
-
-
- {t('components.Requests.ebook', 'Book')}
-
-
- {t('lumen.requests.filters.audiobook', 'Audiobook')}
-
-
-
+ {everyone &&
+ (phone ? (
+
+ {requestFilters}
+
+ ) : (
+ <>
+ {whichChips}
+
-
- {t('components.Requests.sortBy', 'Sort By')}
-
-
- setRequestFilter('order', event.target.value)
- }
- >
- {REQUEST_SORTS.map(([value, label, message]) => (
-
- {t(message, label)}
-
- ))}
-
-
-
-
- {t('lumen.requests.filters.dateAdded', 'Date Added')}
-
-
- setRequestFilter('timeFrame', event.target.value)
- }
- >
- {REQUEST_TIME_FRAMES.map(([value, label, message]) => (
-
- {t(message, label)}
-
- ))}
-
-
-
- >
- )}
-
- )}
+ >
+ {requestFilters}
+
+ >
+ ))}
{softwareView && (
{detail}}
-
- {x.r.id !== 0 && !x.trackRequest && (
- setP(historyParams(x.r.id))}
- >
- {t('lumen.requests.actions.history', 'History')}
-
- )}
- {renderRequestActions(x, everyone && manage)}
-
+
+ {/* the actions run under the whole row, not down the narrow text column */}
+
+ {x.r.id !== 0 && !x.trackRequest && (
+ setP(historyParams(x.r.id))}
+ >
+ {t('lumen.requests.actions.history', 'History')}
+
+ )}
+ {renderRequestActions(x, everyone && manage)}
);
diff --git a/lumen/src/pages/Search.tsx b/lumen/src/pages/Search.tsx
index 3a2e4dd..c396300 100644
--- a/lumen/src/pages/Search.tsx
+++ b/lumen/src/pages/Search.tsx
@@ -27,6 +27,7 @@ import {
MagazineCard,
ServiceNote,
} from '../components/extra';
+import { usePhone } from '../components/PhoneFilters';
import { friendlyError } from '../errors';
import {
artistOf,
@@ -259,6 +260,7 @@ function SearchResults({
p: URLSearchParams;
setP: ReturnType[1];
}) {
+ const phone = usePhone();
const { t } = useLumenLocale();
const scopeName = (scope: Scope) =>
t(`lumen.search.scope.${scopeMessageKeys[scope]}`, SCOPES[scope]);
@@ -275,6 +277,7 @@ function SearchResults({
const [totalPages, setTotalPages] = useState(1);
const [searching, setSearching] = useState(false);
const [searchError, setSearchError] = useState(null);
+ const [failedSources, setFailedSources] = useState([]);
const lastReply = useRef(null);
const retryReply = useRef(null);
const [attempt, setAttempt] = useState(0);
@@ -452,6 +455,8 @@ function SearchResults({
: [format];
let error: string | null = null;
let catalogueUnavailable = false;
+ // which kinds of results a provider failed to give (for the quiet note under the results)
+ const failed = new Set<'titles' | 'books' | 'comics'>();
const failure = (e: unknown) => {
error = friendlyError(e, t('lumen.search.failed', 'Search failed'));
return null;
@@ -459,7 +464,10 @@ function SearchResults({
const comicsAsk = wantComics
? cachedApi>(
`/discover/comics?query=${encodeURIComponent(term)}&group=works&page=${resultPage}`
- ).catch(failure)
+ ).catch((e: unknown) => {
+ failed.add('comics');
+ return failure(e);
+ })
: null;
const [tr, ...brs] = await Promise.all([
wantsTitles
@@ -467,7 +475,10 @@ function SearchResults({
reusable.session === session &&
reusable.generation === generation
? reusable.page
- : api(titlePath).catch(failure)
+ : api(titlePath).catch((e: unknown) => {
+ failed.add('titles');
+ return failure(e);
+ })
: null,
...formats.map((fmt) =>
wantBooks
@@ -476,6 +487,7 @@ function SearchResults({
).catch((e: unknown) => {
catalogueUnavailable ||=
e instanceof ApiError && e.status >= 500;
+ failed.add('books');
return failure(e);
})
: null
@@ -550,6 +562,8 @@ function SearchResults({
setTitles(foundTitles);
setBooks(foundBooks);
setComics(foundComics);
+ if (tr?.partial) failed.add('titles');
+ setFailedSources([...failed]);
setSearchError(
error ??
(tr?.partial
@@ -760,8 +774,39 @@ function SearchResults({
{t('lumen.search.software', 'Software')}
)}
+ {phone && hasSearch && (
+
+ {
+ const next = new URLSearchParams(p);
+ next.delete('sort');
+ next.delete('order');
+ const [field, order] = event.target.value.split(':');
+ if (field) next.set('sort', field);
+ if (order) next.set('order', order);
+ setP(next, { replace: true });
+ }}
+ >
+
+ {t('lumen.search.bestMatch', 'Best Match')}
+
+ {sortOptions.map(({ field, asc, desc }) => (
+
+
+ {sortMessage(field, 'asc', asc)}
+
+
+ {sortMessage(field, 'desc', desc)}
+
+
+ ))}
+
+
+ )}
- {hasSearch && (
+ {hasSearch && !phone && (
@@ -816,12 +861,6 @@ function SearchResults({
)}
- {hasSearch &&
- (f === 'all' ||
- f === 'movie' ||
- f === 'tv' ||
- f === 'ebook' ||
- f === 'audio') &&
}
{!hasSearch && !!recent.length && (
)}
- {!searching && (
+ {!searching && nothing && (
)}
- {showSeries && seriesTerm === term0 && (
-
- )}
{
@@ -1093,6 +1117,59 @@ function SearchResults({
)}
+ {/* some providers failed but others answered: one quiet line, not an error card */}
+ {!searching && !nothing && searchError && (
+
+ {t(
+ 'lumen.search.someSourcesFailed',
+ 'Some sources didn’t answer ({sources}).',
+ {
+ sources:
+ failedSources
+ .map((source) =>
+ source === 'books'
+ ? t('lumen.search.source.books', 'Books')
+ : source === 'comics'
+ ? t('lumen.search.source.comics', 'Comics')
+ : t(
+ 'lumen.search.source.titles',
+ 'Movies, series and music'
+ )
+ )
+ .join(', ') ||
+ t('lumen.search.source.some', 'some providers'),
+ }
+ )}{' '}
+ {
+ retryReply.current = lastReply.current;
+ setAttempt((n) => n + 1);
+ }}
+ >
+ {t('lumen.search.retry', 'Retry')}
+
+
+ )}
+ {showSeries && seriesTerm === term0 && (
+
+ )}
{hasSearch && (resultPage > 1 || totalPages > 1) && (
}
+ overview={
+ t.overview ||
+ translate('lumen.detail.overviewUnavailable', 'Overview unavailable')
+ }
status={visibleStatus}
backdrop={tmdbImg(t.backdropPath, 'w1280')}
poster={tmdbImg(t.posterPath)}
@@ -689,82 +693,86 @@ export default function TvDetail() {
retry={reload}
/>
- {episodeQueue && (
-
0 ? 'ok' : 'neutral'}
- icon="clock"
- >
- {episodeQueue.defaultEpisodeCount > 0
- ? translate(
- episodeQueue.defaultEpisodeCount === 1
- ? 'lumen.tv.episodeQueue.one'
- : 'lumen.tv.episodeQueue.many',
- episodeQueue.defaultEpisodeCount === 1
- ? 'Episode Queue · 1 episode set by admin'
- : 'Episode Queue · {count} episodes set by admin',
- { count: episodeQueue.defaultEpisodeCount }
- )
- : translate(
- 'lumen.tv.episodeQueue.off',
- 'Episode Queue · off · managed by admin'
- )}
-
- )}
- {watchable && (
-
- {statusLine}
-
- )}
- {mode === 'distinguish' && sharedAvailability && (
-
- {translate(
- 'lumen.tv.availableOthers',
- 'Available to Other Users'
- )}
-
- )}
- {asked > 0 && (
-
- {asked === 1
- ? translate(
- 'lumen.tv.status.seasonRequested',
- '1 season requested'
- )
- : translate(
- 'lumen.tv.status.seasonsRequested',
- '{count} seasons requested',
- { count: asked }
- )}
-
- )}
-
-
-
-
-
+
+ {episodeQueue && (
+
0 ? 'ok' : 'neutral'}
+ icon="clock"
+ >
+ {episodeQueue.defaultEpisodeCount > 0
+ ? translate(
+ episodeQueue.defaultEpisodeCount === 1
+ ? 'lumen.tv.episodeQueue.one'
+ : 'lumen.tv.episodeQueue.many',
+ episodeQueue.defaultEpisodeCount === 1
+ ? 'Episode Queue: 1 episode'
+ : 'Episode Queue: {count} episodes',
+ { count: episodeQueue.defaultEpisodeCount }
+ )
+ : translate(
+ 'lumen.tv.episodeQueue.off',
+ 'Episode Queue: off'
+ )}
+
+ )}
+ {watchable && (
+
+ {statusLine}
+
+ )}
+ {mode === 'distinguish' && sharedAvailability && (
+
+ {translate(
+ 'lumen.tv.availableOthers',
+ 'Available to Other Users'
+ )}
+
+ )}
+ {asked > 0 && (
+
+ {asked === 1
+ ? translate(
+ 'lumen.tv.status.seasonRequested',
+ '1 season requested'
+ )
+ : translate(
+ 'lumen.tv.status.seasonsRequested',
+ '{count} seasons requested',
+ { count: asked }
+ )}
+
+ )}
+
+
+
+
+
+
+
+
- {[1, 2, 3].includes(pub?.mediaServerType ?? 0) && (
-
-
- {t.mediaInfo?.id &&
- user &&
- canRequestSeries(user.permissions) &&
- watchable && (
-
- )}
-
-
-
-
- )}
{t.mediaInfo?.id && canManageRequests(user?.permissions) && (
@@ -947,7 +919,6 @@ export default function TvDetail() {
)}
-
{translate('lumen.tv.seasons', 'Seasons')}
@@ -1196,22 +1167,11 @@ export default function TvDetail() {
coverage={coverage}
/>
)}
-
-
-
{trailer && (
@@ -1223,176 +1183,238 @@ export default function TvDetail() {
- (
-
- {index > 0 && ', '}
- {Number.isSafeInteger(id) &&
- id > 0 &&
- id <= 1_000_000_000 ? (
- {name}
- ) : (
- name
- )}
-
- ))
- : null,
- ],
- [
- translate('lumen.tv.fact.firstAirDate', 'First Air Date'),
- shortDate(t.firstAirDate, true, locale),
- ],
- [
- translate('lumen.tv.fact.genres', 'Genres'),
- t.genres?.length
- ? t.genres.map(({ id, name }, index) => (
-
- {index > 0 && ', '}
- {Number.isSafeInteger(id) &&
- id > 0 &&
- id <= 1_000_000_000 ? (
- {name}
- ) : (
- name
- )}
-
- ))
- : null,
- ],
- [
- translate('lumen.tv.fact.network', 'Network'),
- t.networks?.length
- ? t.networks.map(({ id, name }, index) => (
-
- {index > 0 && ', '}
- {id &&
- Number.isSafeInteger(id) &&
- id > 0 &&
- id <= 1_000_000_000 ? (
- {name}
- ) : (
- name
- )}
-
- ))
- : null,
- ],
- [
- translate('lumen.tv.fact.seriesType', 'Series Type'),
- t.type,
- ],
- [
- translate('lumen.tv.fact.status', 'Status'),
- t.status === 'Returning Series'
- ? translate('lumen.tv.fact.stillAiring', 'Still airing')
- : ((
- {
- Planned: translate(
- 'lumen.browse.seriesStatusOption.1',
- 'Planned'
- ),
- 'In Production': translate(
- 'lumen.browse.seriesStatusOption.2',
- 'In Production'
- ),
- Ended: translate(
- 'lumen.browse.seriesStatusOption.3',
- 'Ended'
- ),
- Canceled: translate(
- 'lumen.browse.seriesStatusOption.4',
- 'Canceled'
- ),
- Pilot: translate(
- 'lumen.browse.seriesStatusOption.5',
- 'Pilot'
- ),
- } as Record
- )[t.status ?? ''] ?? t.status),
- ],
- [
- translate('lumen.tv.fact.episodeLength', 'Episode length'),
- fmtRun(t.episodeRunTime?.[0]),
- ],
- [
- translate('lumen.tv.fact.episodes', 'Episodes'),
- t.numberOfEpisodes > 0 ? t.numberOfEpisodes : null,
- ],
- [
- translate('lumen.tv.fact.createdBy', 'Created by'),
- t.createdBy?.map(({ id, name }, index) => (
-
- {index > 0 && ', '}
- {id !== undefined &&
- Number.isSafeInteger(id) &&
- id > 0 &&
- id <= 1_000_000_000 ? (
- {name}
- ) : (
- name
- )}
-
- )),
- ],
- [
- translate('lumen.tv.fact.lastAired', 'Last aired'),
- t.lastEpisodeToAir
- ? `S${t.lastEpisodeToAir.seasonNumber} E${t.lastEpisodeToAir.episodeNumber} · ${shortDate(t.lastEpisodeToAir.airDate, true, locale)}`
- : t.lastAirDate !== t.firstAirDate
- ? shortDate(t.lastAirDate, true, locale)
- : '',
- ],
- [
- translate('lumen.tv.fact.nextEpisode', 'Next episode'),
- t.nextEpisodeToAir
- ? `S${t.nextEpisodeToAir.seasonNumber} E${t.nextEpisodeToAir.episodeNumber} · ${shortDate(t.nextEpisodeToAir.airDate, true, locale)}`
- : '',
- ],
- ...videoMetadataRows(
- t.metadataSources,
- t.supplementalMetadata,
+ {[1, 2, 3].includes(pub?.mediaServerType ?? 0) && (
+
+
+ {t.mediaInfo?.id &&
+ user &&
+ canRequestSeries(user.permissions) &&
+ watchable && (
+
+ )}
+
+
+
+
+ )}
+
+ (
+
+ {index > 0 && ', '}
+ {Number.isSafeInteger(id) &&
+ id > 0 &&
+ id <= 1_000_000_000 ? (
+ {name}
+ ) : (
+ name
+ )}
+
+ ))
+ : null,
+ ],
+ [
+ translate('lumen.tv.fact.firstAirDate', 'First Air Date'),
+ shortDate(t.firstAirDate, true, locale),
+ ],
+ [
+ translate('lumen.tv.fact.genres', 'Genres'),
+ t.genres?.length
+ ? t.genres.map(({ id, name }, index) => (
+
+ {index > 0 && ', '}
+ {Number.isSafeInteger(id) &&
+ id > 0 &&
+ id <= 1_000_000_000 ? (
+ {name}
+ ) : (
+ name
+ )}
+
+ ))
+ : null,
+ ],
+ [
+ translate('lumen.tv.fact.network', 'Network'),
+ t.networks?.length
+ ? t.networks.map(({ id, name }, index) => (
+
+ {index > 0 && ', '}
+ {id &&
+ Number.isSafeInteger(id) &&
+ id > 0 &&
+ id <= 1_000_000_000 ? (
+ {name}
+ ) : (
+ name
+ )}
+
+ ))
+ : null,
+ ],
[
- ...(t.createdBy ?? []).map(({ name }) => name),
- ...(t.credits?.crew ?? []).map(({ name }) => name),
+ translate('lumen.tv.fact.seriesType', 'Series Type'),
+ t.type,
],
- locale,
- translate
- ),
- ]}
+ [
+ translate('lumen.tv.fact.status', 'Status'),
+ t.status === 'Returning Series'
+ ? translate('lumen.tv.fact.stillAiring', 'Still airing')
+ : ((
+ {
+ Planned: translate(
+ 'lumen.browse.seriesStatusOption.1',
+ 'Planned'
+ ),
+ 'In Production': translate(
+ 'lumen.browse.seriesStatusOption.2',
+ 'In Production'
+ ),
+ Ended: translate(
+ 'lumen.browse.seriesStatusOption.3',
+ 'Ended'
+ ),
+ Canceled: translate(
+ 'lumen.browse.seriesStatusOption.4',
+ 'Canceled'
+ ),
+ Pilot: translate(
+ 'lumen.browse.seriesStatusOption.5',
+ 'Pilot'
+ ),
+ } as Record
+ )[t.status ?? ''] ?? t.status),
+ ],
+ [
+ translate(
+ 'lumen.tv.fact.episodeLength',
+ 'Episode length'
+ ),
+ fmtRun(t.episodeRunTime?.[0]),
+ ],
+ [
+ translate('lumen.tv.fact.episodes', 'Episodes'),
+ t.numberOfEpisodes > 0 ? t.numberOfEpisodes : null,
+ ],
+ [
+ translate('lumen.tv.fact.createdBy', 'Created by'),
+ t.createdBy?.map(({ id, name }, index) => (
+
+ {index > 0 && ', '}
+ {id !== undefined &&
+ Number.isSafeInteger(id) &&
+ id > 0 &&
+ id <= 1_000_000_000 ? (
+ {name}
+ ) : (
+ name
+ )}
+
+ )),
+ ],
+ [
+ translate('lumen.tv.fact.lastAired', 'Last aired'),
+ t.lastEpisodeToAir
+ ? `S${t.lastEpisodeToAir.seasonNumber} E${t.lastEpisodeToAir.episodeNumber} · ${shortDate(t.lastEpisodeToAir.airDate, true, locale)}`
+ : t.lastAirDate !== t.firstAirDate
+ ? shortDate(t.lastAirDate, true, locale)
+ : '',
+ ],
+ [
+ translate('lumen.tv.fact.nextEpisode', 'Next episode'),
+ t.nextEpisodeToAir
+ ? `S${t.nextEpisodeToAir.seasonNumber} E${t.nextEpisodeToAir.episodeNumber} · ${shortDate(t.nextEpisodeToAir.airDate, true, locale)}`
+ : '',
+ ],
+ ...videoMetadataRows(
+ t.metadataSources,
+ t.supplementalMetadata,
+ [
+ ...(t.createdBy ?? []).map(({ name }) => name),
+ ...(t.credits?.crew ?? []).map(({ name }) => name),
+ ],
+ locale,
+ translate
+ ),
+ ]}
+ />
+
+
@@ -1458,12 +1480,15 @@ export default function TvDetail() {
>
{t.mediaInfo?.id && canManageRequests(user?.permissions) && (
setManageOpen(true)}
>
- {translate('lumen.manageVideo.open', 'Manage')}
+
+ {translate('lumen.manageVideo.open', 'Manage')}
+
)}
{/* phones only get this bar: keep a way to watch the seasons already there */}
diff --git a/lumen/src/settings.tsx b/lumen/src/settings.tsx
index 43470e8..228acb5 100644
--- a/lumen/src/settings.tsx
+++ b/lumen/src/settings.tsx
@@ -12,7 +12,7 @@ import { api } from './api';
import { useAuth } from './auth';
import { forgetLumenConfig, readLumenConfig } from './deployment';
import { serverName, services, type MediaServerSetting } from './mediaServer';
-import { MUSIC_PLAYERS, type MusicPlayer } from './musicPlayback';
+import { asMusicPlayer, type MusicPlayer } from './musicPlayback';
import { isThemeColor, themeColors } from './themeOverrides';
// Every switchable part of Lumen. Admins set defaults (and can lock them) in
@@ -82,6 +82,7 @@ export interface AdminConfig {
logoShape?: 'rounded' | 'circle' | 'raw';
};
mediaServerName?: string; // replaces Plex / Jellyfin / Emby in every label
+ musicPlayers?: string[]; // the music apps people may pick for Play (every app when absent)
[other: string]: unknown;
}
@@ -136,8 +137,8 @@ const cleanPrefs = (value: unknown): Partial
=> {
if (typeof source[key] === 'boolean') clean[key] = source[key];
if (['dark', 'light', 'system'].includes(source.theme as string))
clean.theme = source.theme as Prefs['theme'];
- if (MUSIC_PLAYERS.includes(source.musicPlayer as MusicPlayer))
- clean.musicPlayer = source.musicPlayer as MusicPlayer;
+ const savedPlayer = asMusicPlayer(source.musicPlayer);
+ if (savedPlayer) clean.musicPlayer = savedPlayer;
if (source.rows && typeof source.rows === 'object') {
const rows = record(source.rows);
clean.rows = Object.fromEntries(
@@ -163,8 +164,8 @@ const merge = (
if (['dark', 'light', 'system'].includes(values.theme as string))
next.theme = values.theme as Prefs['theme'];
} else if (key === 'musicPlayer') {
- if (MUSIC_PLAYERS.includes(values.musicPlayer as MusicPlayer))
- next.musicPlayer = values.musicPlayer as MusicPlayer;
+ const player = asMusicPlayer(values.musicPlayer);
+ if (player) next.musicPlayer = player;
} else if (typeof values[key] === 'boolean') next[key] = values[key];
}
return next;
diff --git a/lumen/src/styles/app.css b/lumen/src/styles/app.css
index a0f9534..2edc1bf 100644
--- a/lumen/src/styles/app.css
+++ b/lumen/src/styles/app.css
@@ -1056,19 +1056,27 @@ body.is-detail .tabbar {
.dtitle .by a {
color: var(--accent);
}
-.dline {
+/* Each item but the first carries a leading dot. The line is shifted left by one dot's width
+ inside a clipping box, so the dot that would start a wrapped line is cut off: no line ever
+ starts or ends with a dot. */
+.dline-wrap {
margin-top: 6px;
+ overflow: hidden;
+}
+.dline {
color: var(--ink-3);
font-size: 14px;
font-weight: 500;
display: flex;
flex-wrap: wrap;
gap: 4px 0;
+ margin-left: -22px;
}
-/* the dot trails its item so a wrapped line never starts with one */
-.dline span:not(:last-child)::after {
+.dline > span::before {
content: '·';
- margin: 0 10px;
+ display: inline-block;
+ width: 22px;
+ text-align: center;
color: var(--ink-3);
}
.cert {
@@ -3229,7 +3237,7 @@ section:not([class]) > * + section,
form:not([class]) > * + section {
margin-top: 28px;
}
-:not(.view)
+:not(.view, .music-tabpanel, .dbody, .dcols > *)
> :is(.ph, section, details.adv, .setlist, nav, .toolbar, form)
+ :is(section, details.adv) {
margin-top: 28px;
@@ -3557,3 +3565,660 @@ form.issue-filters > details[open] {
form.issue-filters > :not(details) {
flex: 1 1 100%;
}
+
+/* Discovery on phones: the availability switch and one Filters button share a row; the rest of
+ the filters open in a bottom sheet, and each filter in use shows as a removable chip on one
+ scrolling line, so the posters start near the top of the screen */
+@media (max-width: 699px) {
+ .browse-toolbar:not(.browse-filter-body) {
+ flex-wrap: nowrap;
+ }
+ .browse-toolbar > .seg {
+ flex: 0 1 auto;
+ min-width: 0;
+ }
+ .browse-toolbar > .seg button {
+ min-width: 0;
+ padding-inline: 10px;
+ white-space: nowrap;
+ }
+ .browse-toolbar > .browse-filters-btn {
+ flex: 0 0 auto;
+ margin-left: auto;
+ gap: 6px;
+ }
+}
+.browse-filters-btn .n {
+ min-width: 20px;
+ height: 20px;
+ padding: 0 6px;
+ border-radius: 10px;
+ display: inline-grid;
+ place-items: center;
+ background: var(--accent);
+ color: var(--on-accent, #fff);
+}
+.browse-applied {
+ display: flex;
+ gap: 8px;
+ overflow-x: auto;
+ scrollbar-width: none;
+ margin-top: 8px;
+ padding-bottom: 2px;
+}
+.browse-applied::-webkit-scrollbar {
+ display: none;
+}
+.browse-applied > .chip {
+ flex: 0 0 auto;
+ white-space: nowrap;
+ gap: 4px;
+}
+.browse-filter-head h2 {
+ font-size: 20px;
+}
+.browse-filter-sheet .browse-filter-body > .sel {
+ flex: 1 1 100%;
+}
+.browse-filter-sheet .more-filters {
+ margin: 0;
+}
+.browse-filter-sheet .pk-foot {
+ grid-template-columns: auto minmax(0, 1fr);
+ gap: 8px;
+}
+.browse-filter-sheet .pk-foot > .filters-clear {
+ margin: 0;
+}
+.browse-filter-sheet .pk-foot.pk-foot-single {
+ grid-template-columns: minmax(0, 1fr);
+}
+
+/* phones: long chip lists (podcast categories, music shortcuts, Discover's media types) scroll
+ sideways on one line instead of wrapping over the first screen */
+@media (max-width: 699px) {
+ .pod-genres,
+ .music-head-chips,
+ .navchips {
+ flex-wrap: nowrap;
+ overflow-x: auto;
+ scrollbar-width: none;
+ }
+ .pod-genres > .chip,
+ .music-head-chips > *,
+ .navchips > .chip {
+ flex: 0 0 auto;
+ }
+}
+
+/* the phone filter row and its chips sit together; Filters starts the row when nothing else
+ is in it */
+.phone-filters > .phone-filter-row {
+ margin: 0;
+}
+.phone-filters > .browse-applied {
+ margin-top: 8px;
+}
+.phone-filter-row > .browse-filters-btn:first-child {
+ margin-left: 0;
+}
+@media (max-width: 699px) {
+ .books-links {
+ flex-wrap: nowrap;
+ overflow-x: auto;
+ scrollbar-width: none;
+ }
+ .books-links > * {
+ flex: 0 0 auto;
+ }
+}
+
+/* Requests on phones: the status chips keep their counts and scroll beside Filters */
+.phone-filter-row > .phone-which {
+ flex: 1 1 auto;
+ min-width: 0;
+ margin-right: 4px;
+ mask-image: linear-gradient(to right, #000 85%, transparent);
+ flex-wrap: nowrap;
+ overflow-x: auto;
+ scrollbar-width: none;
+}
+.phone-filter-row > .phone-which > .chip {
+ flex: 0 0 auto;
+}
+@media (max-width: 699px) {
+ .browse-toolbar > .seg button {
+ min-width: 44px;
+ }
+}
+
+/* a genre sheet opened from inside the filter sheet stays on top of it */
+.sheet-wrap:has(.gp-sheet) {
+ z-index: 101;
+}
+
+/* Music tabs: the page grid already spaces what follows the tab bar */
+.music-tabbar {
+ margin-bottom: 0;
+}
+/* Podcasts: Following sits under the category row */
+.seg.pod-following {
+ justify-self: start;
+ margin-top: 8px;
+}
+
+/* Detail pages: the status pills share one line, wider screens lay them out as before */
+.dpills {
+ display: contents;
+}
+/* Status, ratings and the small actions flow as one wrapping group: nothing is cut off at the
+ edge of a scroller, and a lone More sits beside the chips instead of on a row of its own. */
+.dstatus [data-testid='video-ratings'] {
+ display: contents;
+}
+.dstatus [data-testid='video-ratings'] > .chip {
+ flex: 0 0 auto;
+}
+@media (max-width: 699px) {
+ .dstatus {
+ gap: 6px;
+ }
+}
+.more-actions-list {
+ display: grid;
+ gap: 8px;
+}
+.more-actions-list > :is(a, button, .btn, .chip) {
+ justify-self: stretch;
+ justify-content: flex-start;
+}
+.clamp-4 {
+ display: -webkit-box;
+ -webkit-line-clamp: 4;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.clamp-text {
+ display: grid;
+ gap: 4px;
+ justify-items: start;
+}
+.account-jump {
+ /* one row that scrolls sideways, like the other phone chip rows */
+ flex-wrap: nowrap;
+ overflow-x: auto;
+ scrollbar-width: none;
+ padding-bottom: 2px;
+}
+.account-jump::-webkit-scrollbar {
+ display: none;
+}
+.account-jump > .chip {
+ flex: 0 0 auto;
+ white-space: nowrap;
+}
+.phone-section-body {
+ padding-top: 12px;
+}
+
+/* Detail pages, wider screens: ratings and actions sit at one height, the actions a little
+ apart from the ratings */
+@media (min-width: 700px) {
+ .dstatus > :is(.btn, a.btn, button.btn),
+ .dstatus > .detail-actions > :is(.btn, a.btn, button.btn, .chip),
+ .dstatus [data-testid='video-ratings'] > .chip {
+ height: 36px;
+ min-height: 36px;
+ display: inline-flex;
+ align-items: center;
+ align-self: center;
+ }
+ .dstatus > .detail-actions {
+ display: inline-flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 8px;
+ margin-left: 10px;
+ }
+ .dstatus > .detail-actions:empty {
+ display: none;
+ }
+}
+
+.more-actions-single {
+ display: contents;
+}
+details.phone-section > .phone-section-body > .sec-head {
+ justify-content: flex-end;
+}
+
+/* Search: the sort menu rides at the end of the result-type chips on phones */
+.chips > .sel.sort-chip {
+ flex: 0 0 auto;
+ min-width: 0;
+}
+.search-service-note {
+ font-size: 13px;
+ color: var(--ink-3);
+}
+
+.phone-section > summary {
+ min-width: 0;
+ overflow-wrap: anywhere;
+}
+.phone-section > summary > h2 {
+ display: inline;
+ white-space: normal;
+ font-size: inherit;
+ font-weight: inherit;
+ margin: 0;
+}
+
+/* a folded section never widens the page (its summary marker sits at the edge) */
+section.phone-fold {
+ min-width: 0;
+ overflow-x: clip;
+}
+
+/* Phones: a long save or test button in a settings toolbar (French and the like) wraps its
+ words instead of pushing the page wider than the screen */
+@media (max-width: 699px) {
+ .toolbar > .btn {
+ white-space: normal;
+ max-width: 100%;
+ min-width: 0;
+ text-align: center;
+ padding-block: 8px;
+ }
+}
+
+/* A run of collapsed disclosures (folded phone sections, closed panels) reads as one stack:
+ 10px apart instead of the container's full gap (32px on a page, 26px on a detail body).
+ After an open one the normal gap comes back. */
+.view
+ > :is(section.phone-fold:not(:has(> details[open])), details.adv:not([open]))
+ + :is(section.phone-fold, details.adv) {
+ margin-top: -22px;
+}
+.dbody
+ > :is(section.phone-fold:not(:has(> details[open])), details.adv:not([open]))
+ + :is(section.phone-fold, details.adv) {
+ margin-top: -16px;
+}
+
+/* ---------- Detail pages: compact top ---------- */
+.detail {
+ position: relative;
+}
+/* the description sits right under the title, two lines until Show more */
+.dintro {
+ padding: 0 var(--gutter);
+ margin-top: -12px;
+ display: grid;
+}
+.dintro .ov {
+ max-width: 72ch;
+}
+.tagline-inline {
+ color: var(--ink);
+ font-weight: 650;
+}
+.clamp-2,
+.clamp-3 {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+.clamp-2 {
+ -webkit-line-clamp: 2;
+}
+.clamp-3 {
+ -webkit-line-clamp: 3;
+}
+@media (min-width: 700px) {
+ .dintro {
+ padding-left: calc(var(--gutter) + 180px + 28px);
+ }
+ .dintro .clamp-2 {
+ -webkit-line-clamp: 3;
+ }
+}
+@media (min-width: 1040px) {
+ .dintro {
+ padding-left: calc(var(--gutter) + 220px + 28px);
+ }
+}
+/* Discover's previous / next title: a pair at the top corner of the art, like the back button */
+.dnav {
+ position: absolute;
+ z-index: 3;
+ top: calc(10px + env(safe-area-inset-top));
+ right: calc(12px + env(safe-area-inset-right));
+ display: flex;
+ gap: 8px;
+}
+.dnav .icon-btn {
+ background: rgba(0, 0, 0, 0.45);
+ color: #fff;
+ border-radius: 50%;
+ backdrop-filter: blur(12px);
+ -webkit-backdrop-filter: blur(12px);
+}
+.dnav .icon-btn:disabled {
+ opacity: 0.35;
+}
+@media (min-width: 1040px) {
+ .dnav {
+ top: 20px;
+ right: var(--gutter);
+ }
+}
+/* phones: scrolled down, the back button gets a solid bar with the title so it covers nothing */
+.dbar {
+ position: fixed;
+ z-index: 60;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: calc(60px + env(safe-area-inset-top));
+ pointer-events: none;
+ display: flex;
+ align-items: center;
+ transition: background 0.15s ease;
+}
+.dbar > .dback {
+ pointer-events: auto;
+}
+.dbar[data-solid='true'] {
+ pointer-events: auto;
+ background: var(--glass);
+ border-bottom: 1px solid var(--glass-line);
+ backdrop-filter: blur(20px) saturate(1.6);
+ -webkit-backdrop-filter: blur(20px) saturate(1.6);
+}
+.dbar[data-solid='true'] > .dback {
+ background: transparent;
+ backdrop-filter: none;
+ -webkit-backdrop-filter: none;
+ color: var(--ink);
+}
+.dbar-title {
+ position: absolute;
+ left: 68px;
+ right: 16px;
+ top: calc(env(safe-area-inset-top) + 30px);
+ transform: translateY(-50%);
+ font-weight: 700;
+ font-size: 16px;
+ color: var(--ink);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+@media (min-width: 1040px) {
+ .dbar {
+ display: none;
+ }
+}
+/* the sticky action bar: every button on one line; the title gives way first */
+.actionbar .btn {
+ white-space: nowrap;
+ flex: 0 1 auto;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.actionbar .ab-meta {
+ flex: 1 1 0;
+ min-width: 0;
+ max-width: none;
+}
+.actionbar .ab-meta b {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+@media (max-width: 379px) {
+ .actionbar:has(.btn + .btn) .ab-meta {
+ display: none;
+ }
+ .actionbar:has(.btn + .btn) .btn {
+ flex: 1 1 0;
+ }
+}
+.actionbar .ab-meta,
+.actionbar .ab-meta b {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+/* three buttons: the title gives way, and on phones Manage keeps only its icon */
+.actionbar:has(
+ > :is(.btn, .icon-btn) ~ :is(.btn, .icon-btn) ~ :is(.btn, .icon-btn)
+ )
+ .ab-meta {
+ display: none;
+}
+@media (max-width: 699px) {
+ .actionbar:has(
+ > :is(.btn, .icon-btn) ~ :is(.btn, .icon-btn) ~ :is(.btn, .icon-btn)
+ )
+ .ab-manage
+ .ab-lbl {
+ display: none;
+ }
+ .actionbar .btn {
+ padding-inline: 14px;
+ }
+}
+/* the bar under the back button is solid enough that nothing reads through it */
+.dbar[data-solid='true'] {
+ background: color-mix(in srgb, var(--bg) 94%, transparent);
+}
+/* the main action takes the room the others leave */
+.actionbar > :is(.btn, a.btn):last-child {
+ flex: 1 1 auto;
+}
+
+/* album songs: a small get button instead of a wide pill, so rows stay one line */
+.song-get {
+ width: 40px;
+ height: 40px;
+}
+@media (pointer: coarse) {
+ .song-get {
+ width: 44px;
+ height: 44px;
+ }
+}
+.tlist-more {
+ justify-self: start;
+ margin-top: 8px;
+}
+.dstatus > .music-ratings {
+ display: contents;
+}
+
+/* request rows: the buttons use the row's full width, so a row is two short lines, not a column */
+.rq > .rqa {
+ grid-column: 1 / -1;
+ margin-top: 0;
+}
+.rq > .rqa:empty {
+ display: none;
+}
+
+.dstatus .pill {
+ max-width: 100%;
+ height: auto;
+ min-height: 28px;
+ white-space: normal;
+}
+.chip-li {
+ list-style: none;
+ display: contents;
+}
+
+/* Show more under a short description: a small link, not a button row */
+.more-link {
+ justify-self: start;
+ background: none;
+ border: 0;
+ padding: 4px 0;
+ margin-top: -2px;
+ color: var(--accent);
+ font: inherit;
+ font-size: 14px;
+ font-weight: 650;
+ cursor: pointer;
+}
+@media (pointer: coarse) {
+ .more-link {
+ min-height: 32px;
+ }
+}
+/* phones: More is a small icon chip at the end of the status row */
+@media (max-width: 699px) {
+ .dstatus .more-actions-btn .more-lbl {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip: rect(0 0 0 0);
+ }
+ .dstatus .more-actions-btn {
+ min-width: 44px;
+ justify-content: center;
+ padding-inline: 10px;
+ }
+}
+/* album: the secondary boxes come after the songs */
+.album-secondary {
+ display: grid;
+ gap: 12px;
+ order: 10;
+}
+.album-secondary:empty {
+ display: none;
+}
+/* phones: a shorter strip of art above the poster (the back button still clears it) */
+@media (max-width: 699px) {
+ .dhero {
+ height: 240px;
+ }
+}
+
+.phone-section-title {
+ font: inherit;
+ margin: 0;
+}
+/* folded settings groups (phones) sit close together, like a list */
+@media (max-width: 699px) {
+ .admin-groups {
+ gap: 8px;
+ }
+ main .admin-groups.admin-groups > details.phone-section,
+ .view > details.phone-section + details.phone-section {
+ margin: 0;
+ }
+ .view > details.phone-section + details.phone-section {
+ margin-top: 8px;
+ }
+}
+/* folded boxes on a detail page stack as one close list (8-10px apart) */
+.dcols > div > details.adv:not([open]) + details.adv {
+ margin-top: -12px;
+}
+.dbody > details.adv:not([open]) + .dcols {
+ margin-top: -16px;
+}
+@media (max-width: 1039px) {
+ .dcols:has(> div > details.adv:last-child:not([open]))
+ > aside:has(> details.adv:first-child) {
+ margin-top: -12px;
+ }
+}
+/* phones: with two or more buttons the sticky bar is all buttons, no squeezed title */
+@media (max-width: 699px) {
+ .actionbar:has(> :is(.btn, .icon-btn) ~ :is(.btn, .icon-btn)) .ab-meta {
+ display: none;
+ }
+ .actionbar:has(> :is(.btn, .icon-btn) ~ :is(.btn, .icon-btn)) > .btn {
+ flex: 0 1 auto;
+ }
+ .actionbar:has(> :is(.btn, .icon-btn) ~ :is(.btn, .icon-btn))
+ > .btn:last-child {
+ flex: 1 1 auto;
+ }
+}
+
+/* phones: the order is shown by the list and the chips; the sentence repeating it goes */
+@media (max-width: 699px) {
+ .requests-sub {
+ display: none;
+ }
+}
+
+/* Combined boxes (Cast & Crew, Details): each part under a small heading */
+.adv-sub {
+ min-width: 0;
+}
+.adv-sub-title {
+ margin: 0 0 8px;
+ font-size: 13px;
+ font-weight: 650;
+ letter-spacing: 0.02em;
+ color: var(--ink-3);
+}
+details.adv[open] > .adv-sub + .adv-sub {
+ margin-top: 18px;
+}
+/* phones, settings groups merged into one fold: a small heading per group */
+.phone-sub + .phone-sub {
+ margin-top: 18px;
+}
+.phone-sub-title {
+ margin: 0 0 8px;
+ font-size: 13px;
+ font-weight: 650;
+ letter-spacing: 0.02em;
+ color: var(--ink-3);
+}
+/* album, stacked columns: the Credits & Details box sits just under the last song */
+@media (max-width: 1039px) {
+ .dcols.album-cols {
+ gap: 10px;
+ }
+}
+/* a long "Keep … Open" label (French and the like) wraps inside its box, never widens the page */
+details.adv > .toolbar > button.chip {
+ white-space: normal;
+ max-width: 100%;
+ height: auto;
+ min-height: 32px;
+ text-align: start;
+}
+
+/* edition and narration pickers: "All N editions" and the one Follow button under the list */
+.nfoot {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ gap: 8px 12px;
+ margin-top: 8px;
+}
+.nfoot .more-link {
+ margin-top: 0;
+}
+.nfoot > .btn:only-child {
+ margin-inline-start: auto;
+}
+/* a single edition with nothing to choose (the ebook): no radio column */
+.nrow.nstatic {
+ grid-template-columns: 64px minmax(0, 1fr);
+ cursor: default;
+}
+/* a description of several paragraphs inside one Show more box */
+.ov.paras {
+ white-space: pre-line;
+}
diff --git a/lumen/tests/browser/account-language-options-localization.spec.ts b/lumen/tests/browser/account-language-options-localization.spec.ts
index 8a1d05d..3aa7949 100644
--- a/lumen/tests/browser/account-language-options-localization.spec.ts
+++ b/lumen/tests/browser/account-language-options-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openSections } from './discoveryFilters';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -51,6 +52,7 @@ test('preferred media language options use the saved interface locale', async ({
return route.fulfill({ json: {} });
});
await page.goto(appPath('/me/account'));
+ await openSections(page);
const selector = page.locator('select.cfg-input').nth(1);
await expect(selector).toBeEnabled();
const expectedNames = process.env.LUMEN_EXPECT_ENGLISH_NAMES
diff --git a/lumen/tests/browser/account-settings.spec.ts b/lumen/tests/browser/account-settings.spec.ts
index 8439fb5..6df547d 100644
--- a/lumen/tests/browser/account-settings.spec.ts
+++ b/lumen/tests/browser/account-settings.spec.ts
@@ -1,4 +1,6 @@
import { expect, test } from '@playwright/test';
+import { openSections } from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) =>
@@ -41,6 +43,8 @@ test('profile and password settings recover independently after load failures',
});
await page.goto(appPath('/me/account'));
+
+ await openSections(page);
const profileAlert = page.getByRole('alert').filter({
hasText: 'Could not load profile settings',
});
@@ -109,12 +113,14 @@ test('password and Episode Queue bookmarks scroll to the selected section after
['./users/2/settings/episode-queue?from=native', 'episode-queue'],
]) {
await page.goto(appPath(path));
+ await openSections(page);
await expect(page.locator(`section#${id}`)).toHaveAttribute(
'data-bookmark-target',
'true'
);
}
await page.goto(appPath('./me/account'));
+ await openSections(page);
await expect(page.getByText('Jellyfin User', { exact: true })).toBeVisible();
await expect(
page.getByRole('heading', { name: 'Default Request Folders' })
@@ -240,6 +246,8 @@ test('advanced theme controls are limited to administrator accounts', async ({
});
await page.goto(appPath('./me/account#advanced-theme'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', { name: 'User Settings', exact: true })
).toBeVisible();
@@ -405,6 +413,8 @@ for (const locale of [
});
await page.goto(appPath('./me/account'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', {
name:
@@ -524,6 +534,8 @@ test('request folders preserve service choices and confirm persisted values', as
});
await page.goto(appPath('/me/account'));
+
+ await openSections(page);
const title = page.getByRole('heading', { name: labels[locale].title });
await expect(title).toBeVisible();
const radarr = page.getByLabel(labels[locale].movie);
@@ -641,6 +653,7 @@ test('external request lists connect, sync, import CSV and remove through accoun
return route.fulfill({ json: {} });
});
await page.goto(appPath('/me/account'));
+ await openSections(page);
await expect(
page.getByRole('heading', { name: 'External Request Lists' })
).toBeVisible();
@@ -754,6 +767,7 @@ test('book home sections preserve order and enabled state through settings readb
return route.fulfill({ json: {} });
});
await page.goto(appPath('/me/account'));
+ await openSections(page);
await expect(
page.getByRole('heading', { name: 'Book and Audiobook Home Sections' })
).toBeVisible();
@@ -838,7 +852,11 @@ test('account settings preserve failed profile edits and save only changes and p
return route.fulfill({ json: {} });
});
await page.goto(appPath('./me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Account Settings' }).click();
+ await openPhoneSections(page);
+ await openSections(page);
const displayName = page.getByLabel('Display Name');
await expect(displayName).toHaveValue('Viewer');
await displayName.fill('Updated Viewer');
@@ -934,6 +952,8 @@ for (const locale of ['fr', 'ar']) {
});
await page.goto(appPath('./me/account'));
+
+ await openSections(page);
const expected =
locale === 'fr'
? {
@@ -1046,6 +1066,8 @@ test('display language persists and localizes the shell and account settings', a
});
await page.goto(appPath('./me/account'));
+
+ await openSections(page);
const language = page.getByRole('combobox', { name: 'Display Language' });
await expect(language).toHaveValue('');
if (
@@ -1053,12 +1075,15 @@ test('display language persists and localizes the shell and account settings', a
['desktop', 'iphone'].includes(testInfo.project.name)
) {
await page.goto(appPath('./me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(page.getByRole('heading', { name: 'You' })).toBeVisible();
await page.screenshot({
path: `${process.env.LUMEN_VISUAL_CAPTURE_DIR}/baseline-${testInfo.project.name}-english-you.png`,
fullPage: false,
});
await page.goto(appPath('./me/account'));
+ await openSections(page);
}
await language.selectOption('fr');
await page.getByRole('button', { name: 'Save Changes' }).click();
@@ -1080,9 +1105,11 @@ test('display language persists and localizes the shell and account settings', a
).toBeVisible();
await expect(page.getByLabel('Nom affiché')).toHaveValue('Viewer');
await page.goto(appPath('./me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(page.getByRole('heading', { name: 'Vous' })).toBeVisible();
await expect(
- page.getByRole('heading', { name: 'Bibliothèque' })
+ page.getByRole('heading', { name: 'Bibliothèque', exact: true })
).toBeVisible();
await expect(page.getByRole('heading', { name: 'Apparence' })).toBeVisible();
await expect(
@@ -1100,6 +1127,7 @@ test('display language persists and localizes the shell and account settings', a
fullPage: false,
});
await page.goto(appPath('./me/account'));
+ await openSections(page);
await expect(page.getByLabel('Langue des métadonnées')).toBeVisible();
await expect(page.getByText('Type de compte')).toBeVisible();
await expect(page.getByText('Utilisateur local')).toBeVisible();
@@ -1134,6 +1162,7 @@ test('display language persists and localizes the shell and account settings', a
path: `${process.env.LUMEN_VISUAL_CAPTURE_DIR}/candidate-${testInfo.project.name}-french-account.png`,
fullPage: false,
});
+ await openSections(page);
await expect(
page.getByRole('combobox', { name: "Langue d'affichage" })
).toHaveValue('fr');
@@ -1142,6 +1171,8 @@ test('display language persists and localizes the shell and account settings', a
expect(writes).toEqual([{ locale: 'fr' }]);
await page.reload();
+
+ await openSections(page);
await expect(page.getByRole('link', { name: 'Découvrir' })).toBeVisible();
await expect(page.getByLabel('Nom affiché')).toHaveValue('Viewer');
await expect(page.locator('html')).toHaveAttribute('lang', 'fr');
@@ -1164,8 +1195,12 @@ test('display language persists and localizes the shell and account settings', a
).toBeVisible();
await expect(page.getByLabel('إسم العرض')).toHaveValue('Viewer');
await page.goto(appPath('./me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(page.getByRole('heading', { name: 'أنت' })).toBeVisible();
- await expect(page.getByRole('heading', { name: 'المكتبة' })).toBeVisible();
+ await expect(
+ page.getByRole('heading', { name: 'المكتبة', exact: true })
+ ).toBeVisible();
await expect(
page.getByRole('heading', { name: 'المظهر', exact: true })
).toBeVisible();
@@ -1184,6 +1219,7 @@ test('display language persists and localizes the shell and account settings', a
fullPage: false,
});
await page.goto(appPath('./me/account'));
+ await openSections(page);
await expect(page.getByText('مستخدم محلي')).toBeVisible();
await expect(page.getByText('الدور', { exact: true })).toBeVisible();
await expect(
@@ -1247,6 +1283,8 @@ test('watchlist preferences honor account type and category permissions and pers
});
await page.goto(appPath('./me/account'));
+
+ await openSections(page);
const music = page.getByRole('checkbox', { name: 'Auto-Request Music' });
await expect(music).toBeChecked();
await expect(page.getByLabel('Auto-Request Movies')).toHaveCount(0);
@@ -1267,6 +1305,7 @@ test('watchlist preferences honor account type and category permissions and pers
{ watchlistSyncMusic: false },
]);
await page.reload();
+ await openSections(page);
await expect(music).toBeVisible();
await expect(music).not.toBeChecked();
});
@@ -1355,6 +1394,8 @@ for (const scenario of [
});
await page.goto(appPath('./me/account'));
+
+ await openSections(page);
for (const label of [
'Auto-Request Movies',
'Auto-Request Series',
@@ -1405,6 +1446,7 @@ test('account applies the shared built-in theme preset and preserves overrides',
return route.fulfill({ json: {} });
});
await page.goto(appPath('./me/account#advanced-theme'));
+ await openSections(page);
await page.locator('#advanced-theme').scrollIntoViewIfNeeded();
if (process.env.LUMEN_VISUAL_CAPTURE_DIR)
await page.screenshot({
@@ -1469,6 +1511,7 @@ test('account resets all saved theme overrides together', async ({ page }) => {
return route.fulfill({ json: {} });
});
await page.goto(appPath('./me/account#advanced-theme'));
+ await openSections(page);
await page.getByRole('button', { name: 'Reset Theme Overrides' }).click();
await expect(page.getByText('Theme overrides cleared.')).toBeVisible();
expect(submitted).toEqual({
@@ -1522,6 +1565,7 @@ test('account theme colors preserve stored overrides for other controls', async
return route.fulfill({ json: {} });
});
await page.goto(appPath('./me/account'));
+ await openSections(page);
const background = page.getByLabel('Page Background');
const save = page.getByRole('button', { name: 'Save Theme Colors' });
await background.fill('invalid');
@@ -1544,6 +1588,7 @@ test('account theme colors preserve stored overrides for other controls', async
)
.toBe('#112233');
await page.reload();
+ await openSections(page);
await expect(background).toHaveValue('#112233');
if (await page.locator('.side').isVisible()) {
const header = page.locator('.topbar');
@@ -1681,6 +1726,8 @@ test('account theme override controls follow the selected Lumen locale', async (
});
await page.goto(appPath('./me/account#advanced-theme'));
+
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'fr');
await page.locator('#advanced-theme').scrollIntoViewIfNeeded();
if (process.env.LUMEN_VISUAL_CAPTURE_DIR)
@@ -1714,6 +1761,7 @@ test('account theme override controls follow the selected Lumen locale', async (
locale = 'ar';
await page.reload();
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'ar');
await expect(page.locator('html')).toHaveAttribute('dir', 'rtl');
await page.locator('#advanced-theme').scrollIntoViewIfNeeded();
@@ -1785,6 +1833,8 @@ test('password form uses the selected locale for its save action and failure', a
}
await page.goto(appPath('./me/account#password'));
+
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'fr');
await page.locator('#password').scrollIntoViewIfNeeded();
await submitInvalidCredentials();
@@ -1809,6 +1859,7 @@ test('password form uses the selected locale for its save action and failure', a
locale = 'ar';
passwordResponseStatus = 503;
await page.reload();
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'ar');
await expect(page.locator('html')).toHaveAttribute('dir', 'rtl');
await page.locator('#password').scrollIntoViewIfNeeded();
@@ -1834,6 +1885,7 @@ test('password form uses the selected locale for its save action and failure', a
locale = 'fr';
hasPassword = false;
await page.reload();
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'fr');
await page.locator('#password').scrollIntoViewIfNeeded();
if (process.env.LUMEN_VISUAL_CAPTURE_DIR)
@@ -1871,6 +1923,8 @@ test('account permission names follow the selected Lumen locale', async ({
});
await page.goto(appPath('./me/account#account-permissions'));
+
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'fr');
await page.locator('#account-permissions').scrollIntoViewIfNeeded();
if (process.env.LUMEN_VISUAL_CAPTURE_DIR)
@@ -1897,6 +1951,7 @@ test('account permission names follow the selected Lumen locale', async ({
locale = 'ar';
await page.reload();
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'ar');
await expect(page.locator('html')).toHaveAttribute('dir', 'rtl');
await page.locator('#account-permissions').scrollIntoViewIfNeeded();
diff --git a/lumen/tests/browser/admin-book-services.spec.ts b/lumen/tests/browser/admin-book-services.spec.ts
index 052c5dc..295f66e 100644
--- a/lumen/tests/browser/admin-book-services.spec.ts
+++ b/lumen/tests/browser/admin-book-services.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const backend of ['readarr', 'bindery', 'bookorbit'] as const) {
@@ -62,6 +63,7 @@ for (const backend of ['readarr', 'bindery', 'bookorbit'] as const) {
return route.fulfill({ json: result });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page
.getByRole('link', { name: 'Open Book and Audiobook Services' })
.click();
diff --git a/lumen/tests/browser/admin-collectors.spec.ts b/lumen/tests/browser/admin-collectors.spec.ts
index 79c4cb6..f7e455b 100644
--- a/lumen/tests/browser/admin-collectors.spec.ts
+++ b/lumen/tests/browser/admin-collectors.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const [name, key, port] of [
@@ -30,6 +31,7 @@ for (const [name, key, port] of [
return route.fulfill({ json: saved });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: `Open ${name} Services` }).click();
await page.getByRole('button', { name: `Add ${name}` }).click();
await expect(page.getByLabel('Port')).toHaveValue(port);
diff --git a/lumen/tests/browser/admin-connection-hosts.spec.ts b/lumen/tests/browser/admin-connection-hosts.spec.ts
index 0482545..e3f48ed 100644
--- a/lumen/tests/browser/admin-connection-hosts.spec.ts
+++ b/lumen/tests/browser/admin-connection-hosts.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('a saved connection host can populate a service form', async ({
@@ -37,6 +38,7 @@ test('a saved connection host can populate a service form', async ({
return route.fulfill({ json: url.endsWith('/settings/radarr') ? [] : {} });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Connection Hosts' }).click();
await page.getByRole('button', { name: 'Add Host' }).click();
await page.getByLabel('Name', { exact: true }).fill('Media Host');
@@ -45,6 +47,7 @@ test('a saved connection host can populate a service form', async ({
await expect(page.getByText('Connection hosts saved.')).toBeVisible();
await page.screenshot({ path: info.outputPath('hosts.png'), fullPage: true });
await page.getByRole('link', { name: 'Administration', exact: true }).click();
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Radarr Services' }).click();
await page.getByRole('button', { name: 'Add Radarr' }).click();
await page
diff --git a/lumen/tests/browser/admin-discovery.spec.ts b/lumen/tests/browser/admin-discovery.spec.ts
index 00e55d0..cb29b7a 100644
--- a/lumen/tests/browser/admin-discovery.spec.ts
+++ b/lumen/tests/browser/admin-discovery.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('discovery credentials remain write-only and save retries until persisted state is confirmed', async ({
@@ -44,6 +45,7 @@ test('discovery credentials remain write-only and save retries until persisted s
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Discovery Integrations' }).click();
const secret = page.getByLabel('Client Secret');
await expect(secret).toHaveValue('');
diff --git a/lumen/tests/browser/admin-download-clients.spec.ts b/lumen/tests/browser/admin-download-clients.spec.ts
index 76d39b3..62e99f7 100644
--- a/lumen/tests/browser/admin-download-clients.spec.ts
+++ b/lumen/tests/browser/admin-download-clients.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const locale = (
['en', 'fr', 'ar'].includes(process.env.LUMEN_DOWNLOAD_CLIENTS_LOCALE ?? '')
@@ -121,6 +122,7 @@ test('download clients test and save with the existing credential', async ({
return route.fulfill({ json: saved });
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page
.getByRole('link', { name: 'Open Download Client Settings' })
.click();
diff --git a/lumen/tests/browser/admin-jellystat.spec.ts b/lumen/tests/browser/admin-jellystat.spec.ts
index ecc32ca..12ec2e1 100644
--- a/lumen/tests/browser/admin-jellystat.spec.ts
+++ b/lumen/tests/browser/admin-jellystat.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('Jellystat can connect, reuse a saved password, and disconnect', async ({
@@ -33,6 +34,7 @@ test('Jellystat can connect, reuse a saved password, and disconnect', async ({
return route.fulfill({ status: 405 });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Jellystat Settings' }).click();
await page.getByLabel('Server URL').fill('https://music.internal');
await page.getByLabel('API Key').fill('fixture-password');
diff --git a/lumen/tests/browser/admin-library-migration.spec.ts b/lumen/tests/browser/admin-library-migration.spec.ts
index 5aa8a49..4d2a25c 100644
--- a/lumen/tests/browser/admin-library-migration.spec.ts
+++ b/lumen/tests/browser/admin-library-migration.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('Bookshelf moves require the current preview and track the queued command', async ({
@@ -114,6 +115,7 @@ test('Bookshelf moves require the current preview and track the queued command',
return route.fulfill({ json: { command: { id: 91, status: 'queued' } } });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Library Migration' }).click();
await expect(page.getByLabel('Media Format')).toHaveValue('audiobook');
const destination = page.getByLabel('Destination Root Folder');
diff --git a/lumen/tests/browser/admin-lumen-settings-localization.spec.ts b/lumen/tests/browser/admin-lumen-settings-localization.spec.ts
index e505d8c..6391c9b 100644
--- a/lumen/tests/browser/admin-lumen-settings-localization.spec.ts
+++ b/lumen/tests/browser/admin-lumen-settings-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page, type TestInfo } from '@playwright/test';
+import { openSections } from './discoveryFilters';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -126,6 +127,8 @@ test('Lumen administration settings follow locale and retain config behavior', a
});
await page.goto(appPath('/me/lumen'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', { name: expected.title })
).toBeVisible();
@@ -166,7 +169,8 @@ test('Lumen administration settings follow locale and retain config behavior', a
).toBeVisible();
await expect(page.getByText(expected.theme, { exact: true })).toBeVisible();
await expect(
- page.getByText(expected.allowChange, { exact: true })
+ // the theme's lock; Music apps has its own further down
+ page.getByText(expected.allowChange, { exact: true }).first()
).toBeVisible();
await expect(
page.locator('textarea[aria-label="lumen-config.json"]')
diff --git a/lumen/tests/browser/admin-media-libraries.spec.ts b/lumen/tests/browser/admin-media-libraries.spec.ts
index 0e11dc6..6967b58 100644
--- a/lumen/tests/browser/admin-media-libraries.spec.ts
+++ b/lumen/tests/browser/admin-media-libraries.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -94,6 +95,7 @@ for (const [type, name, provider] of [
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page
.getByRole('link', { name: 'Open Media Server Libraries' })
.click();
diff --git a/lumen/tests/browser/admin-metadata.spec.ts b/lumen/tests/browser/admin-metadata.spec.ts
index 3ff4ee7..b2b3b60 100644
--- a/lumen/tests/browser/admin-metadata.spec.ts
+++ b/lumen/tests/browser/admin-metadata.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -259,6 +260,7 @@ test('metadata sections save independently and expose failed provider checks', a
return route.fulfill({ json: settings[path] });
});
await page.goto(`${mount}/me`);
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Metadata Providers' }).click();
const languages = page.getByLabel('Allowed Book Languages');
const requests = page.getByLabel('Maximum Requests per Second');
diff --git a/lumen/tests/browser/admin-music-scene-services.spec.ts b/lumen/tests/browser/admin-music-scene-services.spec.ts
index 1c3d1d7..6e83424 100644
--- a/lumen/tests/browser/admin-music-scene-services.spec.ts
+++ b/lumen/tests/browser/admin-music-scene-services.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const [provider, name, port] of [
@@ -39,6 +40,7 @@ for (const [provider, name, port] of [
return route.fulfill({ json: result });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: `Open ${name} Services` }).click();
await page.getByRole('button', { name: `Add ${name}` }).click();
await expect(page.getByLabel('Port', { exact: true })).toHaveValue(
diff --git a/lumen/tests/browser/admin-navidrome.spec.ts b/lumen/tests/browser/admin-navidrome.spec.ts
index 56eecff..46ef236 100644
--- a/lumen/tests/browser/admin-navidrome.spec.ts
+++ b/lumen/tests/browser/admin-navidrome.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('Navidrome can connect, reuse a saved password, and disconnect', async ({
@@ -43,6 +44,7 @@ test('Navidrome can connect, reuse a saved password, and disconnect', async ({
return route.fulfill({ json: next });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Navidrome Settings' }).click();
await page.getByLabel('Server URL').fill('https://music.internal');
await page.getByLabel('Username').fill('listener');
diff --git a/lumen/tests/browser/admin-navigation.spec.ts b/lumen/tests/browser/admin-navigation.spec.ts
index 2041181..5b35699 100644
--- a/lumen/tests/browser/admin-navigation.spec.ts
+++ b/lumen/tests/browser/admin-navigation.spec.ts
@@ -1,4 +1,6 @@
import { expect, test, type Page } from '@playwright/test';
+import { openSections } from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) => `${testMount}${path}`;
@@ -51,6 +53,8 @@ test('Coming soon is reachable from You on every screen size', async ({
}) => {
await session(page, 32);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
const link = page.getByRole('link', {
name: 'Open Coming soon',
exact: true,
@@ -71,6 +75,8 @@ test('administration is visible in navigation and at the start of You', async ({
}, info) => {
await session(page, 2);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(
page.getByRole('heading', { name: 'Administration', exact: true })
).toBeVisible();
@@ -102,6 +108,7 @@ test('administration is visible in navigation and at the start of You', async ({
.click();
}
await expect(page).toHaveURL(/\/admin$/);
+ await openPhoneSections(page);
await expect(
page.getByRole('heading', { name: 'Administration', level: 1 })
).toBeVisible();
@@ -128,6 +135,8 @@ test('administration directory exposes every settings destination once', async (
}) => {
await session(page, 2);
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
const directory = page.locator('.admin-groups');
const links = directory.locator('a.go');
await expect(links).toHaveCount(42);
@@ -136,7 +145,10 @@ test('administration directory exposes every settings destination once', async (
);
expect(destinations).not.toContain(null);
expect(new Set(destinations).size).toBe(42);
- await expect(directory.locator('section')).toHaveCount(9);
+ // nine groups as sections; phones fold the media services into one, so six folds
+ await expect(
+ directory.locator(':scope > section, :scope > details.phone-section')
+ ).toHaveCount(page.viewportSize()!.width < 700 ? 6 : 9);
});
for (const locale of [
@@ -221,6 +233,8 @@ for (const locale of [
route.fulfill({ json: { locale: locale.tag } })
);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(
page.getByRole('heading', { name: locale.administration, exact: true })
).toBeVisible();
@@ -271,6 +285,8 @@ for (const locale of [
).toBeLessThanOrEqual(page.viewportSize()!.width);
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
const captureDir = process.env.LUMEN_I18N_CAPTURE_DIR;
const baselineCapture = process.env.LUMEN_CAPTURE_BASELINE === '1';
const aurralLabel =
@@ -350,6 +366,8 @@ for (const locale of [
page.locator('#default-user-permissions details')
).toHaveAttribute('open', '');
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await page
.getByLabel(locale.search, { exact: true })
.fill(locale.categorySearch);
@@ -378,6 +396,8 @@ for (const locale of [
})
).toBeInViewport();
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await page.getByLabel(locale.search, { exact: true }).fill(locale.settings);
await expect(
page.getByRole('link', { name: locale.open, exact: true })
@@ -417,6 +437,8 @@ for (const locale of [
route.fulfill({ json: { locale: locale.tag } })
);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
const notice = page
.locator('p[role="status"]')
.filter({ hasText: locale.serverWarning });
@@ -439,6 +461,8 @@ for (const permissions of [32, 4, '2', [2], -2, 2.5]) {
}) => {
await session(page, permissions);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(
page.getByRole('heading', { name: 'You', exact: true })
).toBeVisible();
@@ -453,8 +477,11 @@ for (const permissions of [32, 4, '2', [2], -2, 2.5]) {
).toHaveCount(0);
await expect(page.getByText('Full SeerrNG', { exact: true })).toBeVisible();
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(page).toHaveURL(/\/me$/);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect(page.getByText('Admins only', { exact: true })).toBeVisible();
});
}
@@ -464,6 +491,8 @@ test('configured companion destination is retained with the classic interface es
}) => {
await session(page, 2, 'https://seerr.example.test/base/?keep=1');
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
const link = page.getByRole('link', {
name: 'Open Full SeerrNG',
exact: true,
diff --git a/lumen/tests/browser/admin-network.spec.ts b/lumen/tests/browser/admin-network.spec.ts
index 340e839..e8b40e5 100644
--- a/lumen/tests/browser/admin-network.spec.ts
+++ b/lumen/tests/browser/admin-network.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -90,6 +91,7 @@ test('network settings send only edited values and recover from a rejected save'
}, info) => {
const { patches } = await fixtures(page);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Network Settings' }).click();
await expect(
page.getByRole('heading', { name: 'Network Settings' })
@@ -191,6 +193,7 @@ test('administration search opens the saved proxy password control safely', asyn
}, info) => {
await fixtures(page);
await page.goto(appPath('/admin'));
+ await openPhoneSections(page);
await page
.getByRole('searchbox', { name: 'Search Settings' })
.fill('proxy password');
diff --git a/lumen/tests/browser/admin-notifications.spec.ts b/lumen/tests/browser/admin-notifications.spec.ts
index 52a0309..54537c4 100644
--- a/lumen/tests/browser/admin-notifications.spec.ts
+++ b/lumen/tests/browser/admin-notifications.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('email tests keep saved credentials and Web Push saves independently', async ({
@@ -100,6 +101,7 @@ test('email tests keep saved credentials and Web Push saves independently', asyn
return route.fulfill({ json: body });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Instance Notifications' }).click();
await page.getByRole('link', { name: 'Open Email' }).click();
await expect(page.getByLabel('SMTP Host', { exact: true })).toHaveValue('');
diff --git a/lumen/tests/browser/admin-options.spec.ts b/lumen/tests/browser/admin-options.spec.ts
index 7e60cf2..df11ecc 100644
--- a/lumen/tests/browser/admin-options.spec.ts
+++ b/lumen/tests/browser/admin-options.spec.ts
@@ -1,4 +1,6 @@
import { expect, test, type Page, type TestInfo } from '@playwright/test';
+import { openSections } from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
// Family-install feedback: plain sign-in form, 4K-only library glyphs, server and
// folder choice on poster quick requests, custom logo/tab icon, and the admin page
@@ -759,6 +761,7 @@ for (const theme of ['light', 'dark'] as const) {
}, info) => {
await fixtures(page, { config: { defaults: { theme } } });
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect(
page.getByRole('heading', { name: 'Lumen settings for everyone' })
).toBeVisible();
@@ -1169,6 +1172,7 @@ test('late category probes remain scoped to the account that started them', asyn
await route.fulfill({ json: { results: [], comicVineConfigured: true } });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect.poll(() => started).toBe(true);
await page.getByRole('button', { name: 'Sign out', exact: true }).click();
await page
@@ -1336,12 +1340,14 @@ test('admin settings page builds lumen-config.json', async ({ page }) => {
config: { seerrPublicUrl: 'https://seerr.example.com', custom: 1 },
});
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
await page
.getByRole('link', { name: 'Open Lumen Settings', exact: true })
.click();
await expect(
page.getByRole('heading', { name: 'Lumen settings for everyone' })
).toBeVisible();
+ await openSections(page);
await page
.locator('label', { has: page.getByText('Sign-in page', { exact: true }) })
.locator('select')
@@ -1378,8 +1384,10 @@ test('admin settings page builds lumen-config.json', async ({ page }) => {
test('admin settings page is admins only', async ({ page }) => {
await fixtures(page, { permissions: 32 });
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(page.getByText('Lumen settings for everyone')).toHaveCount(0);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect(page.getByText('Admins only')).toBeVisible();
});
@@ -1391,6 +1399,7 @@ test('admin settings page opened directly starts from the current config', async
config: { loginStyle: 'form', locked: ['theme'] },
});
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect
.poll(async () =>
JSON.parse(
@@ -1582,6 +1591,7 @@ test('category checks are not repeated on every page load', async ({
await expect.poll(() => probes.length).toBe(1);
await page.goto(testAppPath('/movies'));
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.waitForTimeout(800);
expect(probes.length).toBe(1);
});
@@ -1709,6 +1719,7 @@ test('categories without a connected service stay out of the menus', async ({
).toHaveCount(0);
expect(extraCalls).toEqual([]);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(page.getByText('Show books and audiobooks')).toHaveCount(0);
await expect(page.locator('.quota').getByText('Books')).toHaveCount(0);
});
@@ -2061,6 +2072,7 @@ test('signing out drops the saved answers', async ({ page }) => {
await page.evaluate(() => !!localStorage.getItem('lumen-cache:1'))
).toBe(true);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('button', { name: /Sign out/ }).click();
await expect
.poll(() => page.evaluate(() => localStorage.getItem('lumen-cache:1')))
@@ -2392,6 +2404,7 @@ test('a failed sign-out says so instead of failing silently', async ({
route.fulfill({ status: 503, json: { message: 'Unavailable' } })
);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
const signOut = page.getByRole('button', { name: 'Sign out', exact: true });
await signOut.click();
await expect(page.getByText('Couldn’t sign out. Try again.')).toBeVisible();
@@ -2407,6 +2420,7 @@ test('signing out when the session already ended still signs out', async ({
route.fulfill({ status: 401, json: { message: 'Not signed in' } })
);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('button', { name: 'Sign out', exact: true }).click();
await expect(
page.getByRole('button', { name: 'Sign out', exact: true })
@@ -2628,6 +2642,7 @@ test('admin settings page saves for everyone when the server can', async ({
return route.fulfill({ json: { canSave: true, folder: 'ok' } });
});
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
const row = page.locator('.cfg-row', {
hasText: 'Show books and audiobooks',
});
@@ -2658,6 +2673,7 @@ test('admin settings page explains a folder it can’t write', async ({
})
);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect(
page.getByRole('button', { name: 'Download lumen-config.json' })
).toBeVisible();
@@ -2986,6 +3002,7 @@ test('admins upload a logo, and only the logo is saved straight away', async ({
return route.fulfill({ json: { url: '/branding/logo-123.png' } });
});
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
// an unsaved change elsewhere must not be saved by the upload
const row = page.locator('.cfg-row', {
hasText: 'Show books and audiobooks',
@@ -3023,6 +3040,7 @@ test('no upload buttons when the server can’t keep files', async ({ page }) =>
route.fulfill({ json: { canSave: false, folder: 'missing' } })
);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect(page.getByLabel('Logo address')).toBeVisible();
await expect(page.getByLabel('Upload logo')).toHaveCount(0);
await expect(page.getByLabel('Upload tab icon')).toHaveCount(0);
@@ -3088,6 +3106,7 @@ test('admin page picks the logo shape with a live preview', async ({
config: { branding: { name: 'Requests', logo: '/branding/logo.png' } },
});
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
const preview = page.getByLabel('Logo preview').locator('img');
await expect(preview).toHaveClass(/mark-rounded/);
const shapes = page.getByRole('group', { name: 'Logo shape' });
@@ -3786,6 +3805,7 @@ test('storage recovery keeps the draft and enables visible Save and Upload contr
})
);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
const save = page.getByRole('button', {
name: 'Save for everyone',
exact: true,
diff --git a/lumen/tests/browser/admin-prowlarr.spec.ts b/lumen/tests/browser/admin-prowlarr.spec.ts
index cd893af..2ef520b 100644
--- a/lumen/tests/browser/admin-prowlarr.spec.ts
+++ b/lumen/tests/browser/admin-prowlarr.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -67,6 +68,7 @@ test('Prowlarr tests the draft without overwriting the saved API key', async ({
return route.fulfill({ json: {} });
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Prowlarr Settings' }).click();
await expect(page.getByLabel('API key', { exact: true })).toHaveValue('');
await page.getByLabel('Port', { exact: true }).fill('9697');
diff --git a/lumen/tests/browser/admin-radarr.spec.ts b/lumen/tests/browser/admin-radarr.spec.ts
index 224be9b..fae05e9 100644
--- a/lumen/tests/browser/admin-radarr.spec.ts
+++ b/lumen/tests/browser/admin-radarr.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('Radarr creation tests credentials and assigns a request destination', async ({
@@ -62,6 +63,7 @@ test('Radarr creation tests credentials and assigns a request destination', asyn
return route.fulfill({ json: result });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Radarr Services' }).click();
await page.getByRole('button', { name: 'Add Radarr' }).click();
await page.getByLabel('Service Name').fill('Home Radarr');
diff --git a/lumen/tests/browser/admin-reader-delivery.spec.ts b/lumen/tests/browser/admin-reader-delivery.spec.ts
index 89d777b..d93cb8a 100644
--- a/lumen/tests/browser/admin-reader-delivery.spec.ts
+++ b/lumen/tests/browser/admin-reader-delivery.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('reader delivery saves preferences, tests a saved connection, and removes a managed shelf', async ({
@@ -120,6 +121,7 @@ test('reader delivery saves preferences, tests a saved connection, and removes a
return route.fulfill({ json: saved });
});
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Reader Delivery' }).click();
await expect(page.getByLabel('Grimmory Password')).toHaveValue('');
await expect(page.getByLabel('Grimmory OPDS Catalog')).toHaveValue(
diff --git a/lumen/tests/browser/admin-readers.spec.ts b/lumen/tests/browser/admin-readers.spec.ts
index cb9eccc..9b6897f 100644
--- a/lumen/tests/browser/admin-readers.spec.ts
+++ b/lumen/tests/browser/admin-readers.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const name of ['Audiobookshelf', 'Kavita']) {
@@ -56,6 +57,7 @@ for (const name of ['Audiobookshelf', 'Kavita']) {
return route.fulfill({ json: saved });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: `Open ${name} Settings` }).click();
await page.getByLabel('Hostname').fill('reader.internal');
await page.getByLabel('API Key').fill('fixture-key');
diff --git a/lumen/tests/browser/admin-readmeabook.spec.ts b/lumen/tests/browser/admin-readmeabook.spec.ts
index de5b8ba..319bd28 100644
--- a/lumen/tests/browser/admin-readmeabook.spec.ts
+++ b/lumen/tests/browser/admin-readmeabook.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const [locale, labels] of [
@@ -162,6 +163,7 @@ test('ReadMeABook tests with the stored key and explicitly removes it when disab
return route.fulfill({ json: currentSettings });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open ReadMeABook Settings' }).click();
await page.getByRole('button', { name: 'Test Connection' }).click();
await expect(page.getByText('Connected to ReadMeABook.')).toBeVisible();
@@ -273,6 +275,7 @@ test('ReadMeABook approval retries confirm status without repeating the decision
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open ReadMeABook Settings' }).click();
await page
.getByRole('button', { name: 'Approve Slow Readback Book' })
diff --git a/lumen/tests/browser/admin-recognition.spec.ts b/lumen/tests/browser/admin-recognition.spec.ts
index be606d8..d1af043 100644
--- a/lumen/tests/browser/admin-recognition.spec.ts
+++ b/lumen/tests/browser/admin-recognition.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const locale = (
['en', 'fr', 'ar'].includes(process.env.LUMEN_RECOGNITION_LOCALE ?? '')
@@ -125,6 +126,7 @@ test('recognition settings retain edits after rejection and handle saved API key
return route.fulfill({ json: saved });
});
await page.goto(appPath('/admin'));
+ await openPhoneSections(page);
await page
.getByRole('link', { name: 'Open Share and Image Recognition' })
.click();
diff --git a/lumen/tests/browser/admin-route-access.spec.ts b/lumen/tests/browser/admin-route-access.spec.ts
index 3f89573..ce51080 100644
--- a/lumen/tests/browser/admin-route-access.spec.ts
+++ b/lumen/tests/browser/admin-route-access.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const testAppPath = (path: string) =>
`${process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : ''}${path}`;
@@ -78,6 +79,7 @@ test('administrator navigation matches the account role', async ({
test.setTimeout(120_000);
await signIn(page, false);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'SeerrNG Administration', exact: true })
).toHaveCount(0);
@@ -87,8 +89,10 @@ test('administrator navigation matches the account role', async ({
}
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await signIn(page, true);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
const adminEntry =
testInfo.project.name === 'desktop'
? page.getByRole('link', {
@@ -98,6 +102,7 @@ test('administrator navigation matches the account role', async ({
: page.getByRole('link', { name: 'Open SeerrNG Administration' });
await expect(adminEntry).toHaveAttribute('href', testAppPath('/admin'));
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
const primaryNavigation = page.locator('#mobile-primary-navigation');
await expect
.poll(() =>
diff --git a/lumen/tests/browser/admin-software-acquisition.spec.ts b/lumen/tests/browser/admin-software-acquisition.spec.ts
index d2fd3b0..7c7023a 100644
--- a/lumen/tests/browser/admin-software-acquisition.spec.ts
+++ b/lumen/tests/browser/admin-software-acquisition.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const [locale, labels] of [
@@ -183,6 +184,7 @@ test('software acquisition tests a saved connection, preserves keys and saves sy
return route.fulfill({ json: { results: [] } });
});
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Software Acquisition' }).click();
await expect(
page.getByLabel('ROMarrNG API Key', { exact: true })
diff --git a/lumen/tests/browser/admin-sonarr.spec.ts b/lumen/tests/browser/admin-sonarr.spec.ts
index 8e3c1a1..68d5d36 100644
--- a/lumen/tests/browser/admin-sonarr.spec.ts
+++ b/lumen/tests/browser/admin-sonarr.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('Sonarr saves separate series and anime request defaults', async ({
@@ -41,6 +42,7 @@ test('Sonarr saves separate series and anime request defaults', async ({
return route.fulfill({ json: result });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Sonarr Services' }).click();
await page.getByRole('button', { name: 'Add Sonarr' }).click();
await expect(page.getByLabel('Port', { exact: true })).toHaveValue('8989');
diff --git a/lumen/tests/browser/admin-soulseek.spec.ts b/lumen/tests/browser/admin-soulseek.spec.ts
index a536edd..97563c6 100644
--- a/lumen/tests/browser/admin-soulseek.spec.ts
+++ b/lumen/tests/browser/admin-soulseek.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const [locale, labels] of [
@@ -125,6 +126,7 @@ test('Soulseek tests with the stored key and explicitly removes it when disabled
return route.fulfill({ json: currentSettings });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Soulseek Settings' }).click();
await page.getByRole('button', { name: 'Test Connection' }).click();
await expect(page.getByText('SongID unavailable.')).toBeVisible();
diff --git a/lumen/tests/browser/admin-sportarr.spec.ts b/lumen/tests/browser/admin-sportarr.spec.ts
index 73640b5..26880ab 100644
--- a/lumen/tests/browser/admin-sportarr.spec.ts
+++ b/lumen/tests/browser/admin-sportarr.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
test('Sportarr saves the quality profile without requiring a root folder', async ({
@@ -26,6 +27,7 @@ test('Sportarr saves the quality profile without requiring a root folder', async
return route.fulfill({ json: saved });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Sportarr Services' }).click();
await page.getByRole('button', { name: 'Add Sportarr' }).click();
await expect(page.getByLabel('Port')).toHaveValue('1867');
diff --git a/lumen/tests/browser/admin-swipe.spec.ts b/lumen/tests/browser/admin-swipe.spec.ts
index fdb537d..b1df15e 100644
--- a/lumen/tests/browser/admin-swipe.spec.ts
+++ b/lumen/tests/browser/admin-swipe.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const testAppPath = (path: string) =>
`${process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : ''}${path}`;
@@ -46,6 +47,7 @@ for (const permissions of [0, 4, 32, 2]) {
} else {
const tabs = page.getByRole('navigation', { name: 'Tabs', exact: true });
await tabs.locator(`a[href="${testAppPath('/me')}"]`).click();
+ await openPhoneSections(page);
const link = page.getByRole('link', { name: 'Open Swipe', exact: true });
await expect(link).toHaveCount(canUseSwipe ? 1 : 0);
if (canUseSwipe) {
@@ -118,6 +120,7 @@ test('Swipe settings test the provider and save enablement without resending its
return route.fulfill({ json: saved });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Swipe Settings' }).click();
await page.getByLabel('Enable Swipe').check();
await page.getByRole('combobox', { name: 'Effort' }).selectOption('high');
@@ -157,6 +160,7 @@ test('Swipe settings test the provider and save enablement without resending its
await page.getByRole('link', { name: 'Administration', exact: true }).click();
await expect(page).toHaveURL(/\/admin$/);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open Swipe', exact: true })
).toBeVisible();
diff --git a/lumen/tests/browser/admin-tunerr.spec.ts b/lumen/tests/browser/admin-tunerr.spec.ts
index 578df9b..c67c734 100644
--- a/lumen/tests/browser/admin-tunerr.spec.ts
+++ b/lumen/tests/browser/admin-tunerr.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
for (const [locale, labels] of [
@@ -170,6 +171,7 @@ test('Tunerr settings test partial connectivity, preserve saved passwords, and l
return route.fulfill({ json: {} });
});
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Tunerr Settings' }).click();
await expect(page.getByLabel('Deck Password')).toHaveValue('');
await expect(page.getByLabel('Deck Password')).toHaveAttribute(
diff --git a/lumen/tests/browser/app.spec.ts b/lumen/tests/browser/app.spec.ts
index e2d42da..bd8990d 100644
--- a/lumen/tests/browser/app.spec.ts
+++ b/lumen/tests/browser/app.spec.ts
@@ -1,4 +1,12 @@
import { expect, test, type Locator, type Page } from '@playwright/test';
+import {
+ closeDiscoveryFilters,
+ openAlbumMore,
+ openDiscoveryFilters,
+ openMoreActions,
+ openSections,
+} from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) =>
@@ -237,6 +245,9 @@ async function fixtures(page: Page) {
else if (path.startsWith('/music/track-requests'))
body = { items: [], results: [], requests: [], keys: [] };
else if (path === '/resolve/capabilities') body = { enabled: true };
+ // a series page asks which catalog collections it is in as it opens
+ else if (path.startsWith('/collection-catalog/tv/for-series/'))
+ body = { collections: [] };
else {
unknown.push(`${request.method()} ${path}`);
status = 404;
@@ -262,6 +273,7 @@ async function fixtures(page: Page) {
}
async function openMoreFilters(page: Page) {
+ await openDiscoveryFilters(page);
const details = page.locator('details.more-filters');
if (!(await details.evaluate((el) => (el as HTMLDetailsElement).open)))
await details.locator('summary').click();
@@ -370,6 +382,12 @@ test('movie and TV details show valid available ratings and safe links', async (
}) => {
const qa = await fixtures(page);
await page.goto(testAppPath('/movie/101'));
+ // phones fold ratings after the top two
+ await expect(page.getByTestId('video-ratings')).toBeVisible();
+ const allRatings = page.getByRole('button', {
+ name: /^Show all \d+ ratings$/,
+ });
+ if (await allRatings.count()) await allRatings.click();
await expect(
page.getByTitle('Rotten Tomatoes critics: 0%', { exact: true })
).toBeVisible();
@@ -394,18 +412,19 @@ test('movie and TV details show valid available ratings and safe links', async (
page: document.documentElement.scrollWidth,
}));
expect(movieDimensions.page).toBeLessThanOrEqual(movieDimensions.viewport);
+ // phones show the top two ratings; +N shows the rest in place, inside the page
if (movieDimensions.viewport < 700) {
- const ratingsDimensions = await page
- .getByTestId('video-ratings')
- .evaluate((element) => ({
- viewport: element.clientWidth,
- content: element.scrollWidth,
- }));
- expect(ratingsDimensions.content).toBeGreaterThan(
- ratingsDimensions.viewport
- );
+ await expect(
+ page.getByRole('button', { name: 'Show all 6 ratings' })
+ ).toHaveCount(0);
}
await page.goto(testAppPath('/tv/202'));
+ // phones fold ratings after the top two
+ await expect(page.getByTestId('video-ratings')).toBeVisible();
+ const allTvRatings = page.getByRole('button', {
+ name: /^Show all \d+ ratings$/,
+ });
+ if (await allTvRatings.count()) await allTvRatings.click();
await expect(
page.getByTitle('Rotten Tomatoes critics: 81%', { exact: true })
).toHaveAttribute('href', 'https://www.rottentomatoes.com/tv/test');
@@ -791,10 +810,12 @@ test('account changes clear private API responses and preferences without reload
.first()
).toBeVisible();
await profile(page);
+ await openPhoneSections(page);
const themeControls = page.getByRole('group', {
name: 'Theme',
exact: true,
});
+ await openPhoneSections(page);
const darkTheme = themeControls.getByRole('button', {
name: 'Dark',
exact: true,
@@ -832,6 +853,7 @@ test('account changes clear private API responses and preferences without reload
fixture.hold();
await page.getByRole('button', { name: 'Sign In', exact: true }).click();
// Login keeps the current route (/me); the new account must start with its own preferences.
+ await openPhoneSections(page);
await expect(
page
.getByRole('group', { name: 'Theme', exact: true })
@@ -1539,8 +1561,8 @@ test('music cards preserve format-specific status badges', async ({ page }) => {
]),
})
);
- await page.goto(testAppPath('/music'));
- await page.locator('details.music-catalog > summary').click();
+ // Discover's catalogue list
+ await page.goto(testAppPath('/music?catalog=1'));
const album = page.locator('.poster').filter({
has: page.getByRole('link', { name: 'Dual Format Album', exact: true }),
});
@@ -1652,7 +1674,9 @@ test('movie details keep shared HD and viewer 4K availability separate', async (
own4k = true;
await page.clock.fastForward(181_000);
await page.reload();
- await expect(status.getByText('4K on Plex', { exact: true })).toBeVisible();
+ // "hide" shows other users' HD copy as plain availability, so HD and the viewer's own 4K
+ // read as one chip (before: an "On Plex" chip and a "4K on Plex" chip)
+ await expect(status).toContainText('On Plex · HD + 4K');
await expect(page.getByText('4K · Available to Other Users')).toHaveCount(0);
await expect(page.locator('a[href*="shared-hd"]')).toHaveCount(0);
await expect(
@@ -2087,6 +2111,8 @@ test('card title preferences save only changed categories and apply to posters',
await expect(title).toBeVisible();
await page.goto(testAppPath('/me/account'));
+
+ await openSections(page);
const movieSetting = page.getByRole('combobox', {
name: 'Movies',
exact: true,
@@ -2111,6 +2137,7 @@ test('card title preferences save only changed categories and apply to posters',
// Title View is a switch under Appearance on the You page
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
const toggle = page.getByRole('switch', { name: /Title View/ });
await expect(toggle).toHaveAttribute('aria-checked', 'false');
reject = true;
@@ -2259,9 +2286,9 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
}
const actor = page.locator('.person').filter({ hasText: 'Fixture Actor' });
await expect(actor).toBeHidden();
- await page.getByText('Starring', { exact: true }).click();
+ await page.getByText('Cast & Crew', { exact: true }).click();
await expect(actor).toBeVisible();
- const pin = page.getByRole('button', { name: 'Keep Starring Open' });
+ const pin = page.getByRole('button', { name: 'Keep Cast & Crew Open' });
await pin.click();
await expect(
page.getByText('Could not save the credit preference. Try again.')
@@ -2280,8 +2307,9 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
await expect(movieDetails).not.toHaveAttribute('open', '');
await movieDetails.locator('summary').click();
await expect(movieDetails).toContainText('Runtime');
+ await expect(movieDetails.locator('summary')).toHaveText('Details');
const movieDetailsPin = movieDetails.getByRole('button', {
- name: 'Keep Movie Details Open',
+ name: 'Keep Details Open',
});
await movieDetailsPin.click();
await expect(movieDetailsPin).toHaveAttribute('aria-pressed', 'true');
@@ -2325,7 +2353,10 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
'open',
''
);
- await page.getByText('Crew', { exact: true }).click();
+ // Starring and Crew share the Cast & Crew box, kept open from the saved cast choice
+ await expect(
+ page.getByRole('heading', { name: 'Crew', exact: true })
+ ).toBeVisible();
await expect(
page.locator('.person').filter({ hasText: 'Fixture Director' })
).toBeVisible();
@@ -2398,23 +2429,15 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
fullPage: true,
});
}
- await expect(page.getByText('Starring', { exact: true })).toBeVisible();
+ await expect(page.getByText('Cast & Crew', { exact: true })).toBeVisible();
await expect(actor).toBeHidden();
- const overview = page.locator('details.adv').filter({ hasText: 'Overview' });
- await expect(overview).toBeVisible();
- await expect(overview).not.toHaveAttribute('open', '');
- await overview.locator('summary').click();
- const overviewPin = overview.getByRole('button', {
- name: 'Keep Overview Open',
- });
- await overviewPin.click();
- await expect(overviewPin).toHaveAttribute('aria-pressed', 'true');
- await page.reload();
- const restoredOverview = page
- .locator('details.adv')
- .filter({ hasText: 'Overview' });
- await expect(restoredOverview).toHaveAttribute('open', '');
- await expect(restoredOverview).toContainText('A persistent series overview.');
+ // the description sits under the title, not in a folded Overview box
+ await expect(page.locator('.dintro')).toContainText(
+ 'A persistent series overview.'
+ );
+ await expect(
+ page.locator('details.adv').filter({ hasText: /^Overview/ })
+ ).toHaveCount(0);
const seriesDetails = page
.locator('details.adv')
.filter({ hasText: 'Series Details' });
@@ -2429,7 +2452,7 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
});
}
const seriesDetailsPin = seriesDetails.getByRole('button', {
- name: 'Keep Series Details Open',
+ name: 'Keep Details Open',
});
await seriesDetailsPin.click();
await expect(seriesDetailsPin).toHaveAttribute('aria-pressed', 'true');
@@ -2439,9 +2462,9 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
.filter({ hasText: 'Series Details' });
await expect(restoredSeriesDetails).toHaveAttribute('open', '');
await expect(restoredSeriesDetails).toContainText('Episode length');
+ // Media Server is a part of the Details box now
const mediaServerPanel = page.getByTestId('tv-media-server');
- await expect(mediaServerPanel).toHaveJSProperty('open', false);
- await mediaServerPanel.locator('summary').first().click();
+ await expect(mediaServerPanel).toBeVisible();
await expect(
mediaServerPanel.getByRole('button', {
name: 'Add Fixture Series to Jellyfin Favorites',
@@ -2462,19 +2485,24 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
fullPage: true,
});
}
- const mediaServerPin = mediaServerPanel.getByRole('button', {
- name: 'Keep Media Server Open',
- });
- await mediaServerPin.click();
- await expect(mediaServerPin).toHaveAttribute('aria-pressed', 'true');
+ // closing it for good also clears the old Media Server and Subject Tags choices
+ await page.getByRole('button', { name: 'Keep Details Open' }).click();
await page.reload();
- await expect(page.getByTestId('tv-media-server')).toHaveAttribute('open', '');
- await page.getByRole('button', { name: 'Keep Media Server Open' }).click();
+ await expect(
+ page.locator('details.adv').filter({ hasText: 'Series Details' })
+ ).not.toHaveAttribute('open', '');
+ // a Media Server box kept open before the merge still opens Details
+ settings.detailDisclosurePins.tv.mediaServer = true;
await page.reload();
- await expect(page.getByTestId('tv-media-server')).not.toHaveAttribute(
- 'open',
- ''
- );
+ await expect(
+ page.locator('details.adv').filter({ hasText: 'Series Details' })
+ ).toHaveAttribute('open', '');
+ await expect(page.getByTestId('tv-media-server')).toBeVisible();
+ await page.getByRole('button', { name: 'Keep Details Open' }).click();
+ await page.reload();
+ await expect(
+ page.locator('details.adv').filter({ hasText: 'Series Details' })
+ ).not.toHaveAttribute('open', '');
await page.goto(testAppPath('/book/OL123W'));
const bookDetails = page
@@ -2485,7 +2513,7 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
await bookDetails.locator('summary').click();
await expect(bookDetails).toContainText('Science Fiction');
const bookDetailsPin = bookDetails.getByRole('button', {
- name: 'Keep Book Details Open',
+ name: 'Keep Details Open',
});
await bookDetailsPin.click();
await expect(bookDetailsPin).toHaveAttribute('aria-pressed', 'true');
@@ -2499,17 +2527,23 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
for (const path of ['/movie/101#crew', '/tv/202#crew', '/tv/202#cast']) {
await page.goto(testAppPath(path));
const credit = path.endsWith('#cast') ? 'Starring' : 'Crew';
- const summary = page.locator('summary').getByText(credit, { exact: true });
+ const heading = page.getByRole('heading', { name: credit, exact: true });
const person = page.getByRole('link', {
name:
credit === 'Crew' ? 'Fixture Director Director' : 'Fixture Actor Lead',
});
- await expect(summary).toBeInViewport();
+ await expect(heading).toBeInViewport();
await expect(person).toBeVisible();
await expect(
- page.getByRole('button', { name: `Keep ${credit} Open` })
- ).toHaveAttribute('aria-pressed', 'false');
- await summary.click();
+ page.getByRole('button', { name: 'Keep Cast & Crew Open' })
+ ).toHaveAttribute(
+ 'aria-pressed',
+ path.startsWith('/movie') ? 'true' : 'false'
+ );
+ await page
+ .locator('summary')
+ .getByText('Cast & Crew', { exact: true })
+ .click();
await expect(person).toBeHidden();
}
expect(writes).toEqual([
@@ -2518,10 +2552,9 @@ test('video credits remember scoped pins and leave failed saves retryable', asyn
{ details: true },
{ collection: true },
{ collection: false },
- { overview: true },
{ details: true },
- { mediaServer: true },
- { mediaServer: false },
+ { details: false, subjectTags: false, mediaServer: false },
+ { details: false, subjectTags: false, mediaServer: false },
{ details: true },
]);
});
@@ -2586,9 +2619,13 @@ test('book collections and subjects remember scoped pins', async ({ page }) => {
});
}
expect(seriesReads).toBe(0);
+ // Subjects is a part of the Details box
const subjects = page.getByTestId('book-subject-tags');
- await expect(subjects).toHaveJSProperty('open', false);
- await subjects.locator('summary').click();
+ const bookDetails = page
+ .locator('details.adv')
+ .filter({ hasText: 'Book Details' });
+ await expect(subjects).toBeHidden();
+ await bookDetails.locator('summary').click();
await expect(
subjects.getByRole('link', { name: 'Science Fiction', exact: true })
).toHaveAttribute('href', testAppPath('/books?subject=Science%20Fiction'));
@@ -2598,22 +2635,18 @@ test('book collections and subjects remember scoped pins', async ({ page }) => {
fullPage: true,
});
}
- const subjectsPin = subjects.getByRole('button', {
- name: 'Keep Subjects Open',
- });
- await subjectsPin.click();
- await expect(subjectsPin).toHaveAttribute('aria-pressed', 'true');
+ // a Subjects box kept open before the merge opens Details
+ settings.detailDisclosurePins.book.subjectTags = true;
await page.reload();
- await expect(page.getByTestId('book-subject-tags')).toHaveAttribute(
- 'open',
- ''
- );
- await subjectsPin.click();
+ await expect(bookDetails).toHaveAttribute('open', '');
+ await expect(subjects).toBeVisible();
+ const detailsPin = bookDetails.getByRole('button', {
+ name: 'Keep Details Open',
+ });
+ await expect(detailsPin).toHaveAttribute('aria-pressed', 'true');
+ await detailsPin.click();
await page.reload();
- await expect(page.getByTestId('book-subject-tags')).not.toHaveAttribute(
- 'open',
- ''
- );
+ await expect(bookDetails).not.toHaveAttribute('open', '');
const collection = page.getByTestId('book-series-collections');
await expect(collection).toHaveJSProperty('open', false);
@@ -2649,8 +2682,7 @@ test('book collections and subjects remember scoped pins', async ({ page }) => {
''
);
expect(writes).toEqual([
- { subjectTags: true },
- { subjectTags: false },
+ { details: false, subjectTags: false },
{ collection: true },
{ collection: false },
]);
@@ -2813,7 +2845,11 @@ test('music album Details and Artists remember scoped pins', async ({
await expect(details).not.toHaveAttribute('open', '');
await details.locator('summary').click();
await expect(details).toContainText('Fixture Records');
- const pin = details.getByRole('button', { name: 'Keep Album Details Open' });
+ // one Credits & Details box holds the facts, the artists and the tags
+ await expect(details.locator('summary')).toHaveText('Credits & Details');
+ const pin = details.getByRole('button', {
+ name: 'Keep Credits & Details Open',
+ });
await pin.click();
await expect(pin).toHaveAttribute('aria-pressed', 'true');
await page.reload();
@@ -2824,8 +2860,7 @@ test('music album Details and Artists remember scoped pins', async ({
await expect(restored).toContainText('Fixture Records');
const artists = page.getByTestId('music-artist-list');
- await expect(artists).toHaveJSProperty('open', false);
- await artists.locator('summary').click();
+ await expect(artists).toBeVisible();
await expect(
artists.getByRole('link', { name: 'Fixture Artist · Album Artist' })
).toHaveAttribute('href', testAppPath(`/artist/${artist}`));
@@ -2839,40 +2874,8 @@ test('music album Details and Artists remember scoped pins', async ({
fullPage: true,
});
}
- const artistsPin = artists.getByRole('button', {
- name: 'Keep View Artists Open',
- });
- await artistsPin.click();
- await expect(artistsPin).toHaveAttribute('aria-pressed', 'true');
- await expect(artistsPin).toBeEnabled();
- await page.reload();
- await expect(page.getByTestId('music-artist-list')).toHaveAttribute(
- 'open',
- ''
- );
- await expect(artistsPin).toBeEnabled();
- await artistsPin.click();
- await expect(page.getByTestId('music-artist-list')).not.toHaveAttribute(
- 'open',
- ''
- );
- await page.getByTestId('music-artist-list').locator('summary').click();
- await expect(artistsPin).toHaveAttribute('aria-pressed', 'false');
- await page.reload();
- await expect(page.getByTestId('music-artist-list')).not.toHaveAttribute(
- 'open',
- ''
- );
const tags = page.getByTestId('music-subject-tags');
- await expect(tags).toHaveJSProperty('open', false);
const capture = process.env.LUMEN_MUSIC_SUBJECT_TAGS_CAPTURE;
- if (capture) {
- await page.screenshot({
- path: `${capture}-closed-${test.info().project.name}.png`,
- fullPage: true,
- });
- }
- await tags.locator('summary').click();
await expect(
tags.getByRole('link', { name: 'Progressive rock', exact: true })
).toHaveAttribute('href', testAppPath('/music?genre=Progressive%20rock'));
@@ -2895,32 +2898,23 @@ test('music album Details and Artists remember scoped pins', async ({
fullPage: true,
});
}
- const tagsPin = tags.getByRole('button', {
- name: 'Keep Subject Tags Open',
- });
- await tagsPin.click();
- await expect(tagsPin).toHaveAttribute('aria-pressed', 'true');
+ // closing it for good also clears the old Artists and Subject Tags choices
+ await pin.click();
+ await expect(restored).not.toHaveAttribute('open', '');
await page.reload();
- await expect(page.getByTestId('music-subject-tags')).toHaveAttribute(
- 'open',
- ''
- );
- await tagsPin.click();
- await expect(page.getByTestId('music-subject-tags')).not.toHaveAttribute(
- 'open',
- ''
- );
+ await expect(restored).not.toHaveAttribute('open', '');
+ // an Artists box kept open before the merge still opens it
+ settings.detailDisclosurePins.music.artists = true;
await page.reload();
- await expect(page.getByTestId('music-subject-tags')).not.toHaveAttribute(
- 'open',
- ''
- );
+ await expect(restored).toHaveAttribute('open', '');
+ await expect(pin).toHaveAttribute('aria-pressed', 'true');
+ await pin.click();
+ await page.reload();
+ await expect(restored).not.toHaveAttribute('open', '');
expect(writes).toEqual([
{ details: true },
- { artists: true },
- { artists: false },
- { subjectTags: true },
- { subjectTags: false },
+ { details: false, artists: false, subjectTags: false },
+ { details: false, artists: false, subjectTags: false },
]);
});
@@ -2959,6 +2953,9 @@ test('person filmography keeps complete cast and crew groups and sorts before fi
.filter({
hasNot: page.getByRole('heading', { name: 'Credits', exact: true }),
});
+ // a long filmography shows its first titles; Show all opens the rest in place
+ await expect(castSection.locator('.poster')).toHaveCount(12);
+ await castSection.getByRole('button', { name: 'Show all (27)' }).click();
await expect(castSection.locator('.poster')).toHaveCount(27);
await expect(castSection.locator('a.hit').first()).toHaveAccessibleName(
'Film 26'
@@ -3102,6 +3099,7 @@ test('instance request settings save only changed policy flags and retain failed
});
});
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await page.getByRole('link', { name: 'Request Defaults' }).click();
await expectAppUrl(page, /\/admin\/requests$/);
const flag = page.getByRole('checkbox', {
@@ -4097,6 +4095,7 @@ test('movie genre exclusion survives reload and clears with All genres', async (
route.fulfill({ json: [{ id: 18, name: 'Drama' }] })
);
await page.goto(testAppPath('/movies?genre=18'));
+ await openDiscoveryFilters(page);
await page.getByRole('button', { name: 'Genres: Drama' }).click();
const exclude = page.getByRole('button', { name: 'Exclude Selected Genres' });
const query = page.waitForRequest((request) => {
@@ -4110,6 +4109,7 @@ test('movie genre exclusion survives reload and clears with All genres', async (
await exclude.click();
await query;
await page.reload();
+ await openDiscoveryFilters(page);
await page.getByRole('button', { name: 'Genres: Exclude Drama' }).click();
await expect(exclude).toHaveAttribute('aria-pressed', 'true');
await page.getByRole('button', { name: 'All genres', exact: true }).click();
@@ -4140,6 +4140,7 @@ test('series discovery applies and clears decimal rating bounds', async ({
await apply.click();
await filtered;
await page.reload();
+ await openMoreFilters(page);
await expect(page.getByLabel('Minimum Rating')).toHaveValue('6.2');
await page.getByLabel('Minimum Rating').fill('');
await page.getByLabel('Maximum Rating').fill('');
@@ -4188,7 +4189,10 @@ test('series streaming exclusion sends the selected providers and region', async
await page.getByRole('button', { name: 'Apply Streaming Filter' }).click();
await query;
await page.reload();
- await page.getByRole('button', { name: 'Streaming Services (2)' }).click();
+ await openMoreFilters(page);
+ await page
+ .getByRole('button', { name: 'Streaming Services (2)', exact: true })
+ .click();
await expect(page.getByLabel('Streaming Region')).toHaveValue('CA');
await expect(page.getByLabel('Provider Match')).toHaveValue('exclude');
await page.getByRole('button', { name: 'Clear Streaming Filter' }).click();
@@ -4261,6 +4265,7 @@ test('series status can be excluded and cleared without removing genre filters',
}) => {
await fixtures(page);
await page.goto(testAppPath('/series?genre=18'));
+ await openDiscoveryFilters(page);
const status = page.getByLabel('Series Status', { exact: true });
await expect(status).toBeVisible();
const exclude = page.getByRole('button', { name: 'Exclude Status' });
@@ -4278,6 +4283,7 @@ test('series status can be excluded and cleared without removing genre filters',
await exclude.click();
await query;
await page.reload();
+ await openDiscoveryFilters(page);
await expect(exclude).toHaveAttribute('aria-pressed', 'true');
await status.selectOption('');
await expectAppUrl(page, /\/series\?genre=18$/);
@@ -4305,6 +4311,7 @@ test('series release dates use first-air bounds and clear independently', async
await apply.click();
await query;
await page.reload();
+ await openMoreFilters(page);
await expect(page.getByLabel('Released On or After')).toHaveValue(
'2024-01-01'
);
@@ -4334,6 +4341,7 @@ test('movie runtime filters use minute bounds and clear independently', async ({
await page.getByRole('button', { name: 'Apply Filters' }).click();
await query;
await page.reload();
+ await openMoreFilters(page);
await expect(page.getByLabel('Maximum Runtime (Minutes)')).toHaveValue('120');
await page.getByLabel('Minimum Runtime (Minutes)').fill('');
await page.getByLabel('Maximum Runtime (Minutes)').fill('');
@@ -4369,6 +4377,7 @@ test('explicit series vote counts override the Top rated default and reset clean
await page.getByRole('button', { name: 'Apply Filters' }).click();
await query;
await page.reload();
+ await openMoreFilters(page);
await expect(page.getByLabel('Minimum Votes')).toHaveValue('10');
await page.getByLabel('Minimum Votes').fill('');
await page.getByLabel('Maximum Votes').fill('');
@@ -4389,6 +4398,8 @@ test('original language distinguishes all languages from the saved default', asy
await language.selectOption({ label: 'Japanese' });
await expectAppUrl(page, /language=ja/);
await page.reload();
+ // phones: the reload closes the filter sheet
+ await openMoreFilters(page);
await expect(language).toHaveValue('ja');
const all = page.waitForRequest((request) => {
const url = new URL(request.url());
@@ -4423,6 +4434,8 @@ test('movie origin country sends the server filter and clears independently', as
await country.selectOption({ label: 'Canada' });
await query;
await page.reload();
+ // phones: the reload closes the filter sheet
+ await openMoreFilters(page);
await expect(country).toHaveValue('CA');
await country.selectOption('');
await expectAppUrl(page, /\/movies\?genre=18$/);
@@ -4452,11 +4465,11 @@ test('production country links open the matching movie and series filters', asyn
})
);
await page.goto(testAppPath('/movie/101'));
- await page.getByText('Movie Details', { exact: true }).click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
await page.getByRole('link', { name: 'Canada', exact: true }).click();
await expectAppUrl(page, /\/movies\?country=CA$/);
await page.goto(testAppPath('/tv/202'));
- await page.getByText('Series Details', { exact: true }).click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
await page.getByRole('link', { name: 'Japan', exact: true }).click();
await expectAppUrl(page, /\/series\?country=JP$/);
});
@@ -4484,7 +4497,7 @@ test('series network details open the matching discovery query', async ({
route.fulfill({ json: { id: 42, name: 'Fixture Network' } })
);
await page.goto(testAppPath('/tv/202'));
- await page.locator('summary').filter({ hasText: 'Series Details' }).click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
await expect(
page.getByText('Unmapped Network', { exact: false })
).toBeVisible();
@@ -4511,6 +4524,7 @@ test('series discovery selects a network from the native catalog', async ({
}) => {
await fixtures(page);
await page.goto(testAppPath('/series?genre=18'));
+ await openDiscoveryFilters(page);
const network = page.getByLabel('Network', { exact: true });
const query = page.waitForRequest((request) => {
const url = new URL(request.url());
@@ -4523,6 +4537,7 @@ test('series discovery selects a network from the native catalog', async ({
await network.selectOption({ label: 'Netflix' });
await query;
await page.reload();
+ await openDiscoveryFilters(page);
await expect(network).toHaveValue('213');
await network.selectOption('');
await expectAppUrl(page, /\/series\?genre=18$/);
@@ -4544,7 +4559,7 @@ test('movie studio details open the matching discovery query', async ({
route.fulfill({ json: { id: 42, name: 'Fixture Studio' } })
);
await page.goto(testAppPath('/movie/101'));
- await page.locator('summary').filter({ hasText: 'Movie Details' }).click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
const query = page.waitForRequest((request) => {
const url = new URL(request.url());
return (
@@ -4595,6 +4610,7 @@ test('native studio and network bookmarks show company artwork in Browse', async
'src',
'/imageproxy/tmdb/t/p/w780/fixture-studio.png'
);
+ await openDiscoveryFilters(page);
await expect(
page.getByRole('button', { name: 'Clear Studio Fixture Studio' })
).toBeVisible();
@@ -4616,6 +4632,7 @@ test('native studio and network bookmarks show company artwork in Browse', async
'src',
'/imageproxy/tmdb/t/p/w780/wwemzKWzjKYJFfCeiB57q3r4Bcm.png'
);
+ await openDiscoveryFilters(page);
await expect(
page.getByRole('button', { name: 'Clear Network Netflix' })
).toBeVisible();
@@ -4657,7 +4674,14 @@ test('movie studio search can select and exclude a studio', async ({
.getByRole('button', { name: 'Exclude Studio', exact: true })
.click();
await query;
- if (page.viewportSize()!.width <= 1039) {
+ if (page.viewportSize()!.width < 700) {
+ // phones: Clear sits in the filter sheet's footer
+ await expect(
+ page
+ .locator('.browse-filter-sheet')
+ .getByRole('button', { name: 'Clear Discovery Filters' })
+ ).toBeInViewport();
+ } else if (page.viewportSize()!.width <= 1039) {
await page.evaluate(() => window.scrollTo(0, 0));
const clearFilters = page.getByRole('button', {
name: 'Clear Discovery Filters',
@@ -4670,9 +4694,11 @@ test('movie studio search can select and exclude a studio', async ({
expect(clearBounds!.y + clearBounds!.height).toBeLessThan(tabsBounds!.y);
}
await page.reload();
+ await openDiscoveryFilters(page);
await expect(
page.getByRole('button', { name: 'Exclude Studio', exact: true })
).toHaveAttribute('aria-pressed', 'true');
+ await closeDiscoveryFilters(page);
await page
.getByRole('button', { name: 'Clear Studio Fixture Studio' })
.click();
@@ -4688,6 +4714,7 @@ test('clearing discovery resets applied filters and unapplied range edits', asyn
'/series?genre=18&excludeGenre=true&network=213&status=3&excludeStatus=true&sort=vote_average.desc&watchProviders=8&watchRegion=CA&watchProviderMode=exclude&firstAirDateGte=2024-01-01&keep=1'
)
);
+ await openDiscoveryFilters(page);
const rating = page.getByLabel('Minimum Rating');
await rating.fill('7.1');
const clear = page.getByRole('button', { name: 'Clear Discovery Filters' });
@@ -4771,12 +4798,15 @@ test('movie availability can distinguish HD and 4K', async ({ page }) => {
const quality = page.getByLabel('Availability Quality');
await expect(hd).toBeVisible();
await expect(fourK).toHaveCount(0);
+ await openDiscoveryFilters(page);
await quality.selectOption('4k');
await expect(fourK).toBeVisible();
await expect(hd).toHaveCount(0);
await page.reload();
+ await openDiscoveryFilters(page);
await expect(quality).toHaveValue('4k');
await expect(fourK).toBeVisible();
+ await closeDiscoveryFilters(page);
await page.getByRole('button', { name: /^Not on / }).click();
await expect(hd).toBeVisible();
await expect(fourK).toHaveCount(0);
@@ -4831,6 +4861,7 @@ test('available series use the library query and retain quality with catalog fil
});
await expect(library).toBeVisible();
await expect.poll(() => queries).toContainEqual(['4k', null]);
+ await openDiscoveryFilters(page);
const status = page.getByLabel('Series Status', { exact: true });
await status.selectOption('0');
await expect(
@@ -5945,6 +5976,7 @@ test('Classic comic discovery bookmarks restore catalogue filters and results',
'href',
testAppPath('/comic/1234')
);
+ await openDiscoveryFilters(page);
await expect(
filterForm.getByRole('searchbox', { name: 'Publisher' })
).toHaveValue('Image');
@@ -6079,6 +6111,7 @@ test('Classic music discovery bookmarks retain catalogue filters', async ({
await expect(page.getByRole('heading', { name: copy.title })).toBeVisible();
await expect(page.getByText(copy.subtitle)).toBeVisible();
await expect(page.getByPlaceholder(copy.search)).toHaveValue(query);
+ await openDiscoveryFilters(page);
await expect(
page.getByRole('combobox', { name: copy.sort, exact: true })
).toHaveValue(filters.sortBy);
@@ -6094,6 +6127,7 @@ test('Classic music discovery bookmarks retain catalogue filters', async ({
)
)
.toBe(true);
+ await closeDiscoveryFilters(page);
await page.getByRole('button', { name: /EP \+ 1$/ }).click();
const releaseTypes = page.getByRole('dialog', { name: copy.releaseTypes });
await expect(
@@ -6116,6 +6150,7 @@ test('Classic music discovery bookmarks retain catalogue filters', async ({
.getByRole('button', { name: copy.done, exact: true })
.click();
const form = page.getByRole('form', { name: copy.filters });
+ await openDiscoveryFilters(page);
await expect(form.getByRole('searchbox', { name: copy.artist })).toHaveValue(
filters.artist
);
@@ -6522,9 +6557,11 @@ test('Music album and artist details localize their controls and metadata', asyn
await expect(page.getByText(copy.tracks, { exact: true })).toBeVisible();
await expect(page.getByText(copy.plays, { exact: true })).toBeVisible();
await expect(page.getByText(copy.trackCount, { exact: true })).toBeVisible();
- await expect(page.getByTestId('music-ratings')).toContainText(
- copy.musicBrainzRating
- );
+ await expect(
+ page.getByTestId('music-ratings').getByRole('link', {
+ name: copy.musicBrainzRating,
+ })
+ ).toBeVisible();
await expect(page.getByTestId('music-ratings')).toContainText(
copy.discogsFailure
);
@@ -6571,7 +6608,16 @@ test('Music album and artist details localize their controls and metadata', asyn
await expect
.poll(() => requestedMusicVariants)
.toEqual(['22222222-2222-4222-8222-222222222222']);
- await page.getByText(copy.albumDetails, { exact: true }).click();
+ // Album Details is a part of the Credits & Details box
+ await page
+ .locator('details.adv')
+ .filter({ hasText: copy.albumDetails })
+ .locator('summary')
+ .first()
+ .click();
+ await expect(
+ page.getByRole('heading', { name: copy.albumDetails, exact: true })
+ ).toBeVisible();
for (const label of [copy.artist, copy.released, copy.label, copy.type])
await expect(page.getByText(label, { exact: true })).toBeVisible();
expect(
@@ -6585,6 +6631,7 @@ test('Music album and artist details localize their controls and metadata', asyn
});
}
+ if ((page.viewportSize()?.width ?? 1440) < 700) await openAlbumMore(page);
await page.getByRole('button', { name: copy.libraryHealth }).click();
await expect(page.getByText(copy.healthIssue)).toBeVisible();
await expect(page.getByText(copy.healthReason)).toBeVisible();
@@ -6619,6 +6666,8 @@ test('Music album and artist details localize their controls and metadata', asyn
await expect(
page.getByRole('heading', { name: 'Fixture Artist' })
).toBeVisible();
+ // phones keep these in the More sheet
+ await openMoreActions(page);
await expect(
page.getByRole('link', { name: copy.discography })
).toBeVisible();
@@ -7310,6 +7359,7 @@ test('music and Open Library book details open Associations with exact identity'
testAppPath(`/associations/album/${album}`)
);
await page.goto(testAppPath(`/artist/${artist}`));
+ await openMoreActions(page);
await expect(
page.getByRole('heading', { name: 'Fixture Artist' })
).toBeVisible();
@@ -7318,6 +7368,7 @@ test('music and Open Library book details open Associations with exact identity'
testAppPath(`/associations/artist/${artist}`)
);
await page.goto(testAppPath('/book/OL123W?format=audiobook'));
+ await openMoreActions(page);
await association.click();
await expect(
page.getByRole('heading', { name: 'Associations for Fixture Book' })
@@ -7394,6 +7445,7 @@ test('native companion discovery filters retain genre matching and clear without
voteCountGte: '50',
search: 'The Film',
});
+ await openDiscoveryFilters(page);
const title = page.getByRole('searchbox', { name: 'Title', exact: true });
await expect(title).toHaveValue('The Film');
await title.fill('all');
@@ -7476,6 +7528,7 @@ test('a saved 4K discovery filter waits for availability settings and retries fa
await expect(page.getByText('Nothing here', { exact: true })).toHaveCount(0);
settingsAvailable = true;
await page.getByRole('button', { name: 'Retry', exact: true }).click();
+ await openDiscoveryFilters(page);
await expect(page.getByLabel('Availability Quality')).toHaveValue('4k');
await expect(page.getByRole('link', { name: movie.title })).toBeVisible();
expect(queries).toEqual(['4k']);
@@ -7985,6 +8038,7 @@ test('TV access review confirms a decision and respects manager permissions', as
}
);
await page.goto(testAppPath('/me/account/tv-requests'));
+ await openSections(page);
await expect(
page.getByText('Another user manager must review your request.')
).toBeVisible();
@@ -9135,6 +9189,7 @@ test('System Logs filters server entries and excludes non-admins', async ({
});
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open System Logs' }).click();
await expect(page.getByText('Initial result')).toBeVisible();
await page.getByRole('button', { name: 'Next Page' }).click();
@@ -9214,6 +9269,7 @@ test('Media Categories saves only changed instance switches and excludes non-adm
return route.fulfill({ json: { enabledMediaCategories: categories } });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Media Categories' }).click();
await page.getByRole('checkbox', { name: 'Movies', exact: true }).uncheck();
await page.getByRole('button', { name: 'Save Categories' }).click();
@@ -9435,6 +9491,7 @@ test('General Settings retains application edits after failure and saves only ch
return route.fulfill({ json: saved });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open General Settings' }).click();
const title = page.getByLabel('Application Title');
const save = page.getByRole('button', { name: 'Save Application Settings' });
@@ -10016,10 +10073,12 @@ test('Classic service category bookmarks filter the Lumen administration menu',
await expect(
page.getByRole('link', { name: 'Open Lidarr Services' })
).toBeVisible();
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open Radarr Services' })
).toHaveCount(0);
await page.getByRole('link', { name: 'All Settings and Tools' }).click();
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open Radarr Services' })
).toBeVisible();
@@ -10088,6 +10147,7 @@ test('Administration search brings the Steam key field into view', async ({
})
);
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
await page
.getByRole('searchbox', { name: 'Search Settings' })
.fill('steam key');
@@ -10256,6 +10316,7 @@ test('Administration search opens the download client polling interval', async (
route.fulfill({ json: { pollIntervalSeconds: 7, clients: [] } })
);
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
await page
.getByRole('searchbox', { name: 'Search Settings' })
.fill('poll frequency');
@@ -10463,6 +10524,7 @@ test('Scheduled Jobs runs immediately and saves an edited schedule', async ({
return route.fulfill({ json: job });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Scheduled Jobs' }).click();
await expect(
page.getByRole('button', { name: 'Cancellation Unavailable' })
@@ -10635,6 +10697,7 @@ test('About SeerrNG shows installed version and respects disabled update checks'
})
);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open About SeerrNG' }).click();
await expect(page.getByText('v3.72.38', { exact: true })).toBeVisible();
await expect(
@@ -10682,6 +10745,7 @@ test('Users lets delegated managers search without exposing the directory to mem
});
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Users', exact: true }).click();
await expect(page.getByText('Owner Initial')).toBeVisible();
await page.getByLabel('Search Users').fill('Owner & admin');
@@ -11989,6 +12053,7 @@ test('General Settings shortcuts scroll to their controls after settings load',
['/admin/general', 'apiKey', 'API Key', 'apikey', 'Application API Key'],
] as const) {
await page.goto(testAppPath('/admin'));
+ await openPhoneSections(page);
await page.getByRole('searchbox', { name: 'Search Settings' }).fill(query);
await page.getByRole('link', { name: `Open ${result}` }).click();
await expect(page).toHaveURL(`${testAppPath(pagePath)}#${anchor}`);
@@ -12308,6 +12373,7 @@ test('Discover and Movies apply visibility defaults while the library view still
.selectOption('original_title.asc');
await sortedLibrarySearch;
await expect(page.getByRole('link', { name: 'Owned fixture' })).toBeVisible();
+ await closeDiscoveryFilters(page);
await page.getByRole('button', { name: 'All', exact: true }).click();
await expect(
page.getByRole('link', { name: 'Requested fixture' })
@@ -12340,6 +12406,7 @@ test('Discover and Movies apply visibility defaults while the library view still
'./series?show=have&firstAirDateGte=2025-12-31&firstAirDateLte=2025-01-01'
)
);
+ await openMoreFilters(page);
await expect(
page.getByRole('alert').filter({ hasText: 'lower bound' })
).toBeVisible();
@@ -12608,11 +12675,7 @@ test('movie and series details use separate account regions for providers and ra
['/tv/202', '15', 'TV-MA', 'series'],
]) {
await page.goto(testAppPath(path));
- await page
- .getByText(capture === 'movie' ? 'Movie Details' : 'Series Details', {
- exact: true,
- })
- .click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
await expect(
page.getByText('Streaming Providers', { exact: true })
).toBeVisible();
@@ -12655,6 +12718,7 @@ test('discovery sort displays Classic bookmark orders and sends changes to the c
await page.goto(
testAppPath(`${route}?nativeFilters=1&sortBy=${initial}&language=fr`)
);
+ await openDiscoveryFilters(page);
const sort = page.getByRole('combobox', { name: 'Sort', exact: true });
await expect(sort).toHaveValue(initial);
const request = page.waitForRequest((item) => {
@@ -12668,6 +12732,7 @@ test('discovery sort displays Classic bookmark orders and sends changes to the c
await sort.selectOption(next);
await request;
await page.reload();
+ await openDiscoveryFilters(page);
await expect(sort).toHaveValue(next);
}
});
@@ -12681,6 +12746,7 @@ test('discovery content ratings preserve Classic filters and apply exact ratings
'/movies?nativeFilters=1&certificationGte=PG&certificationLte=R&certificationCountry=US&genre=18'
)
);
+ await openDiscoveryFilters(page);
const select = page.getByRole('combobox', { name: 'Content Rating' });
await expect(select).toHaveValue('range');
const exact = page.waitForRequest((request) => {
@@ -12696,6 +12762,7 @@ test('discovery content ratings preserve Classic filters and apply exact ratings
await select.selectOption('PG-13');
await exact;
await page.reload();
+ await openDiscoveryFilters(page);
await expect(select).toHaveValue('PG-13');
await select.selectOption('');
await expectAppUrl(page, /\/movies\?genre=18$/);
@@ -12907,9 +12974,7 @@ test('All search keeps successful results and retries a failed book catalog', as
});
await page.goto(testAppPath('./search?q=Test'));
const film = page.getByRole('link', { name: 'Available Film' });
- const warning = page
- .getByRole('alert')
- .filter({ hasText: 'some search results' });
+ const warning = page.locator('.search-service-note');
await expect(film).toBeVisible();
await expect(warning).toBeVisible();
bookCatalogUnavailable = false;
@@ -12924,7 +12989,7 @@ test('All search keeps successful results and retries a failed book catalog', as
await page.goto(testAppPath('./search?q=Other'));
await expect(film).toBeVisible();
expect(videoCalls).toBe(2);
- await expect(warning).toContainText('A search provider did not respond.');
+ await expect(warning).toContainText('Some sources didn’t answer');
videoPartial = false;
await warning.getByRole('button', { name: 'Retry' }).click();
await expect.poll(() => videoCalls).toBe(3);
@@ -13822,12 +13887,11 @@ test('audiobook discovery bookmarks apply search, author and narrator and show s
)
);
await expectAppUrl(page, /\/audiobooks\?sortBy=oldest/);
+ // no series matched: Search adds no empty Book Series section
await expect(
page.getByRole('link', { name: 'View All Series Results' })
- ).toHaveAttribute(
- 'href',
- testAppPath('/book-series?query=Fixture+Series&format=audiobook')
- );
+ ).toHaveCount(0);
+ await openDiscoveryFilters(page);
const form = page.getByRole('form', { name: 'Book Discovery Search' });
await expect(form.getByLabel('Narrator')).toHaveValue('Reader');
await form.getByLabel('Narrator').fill('Another Reader');
@@ -13844,7 +13908,9 @@ test('audiobook discovery bookmarks apply search, author and narrator and show s
await form.getByRole('button', { name: 'Search Books' }).click();
await edited;
await page.reload();
+ await openDiscoveryFilters(page);
await expect(form.getByLabel('Narrator')).toHaveValue('Another Reader');
+ await closeDiscoveryFilters(page);
await page.getByRole('button', { name: 'Clear Book Search' }).click();
await expectAppUrlNot(
page,
@@ -13881,6 +13947,7 @@ test('Streaming Subscriptions retains edits after stale persisted readback and r
route.fulfill({ json: [] })
);
await page.goto(testAppPath('/me/account'));
+ await openSections(page);
const section = page.locator('section').filter({
has: page.getByRole('heading', { name: 'Streaming Subscriptions' }),
});
@@ -13936,6 +14003,8 @@ test('Streaming Subscriptions bulk actions preserve hidden and uncatalogued prov
);
await page.goto(testAppPath('/me/account'));
+
+ await openSections(page);
const section = page.locator('section').filter({
has: page.getByRole('heading', { name: 'Streaming Subscriptions' }),
});
diff --git a/lumen/tests/browser/audit-fixes.spec.ts b/lumen/tests/browser/audit-fixes.spec.ts
index 95fcbd0..0adb4a0 100644
--- a/lumen/tests/browser/audit-fixes.spec.ts
+++ b/lumen/tests/browser/audit-fixes.spec.ts
@@ -230,14 +230,9 @@ test('movie playback actions follow the selected locale', async ({ page }) => {
exact: true,
});
await expect(watchUhd).toHaveAttribute('href', uhd);
+ // HD and 4K both on the server: one chip says so
await expect(page.locator('.dstatus')).toContainText(
- baseline
- ? '4K on Plex'
- : {
- en: '4K on Plex',
- fr: '4K sur Plex',
- ar: 'بدقة 4K على Plex',
- }[locale]
+ baseline ? '4K on Plex' : 'HD + 4K'
);
if (captureDir && (width === 1440 || width === 390))
await page.screenshot({ path: `${captureDir}/${locale}-${width}-4k.png` });
diff --git a/lumen/tests/browser/blocklist.spec.ts b/lumen/tests/browser/blocklist.spec.ts
index 292ec85..441eb1b 100644
--- a/lumen/tests/browser/blocklist.spec.ts
+++ b/lumen/tests/browser/blocklist.spec.ts
@@ -1,4 +1,6 @@
import { expect, test } from '@playwright/test';
+import { openMoreActions } from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) => `${testMount}${path}`;
@@ -88,6 +90,7 @@ for (const permissions of [32, 1073741824, 268435456]) {
await expect(page.getByText('No entries match this view.')).toBeVisible();
expect(removals).toEqual(['/blocklist/hc%3A123?mediaType=book']);
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open Blocklist' })
).toHaveCount(0);
@@ -316,6 +319,7 @@ test('detail Blocklist actions send the canonical identity for every supported m
// the album page keeps its admin tools behind "More"
if (item.mediaType === 'music')
await page.locator('#view').getByText('More', { exact: true }).click();
+ else await openMoreActions(page);
await page.getByRole('button', { name: 'Add to Blocklist' }).click();
await page
.getByRole('alertdialog')
@@ -328,6 +332,7 @@ test('detail Blocklist actions send the canonical identity for every supported m
.evaluate((menu) => (menu as HTMLDetailsElement).open))
)
await page.locator('#view').getByText('More', { exact: true }).click();
+ else if (item.mediaType !== 'music') await openMoreActions(page);
await expect(
page.getByRole('button', { name: 'Remove from Blocklist' })
).toBeVisible();
diff --git a/lumen/tests/browser/book-edition-layout.spec.ts b/lumen/tests/browser/book-edition-layout.spec.ts
new file mode 100644
index 0000000..1105676
--- /dev/null
+++ b/lumen/tests/browser/book-edition-layout.spec.ts
@@ -0,0 +1,204 @@
+import { expect, test, type Page } from '@playwright/test';
+import { testAppPath } from './testAppPath';
+
+// Book pages lay out like the manga page: a short description with Show more, a folded edition
+// list, and one Follow button for the selected narrator. Switching format stays on the same answer.
+const bookId = 'bookshelf:1:aGM6NDI0Mg';
+const ed = (id: string, narrators: string[]) => ({
+ id,
+ requestable: true,
+ title: 'The Two Towers',
+ format: 'audiobook',
+ language: 'eng',
+ narrators,
+ durationSeconds: 74760,
+ publisher: 'Recorded Books',
+ releaseDate: '2002-01-01',
+ selected: id === '1',
+ owned: false,
+});
+const narrators = [
+ 'Rob Inglis',
+ 'Andy Serkis',
+ 'Phil Dragash',
+ 'Rob Ingles',
+ 'Martin Shaw',
+ 'Nicol Williamson',
+ 'Ian Holm',
+];
+const blurb = 'Frodo and Sam go on alone toward Mordor. '.repeat(30).trim();
+
+async function fixtures(page: Page) {
+ const asked: string[] = [];
+ await page.route('https://**/*', (r) => r.abort());
+ await page.route('**/lumen-config.json', (r) => r.fulfill({ json: {} }));
+ await page.route('**/api/v1/**', async (route) => {
+ const req = route.request();
+ const url = new URL(req.url());
+ const path = url.pathname.slice(7);
+ if (req.method() === 'GET') asked.push(path + url.search);
+ if (path === '/settings/public')
+ return route.fulfill({
+ json: {
+ mediaServerType: 1,
+ localLogin: true,
+ booksEnabled: true,
+ ebookServiceEnabled: true,
+ audiobookServiceEnabled: true,
+ enabledMediaCategories: { ebook: true, audiobook: true },
+ },
+ });
+ if (path === '/auth/me')
+ return route.fulfill({
+ json: { id: 1, displayName: 'fam', permissions: 2 | 32 },
+ });
+ if (path === '/editions/book')
+ return route.fulfill({
+ json: { editions: narrators.map((n, i) => ed(String(i + 1), [n])) },
+ });
+ if (path === '/follow') return route.fulfill({ json: { results: [] } });
+ // a lookup by title is a fresh lookup in SeerrNG: slow
+ if (path.startsWith('/book/') && url.searchParams.has('lookupTitle'))
+ await new Promise((done) => setTimeout(done, 2500));
+ if (path.startsWith('/book/') && !path.endsWith('/ratings'))
+ return route.fulfill({
+ json: {
+ id: bookId,
+ mediaType: 'book',
+ title: 'The Two Towers',
+ author: 'J.R.R. Tolkien',
+ description: blurb,
+ posterPath: '/cover.jpg',
+ publisher: 'Houghton Mifflin',
+ firstPublishYear: 1954,
+ numberOfPages: 352,
+ series: [{ id: 's1', title: 'The Lord of the Rings', position: '2' }],
+ },
+ });
+ if (path.startsWith('/service/') || path.startsWith('/genres/'))
+ return route.fulfill({ json: [] });
+ return route.fulfill({
+ json: { page: 1, totalPages: 1, totalResults: 0, results: [] },
+ });
+ });
+ return asked;
+}
+
+const radios = (page: Page) =>
+ page.getByRole('radiogroup', { name: 'Narrations' }).getByRole('radio');
+
+test('a long narration list folds and offers one Follow button', async ({
+ page,
+}) => {
+ await fixtures(page);
+ await page.goto(testAppPath(`/book/${encodeURIComponent(bookId)}?f=audio`));
+ // four narrations plus "Any English narrator"
+ await expect(radios(page)).toHaveCount(5);
+ await expect(radios(page).last()).toContainText('Any English narrator');
+ const narratorFollows = page
+ .getByRole('button', { name: /^Follow / })
+ .filter({ hasNotText: 'New Releases' });
+ await expect(narratorFollows).toHaveCount(1);
+ await expect(narratorFollows).toHaveText('Follow Rob Inglis');
+
+ await page.getByRole('button', { name: 'All 7 narrations' }).click();
+ await expect(radios(page)).toHaveCount(8);
+ // the Follow button follows the selection
+ await radios(page).filter({ hasText: 'Ian Holm' }).click();
+ await expect(narratorFollows).toHaveCount(1);
+ await expect(narratorFollows).toHaveText('Follow Ian Holm');
+ // folding again keeps the selected row in view
+ await page.getByRole('button', { name: 'Show fewer' }).click();
+ await expect(radios(page)).toHaveCount(6);
+ await expect(radios(page).filter({ hasText: 'Ian Holm' })).toHaveAttribute(
+ 'aria-checked',
+ 'true'
+ );
+});
+
+test('the description shows three lines with Show more', async ({ page }) => {
+ await fixtures(page);
+ await page.goto(testAppPath(`/book/${encodeURIComponent(bookId)}?f=audio`));
+ const about = page.locator('.clamp-text .ov.long');
+ await expect(about).toHaveClass(/clamp-3/);
+ const more = page.getByRole('button', { name: 'Show more' });
+ await expect(more).toBeVisible();
+ await more.click();
+ await expect(about).not.toHaveClass(/clamp-3/);
+ await expect(page.getByRole('button', { name: 'Show less' })).toBeVisible();
+});
+
+test('the ebook shows as one edition card', async ({ page }) => {
+ await fixtures(page);
+ await page.goto(testAppPath(`/book/${encodeURIComponent(bookId)}`));
+ await expect(page.getByRole('heading', { name: 'Edition' })).toBeVisible();
+ const card = page.locator('#edition .nrow');
+ await expect(card).toContainText('Ebook · EPUB');
+ await expect(card).toContainText('Houghton Mifflin · 1954 · 352 pages');
+});
+
+test('switching between ebook and audiobook keeps the book on screen', async ({
+ page,
+}) => {
+ const asked = await fixtures(page);
+ // opened without a lookup title (top result, search suggestion, watchlist): the format links
+ // add the resolved title, which SeerrNG looks up again
+ await page.goto(testAppPath(`/book/${encodeURIComponent(bookId)}`));
+ await expect(page.locator('.fmt a').nth(1)).toContainText('7 narrations');
+ await expect(page.locator('.fmt a').nth(1)).toHaveAttribute(
+ 'href',
+ /lookupTitle=The\+Two\+Towers/
+ );
+ const titled = () =>
+ asked.filter(
+ (p) =>
+ p.startsWith('/book/') &&
+ !p.includes('/ratings') &&
+ p.includes('lookupTitle')
+ );
+ // nothing extra is asked until the link is pointed at
+ expect(titled()).toHaveLength(0);
+ await page.locator('.fmt a').nth(1).hover();
+ await expect.poll(() => titled().length).toBe(1);
+
+ const started = Date.now();
+ await page.locator('.fmt a').nth(1).click();
+ // the narrations show straight away, not after the slow lookup
+ await expect(radios(page).first()).toBeVisible({ timeout: 1500 });
+ await expect(page.locator('article.detail h1')).toHaveText('The Two Towers');
+ expect(Date.now() - started).toBeLessThan(1500);
+ await page.locator('.fmt a').nth(0).click();
+ await expect(page.locator('#edition')).toBeVisible({ timeout: 1500 });
+ // the prefetch and the page share one lookup
+ await page.waitForTimeout(3000);
+ expect(titled()).toHaveLength(1);
+});
+
+test('the overview comes first, then the narrations, then the folded boxes', async ({
+ page,
+}) => {
+ await fixtures(page);
+ await page.goto(testAppPath(`/book/${encodeURIComponent(bookId)}?f=audio`));
+ await expect(radios(page).first()).toBeVisible();
+ const order = await page.evaluate(() => {
+ const at = (selector: string) => document.querySelector(selector);
+ const pairs: [string, string][] = [
+ ['.fmt', '.clamp-text'],
+ ['.clamp-text', '#narr'],
+ ['#narr', '[data-testid="book-series-collections"]'],
+ ];
+ return pairs.map(([a, b]) => {
+ const first = at(a);
+ const second = at(b);
+ return (
+ !!first &&
+ !!second &&
+ !!(
+ first.compareDocumentPosition(second) &
+ Node.DOCUMENT_POSITION_FOLLOWING
+ )
+ );
+ });
+ });
+ expect(order).toEqual([true, true, true]);
+});
diff --git a/lumen/tests/browser/book-grouping.spec.ts b/lumen/tests/browser/book-grouping.spec.ts
index 55b217f..19646b0 100644
--- a/lumen/tests/browser/book-grouping.spec.ts
+++ b/lumen/tests/browser/book-grouping.spec.ts
@@ -185,7 +185,7 @@ test('book details reach the author and series and send the exact shelf target',
}
await preview();
await page.goto(appPath('/book/OL11W'));
- await page.getByText('Book Details', { exact: true }).click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
await page.getByRole('link', { name: /Fixture Series #1/ }).click();
await expect(
page.getByRole('heading', { name: 'Fixture Series' })
diff --git a/lumen/tests/browser/book-library.spec.ts b/lumen/tests/browser/book-library.spec.ts
index fcfd97d..5a00335 100644
--- a/lumen/tests/browser/book-library.spec.ts
+++ b/lumen/tests/browser/book-library.spec.ts
@@ -1,4 +1,8 @@
import { expect, test, type Page } from '@playwright/test';
+import {
+ closeDiscoveryFilters,
+ openDiscoveryFilters,
+} from './discoveryFilters';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const testAppPath = (path: string) =>
@@ -85,6 +89,7 @@ test('personal overlay color applies to the genre picker', async ({ page }) => {
);
const open = async () => {
await page.goto(mountedTestAppPath('./books'));
+ await openDiscoveryFilters(page);
await page.getByRole('button', { name: /^Genres:/ }).click();
const overlay = page.locator('.gp-pop, .gp-sheet');
await expect(overlay).toBeVisible();
@@ -121,6 +126,7 @@ test('Books and Audiobooks open on rows, one per sort', async ({ page }) => {
await expect.poll(feed).toContainEqual('?format=ebook');
// the rows are one page each: the full list's paging stays quiet until See all
expect(feed().some((q) => q.includes('page='))).toBe(false);
+ await openDiscoveryFilters(page);
// Sort and genres are on the landing too; neither is picked yet
await expect(page.getByLabel('Sort')).toHaveValue('');
// the genres are folded into one button until it is opened
@@ -178,7 +184,9 @@ test('See all opens the full list with that sort, and Overview or Back returns t
.filter({ has: page.getByRole('heading', { name, exact: true }) });
await row('Trending').getByRole('link', { name: 'See all' }).click();
await expect(page).toHaveURL(/\/books\?sort=trending$/);
+ await openDiscoveryFilters(page);
await expect(page.getByLabel('Sort')).toHaveValue('trending');
+ await closeDiscoveryFilters(page);
await expect(
page.getByRole('heading', { name: 'Trending ebooks' })
).toBeVisible();
@@ -196,18 +204,22 @@ test('See all opens the full list with that sort, and Overview or Back returns t
// Popular is the feed's default order: its list keeps sort=ranked so it stays a list
await row('Popular').getByRole('link', { name: 'See all' }).click();
await expect(page).toHaveURL(/\/books\?sort=ranked$/);
+ await openDiscoveryFilters(page);
await expect(page.getByLabel('Sort')).toHaveValue('ranked');
await expect(
page.getByRole('heading', { name: 'Popular ebooks' })
).toBeVisible();
await expect.poll(feed).toContainEqual('?format=ebook&page=1');
+ await closeDiscoveryFilters(page);
await page.getByRole('link', { name: 'Overview', exact: true }).click();
await expect(page).toHaveURL(/\/books$/);
await expect(
page.getByRole('heading', { name: 'Top rated', exact: true })
).toBeVisible();
+ await openDiscoveryFilters(page);
await expect(page.getByLabel('Sort')).toHaveValue('');
+ await closeDiscoveryFilters(page);
// In library from the rows opens the library list
await page.getByRole('button', { name: 'In library', exact: true }).click();
@@ -259,6 +271,7 @@ test('Books and Audiobooks can be sorted like the SeerrNG web app', async ({
const feed = () =>
requests.filter((r) => r.path === '/discover/books').map((r) => r.query);
await page.goto(mountedTestAppPath('/books?sort=ranked'));
+ await openDiscoveryFilters(page);
const sort = page.getByLabel('Sort');
await expect(sort).toHaveValue('ranked');
await expect(
@@ -277,10 +290,12 @@ test('Books and Audiobooks can be sorted like the SeerrNG web app', async ({
.toContainEqual(expect.stringContaining('sortBy=newest'));
// the library list has no sort, so the menu steps aside there
+ await closeDiscoveryFilters(page);
await page.getByRole('button', { name: 'In library' }).click();
await expect(page.getByLabel('Sort')).toHaveCount(0);
await page.goto(mountedTestAppPath('/audiobooks?sort=rating.desc'));
+ await openDiscoveryFilters(page);
await expect(page.getByLabel('Sort')).toHaveValue('rating.desc');
await expect(
page.getByRole('heading', { name: 'Top rated audiobooks' })
@@ -293,6 +308,7 @@ test('Books and Audiobooks can be sorted like the SeerrNG web app', async ({
// an unknown sort in the address falls back to Popular
await page.goto(mountedTestAppPath('/books?sort=bogus'));
+ await openDiscoveryFilters(page);
await expect(page.getByLabel('Sort')).toHaveValue('ranked');
});
test('a genre or a sort from the landing fills the page with that list, and Back returns to the rows', async ({
@@ -314,6 +330,7 @@ test('a genre or a sort from the landing fills the page with that list, and Back
).toBeVisible();
// a sort opens the full list sorted that way
+ await openDiscoveryFilters(page);
await page.getByLabel('Sort').selectOption('newest');
await expect(page).toHaveURL(/\/books\?sort=newest$/);
await expect(page.getByRole('heading', { name: 'New ebooks' })).toBeVisible();
@@ -327,6 +344,7 @@ test('a genre or a sort from the landing fills the page with that list, and Back
page.getByRole('heading', { name: 'Trending', exact: true })
).toBeVisible();
+ await openDiscoveryFilters(page);
// a genre opens the full list of that genre (a phrase is sent as one quoted term); the
// picker stays open on the list for picking more
await picker.click();
@@ -401,12 +419,15 @@ test('a genre or a sort from the landing fills the page with that list, and Back
await expect(picker).toHaveText('Fantasy');
// a click outside closes it (on a phone, the dimmed page above the sheet)
if (phone)
- await page.locator('.sheet-scrim').click({ position: { x: 20, y: 20 } });
+ await page
+ .locator('.sheet-wrap:has(.gp-sheet) .sheet-scrim')
+ .click({ position: { x: 20, y: 20 } });
else
await page
.getByRole('heading', { name: 'Trending fantasy ebooks' })
.click();
await expect(genres).toHaveCount(0);
+ await closeDiscoveryFilters(page);
// In library has no genres; the genre comes back with All
await page.getByRole('button', { name: 'In library', exact: true }).click();
@@ -415,6 +436,7 @@ test('a genre or a sort from the landing fills the page with that list, and Back
page.getByRole('heading', { name: 'In your library' })
).toBeVisible();
await page.getByRole('button', { name: 'All', exact: true }).click();
+ await openDiscoveryFilters(page);
await expect(picker).toHaveText('Fantasy');
// All genres clears the genres and stays on the list
@@ -671,7 +693,7 @@ test('Book Details metadata matches native book facts when providers supply them
})
);
await page.goto(mountedTestAppPath(`/book/${encodeURIComponent(ebookId)}`));
- await page.locator('summary', { hasText: 'Book Details' }).click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
const facts = page.locator('.facts2');
for (const fact of [
'Example Press',
@@ -718,7 +740,7 @@ test('Book Details never turns Bookshelf IDs or untrusted rating IDs into Open L
})
);
await page.goto(mountedTestAppPath(`/book/${encodeURIComponent(ebookId)}`));
- await page.locator('summary', { hasText: 'Book Details' }).click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
const facts = page.locator('.facts2');
await expect(facts).toContainText('Not Available');
await expect(facts.getByRole('link', { name: /OL|attacker/i })).toHaveCount(
@@ -1121,9 +1143,7 @@ test('audiobook search offers books the audiobook catalogue has not seen yet', a
await page.goto(mountedTestAppPath('/search?q=brand%20new&f=audio'));
const card = page.locator('.poster', { hasText: 'Brand New Book' });
await expect(card).toHaveCount(1);
- await expect(
- page.getByRole('alert').filter({ hasText: 'Series search is unavailable.' })
- ).toBeVisible();
+ await expect(page.locator('.search-service-note')).toBeVisible();
await expect(card).toHaveClass(/sq/);
await expect(card.locator('a.hit')).toHaveAttribute(
'href',
diff --git a/lumen/tests/browser/book-management-sheet.spec.ts b/lumen/tests/browser/book-management-sheet.spec.ts
index b9e276e..34817d0 100644
--- a/lumen/tests/browser/book-management-sheet.spec.ts
+++ b/lumen/tests/browser/book-management-sheet.spec.ts
@@ -1,6 +1,7 @@
import { expect, test, type Page } from '@playwright/test';
import { mkdir } from 'node:fs/promises';
import { dirname } from 'node:path';
+import { openMoreActions } from './discoveryFilters';
import { testAppPath } from './testAppPath';
async function openBookManager(page: Page, permissions: number) {
@@ -151,6 +152,7 @@ test('book manager shows requests and both formats, and confirms exact library c
page,
}) => {
const { deletes, libraryReads } = await openBookManager(page, 2);
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Manage Book' }).click();
const sheet = page.getByRole('dialog', { name: 'Manage Book' });
await expect(sheet.getByText('Requests')).toBeVisible();
@@ -177,6 +179,7 @@ test('book manager shows requests and both formats, and confirms exact library c
path: `${capture}-${test.info().project.name}-baseline.png`,
});
await page.reload();
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Manage Book' }).click();
await expect(sheet).toBeVisible();
}
@@ -249,9 +252,9 @@ test('book manager and library plan stay hidden without management access', asyn
page,
}) => {
const { libraryReads } = await openBookManager(page, 0);
- await expect(page.getByRole('button', { name: 'Manage Book' })).toHaveCount(
- 0
- );
+ await expect(
+ page.getByRole('button', { name: 'Manage Book', includeHidden: true })
+ ).toHaveCount(0);
await expect(page.getByRole('dialog', { name: 'Manage Book' })).toHaveCount(
0
);
@@ -262,6 +265,7 @@ test('cross-media manager reviews and resolves or deletes issues with permission
page,
}) => {
await openBookManager(page, 2);
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Manage Book' }).click();
let sheet = page.getByRole('dialog', { name: 'Manage Book' });
await expect(sheet.getByText('#77 · Approved · Ebook')).toBeVisible();
@@ -283,6 +287,7 @@ test('cross-media manager reviews and resolves or deletes issues with permission
fullPage: false,
});
await page.reload();
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Manage Book' }).click();
sheet = page.getByRole('dialog', { name: 'Manage Book' });
}
@@ -327,6 +332,7 @@ test('cross-media manager reviews and resolves or deletes issues with permission
).toBeVisible();
await openBookManager(page, 16);
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Manage Book' }).click();
const requestManagerSheet = page.getByRole('dialog', { name: 'Manage Book' });
await expect(
diff --git a/lumen/tests/browser/books-localization.spec.ts b/lumen/tests/browser/books-localization.spec.ts
index 332d3f3..da2d6a9 100644
--- a/lumen/tests/browser/books-localization.spec.ts
+++ b/lumen/tests/browser/books-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openDiscoveryFilters } from './discoveryFilters';
import { testAppPath } from './testAppPath';
const copy = {
@@ -108,6 +109,7 @@ for (const locale of ['en', 'fr', 'ar'] as const) {
.getByRole('group', { name: text.library })
.getByRole('button', { name: text.all })
).toBeVisible();
+ await openDiscoveryFilters(page);
await expect(
page.getByRole('searchbox', { name: text.titleFilter })
).toBeVisible();
diff --git a/lumen/tests/browser/browse-range-localization.spec.ts b/lumen/tests/browser/browse-range-localization.spec.ts
index cf676a3..217ffc0 100644
--- a/lumen/tests/browser/browse-range-localization.spec.ts
+++ b/lumen/tests/browser/browse-range-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page, type TestInfo } from '@playwright/test';
+import { openDiscoveryFilters } from './discoveryFilters';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) => `${testMount}${path}`;
@@ -114,6 +115,7 @@ test('movie and series range filters follow the account locale', async ({
'يشمل الطلب المسلسل كاملًا.'
)
);
+ await openDiscoveryFilters(page);
await page
.getByText(
wording('More Filters', 'Plus de filtres', 'عوامل تصفية إضافية'),
diff --git a/lumen/tests/browser/calendar.spec.ts b/lumen/tests/browser/calendar.spec.ts
index 9312340..e6280de 100644
--- a/lumen/tests/browser/calendar.spec.ts
+++ b/lumen/tests/browser/calendar.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) => `${testMount}${path}`;
@@ -142,6 +143,7 @@ for (const permissions of [2, 32]) {
});
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Release Calendar' }).click();
await expect(
page.getByRole('heading', { name: 'Release Calendar' })
diff --git a/lumen/tests/browser/card-title-settings-loading-locale.spec.ts b/lumen/tests/browser/card-title-settings-loading-locale.spec.ts
index f11f685..067c3ee 100644
--- a/lumen/tests/browser/card-title-settings-loading-locale.spec.ts
+++ b/lumen/tests/browser/card-title-settings-loading-locale.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openSections } from './discoveryFilters';
import { testAppPath } from './testAppPath';
const locale = (process.env.LUMEN_CARD_SETTINGS_LOADING_LOCALE ?? 'fr') as
@@ -43,6 +44,8 @@ test('card title settings loading state follows the saved locale', async ({
});
await page.goto(testAppPath('/me/account'));
+
+ await openSections(page);
const loading = page.getByRole('status').filter({
hasText: loadingText[locale],
});
diff --git a/lumen/tests/browser/card-title-toggle-locale.spec.ts b/lumen/tests/browser/card-title-toggle-locale.spec.ts
index 0904ffc..357b323 100644
--- a/lumen/tests/browser/card-title-toggle-locale.spec.ts
+++ b/lumen/tests/browser/card-title-toggle-locale.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
const locale = (process.env.LUMEN_CARD_TITLE_LOCALE ?? 'en') as
@@ -38,6 +39,8 @@ test('account title-view switch explains its shared preference in the saved loca
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
const expected = description[locale];
const toggle = page.getByRole('switch').filter({ hasText: expected });
await expect(toggle).toHaveAttribute('aria-checked', 'true');
diff --git a/lumen/tests/browser/client-tokens.spec.ts b/lumen/tests/browser/client-tokens.spec.ts
index 0125899..de20743 100644
--- a/lumen/tests/browser/client-tokens.spec.ts
+++ b/lumen/tests/browser/client-tokens.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openSections } from './discoveryFilters';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -53,6 +54,7 @@ test('client tokens display the secret once and revoke after confirmation', asyn
return route.fulfill({ json: {} });
});
await page.goto(appPath('/me/account'));
+ await openSections(page);
await page.getByRole('link', { name: 'Client Tokens' }).click();
await page.getByLabel('Token Name').fill('Fixture Client');
await page
@@ -243,6 +245,8 @@ for (const locale of ['fr', 'ar'] as const) {
});
await page.goto(appPath('/me/account/client-tokens'));
+
+ await openSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', locale);
if (locale === 'ar')
await expect(page.locator('html')).toHaveAttribute('dir', 'rtl');
diff --git a/lumen/tests/browser/comics-manga.spec.ts b/lumen/tests/browser/comics-manga.spec.ts
index c3d3178..2fad8f0 100644
--- a/lumen/tests/browser/comics-manga.spec.ts
+++ b/lumen/tests/browser/comics-manga.spec.ts
@@ -1,5 +1,10 @@
import { expect, test, type Page } from '@playwright/test';
import { writeFile } from 'node:fs/promises';
+import {
+ closeDiscoveryFilters,
+ openDiscoveryFilters,
+ openMoreActions,
+} from './discoveryFilters';
import { testAppPath as mountedTestAppPath } from './testAppPath';
// 1x1 PNG for every proxied cover
@@ -212,6 +217,7 @@ test('comic detail management sheet is available to request managers', async ({
},
});
await page.goto(mountedTestAppPath('/comic/al-117195'));
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Manage Comic' }).click();
const sheet = page.getByRole('dialog', { name: 'Manage Comic' });
await expect(sheet.getByText('Requests', { exact: true })).toBeVisible();
@@ -428,6 +434,7 @@ test('comic detail links to the selected ComicVine volume when the URL is truste
},
});
await page.goto(mountedTestAppPath('/comic/al-117195'));
+ await openMoreActions(page);
await expect(
page.getByRole('link', { name: 'View on ComicVine' })
).toHaveAttribute(
@@ -767,8 +774,9 @@ for (const locale of ['en', 'fr', 'ar'] as const) {
},
}[locale];
await expect(page.locator('h1')).toHaveText(copy.title);
- await expect(page.getByText(copy.catalogue)).toBeVisible();
await expect(page.getByRole('group', { name: copy.type })).toBeVisible();
+ await openDiscoveryFilters(page);
+ await expect(page.getByText(copy.catalogue)).toBeVisible();
await expect(page.getByText(copy.sort, { exact: true })).toBeVisible();
expect(await page.evaluate(() => document.documentElement.dir)).toBe(
locale === 'ar' ? 'rtl' : 'ltr'
@@ -863,7 +871,15 @@ test('the edition picker defaults to the recommended English edition', async ({
const rows = page
.getByRole('radiogroup', { name: 'Editions' })
.getByRole('radio');
+ // a long list shows the first four editions, the rest behind All 8 editions
+ await expect(rows).toHaveCount(4);
+ const all = page.getByRole('button', { name: 'All 8 editions' });
+ await expect(all).toHaveAttribute('aria-expanded', 'false');
+ await all.click();
await expect(rows).toHaveCount(8);
+ await expect(
+ page.getByRole('button', { name: 'Show fewer' })
+ ).toHaveAttribute('aria-expanded', 'true');
await expect(rows.first()).toHaveAttribute('aria-checked', 'true');
await expect(rows.first()).toContainText('English');
await expect(rows.first()).toContainText('Viz');
@@ -961,6 +977,7 @@ for (const locale of ['en', 'fr', 'ar'] as const) {
}, info) => {
await fixtures(page, { locale });
await page.goto(mountedTestAppPath('/comic/al-105778'));
+ await openMoreActions(page);
await expect(
page.getByRole('button', { name: copy.readerShelf })
).toBeVisible();
@@ -1009,9 +1026,10 @@ test('an edition already in the library shows on the work and in the picker', as
const rows = page
.getByRole('radiogroup', { name: 'Editions' })
.getByRole('radio');
- // the owned edition is the one shown
- await expect(rows.nth(5)).toHaveAttribute('aria-checked', 'true');
- await expect(rows.nth(5)).toContainText('9 of 16 in library');
+ // the owned edition is the one shown, and stays in the folded list
+ await expect(rows).toHaveCount(5);
+ await expect(rows.nth(4)).toHaveAttribute('aria-checked', 'true');
+ await expect(rows.nth(4)).toContainText('9 of 16 in library');
await expect(page.locator('.facts2')).toContainText('9 of 16');
});
@@ -1220,6 +1238,7 @@ test('Not yet hides owned series and keeps the browse filters', async ({
await page.goto(mountedTestAppPath('/comics?type=manga'));
const cards = page.locator('.comic-grid .poster');
await expect(cards).toHaveCount(4);
+ await openDiscoveryFilters(page);
const library = page.getByRole('group', { name: 'Library' });
await expect(library.getByRole('button')).toHaveText([
'All',
@@ -1248,6 +1267,7 @@ test('filters and sort ask for the matching list', async ({ page }) => {
const { browsed } = await fixtures(page);
await page.goto(mountedTestAppPath('/comics'));
await expect(page.locator('.comic-grid .poster')).toHaveCount(3);
+ await openDiscoveryFilters(page);
// a genre narrows to manga
const picker = page.getByRole('button', { name: /^Genres:/ });
const genres = page.getByRole('group', { name: 'Genres' });
@@ -1272,6 +1292,7 @@ test('filters and sort ask for the matching list', async ({ page }) => {
await expect.poll(() => browsed.at(-1)).toContain('status=finished');
await page.getByLabel('Sort').selectOption('newest');
await expect.poll(() => browsed.at(-1)).toContain('sort=newest');
+ await closeDiscoveryFilters(page);
// Western comics: their own sorts and a publisher filter, no genres
await page
.getByRole('group', { name: 'Type' })
@@ -1279,6 +1300,7 @@ test('filters and sort ask for the matching list', async ({ page }) => {
.click();
await expect.poll(() => browsed.at(-1)).toContain('type=comic');
await expect(picker).toHaveCount(0);
+ await openDiscoveryFilters(page);
await page
.getByRole('combobox', { name: 'Publisher', exact: true })
.selectOption('Marvel');
@@ -1290,10 +1312,12 @@ test('filters and sort ask for the matching list', async ({ page }) => {
.click();
await expect.poll(() => browsed.at(-1)).toContain('show=library');
// back to everything
+ await closeDiscoveryFilters(page);
await page
.getByRole('group', { name: 'Type' })
.getByRole('button', { name: 'All' })
.click();
+ await openDiscoveryFilters(page);
await page
.getByRole('group', { name: 'Library' })
.getByRole('button', { name: 'All' })
@@ -1383,10 +1407,9 @@ test('a ComicVine link from Requests opens the work page', async ({
await expect(page.getByText('Manga, édition English')).toBeVisible();
await expect(page.locator('.h2', { hasText: 'Volumes' })).toBeVisible();
await expect(page.locator('.trow').first()).toContainText('1 févr.');
- await expect(page.getByText('Cover & story', { exact: true })).toBeVisible();
- await expect(
- page.getByText('Literal < and < symbols.', { exact: true })
- ).toBeVisible();
+ const about = page.locator('.clamp-text .ov');
+ await expect(about).toContainText('Cover & story');
+ await expect(about).toContainText('Literal < and < symbols.');
await page.screenshot({
path: info.outputPath('comic-description.png'),
animations: 'disabled',
@@ -1421,6 +1444,7 @@ for (const width of [360, 768, 1280]) {
expect(box!.x + box!.width).toBeLessThanOrEqual(width);
}
await page.goto(mountedTestAppPath('/comic/al-105778'));
+ await page.getByRole('button', { name: 'All 8 editions' }).click();
await expect(
page.getByRole('radiogroup', { name: 'Editions' }).getByRole('radio')
).toHaveCount(8);
@@ -1682,6 +1706,8 @@ for (const locale of [
await page.goto(mountedTestAppPath('/comics?catalog=1'));
await expect(page.locator('html')).toHaveAttribute('lang', locale.tag);
+ // phones keep the catalogue filters in the Filters sheet
+ await openDiscoveryFilters(page);
await expect(page.getByLabel(locale.publisher)).toBeVisible();
await expect(page.getByLabel(locale.startYear)).toBeVisible();
await expect(page.getByLabel(locale.minIssues)).toBeVisible();
diff --git a/lumen/tests/browser/curated-collections.spec.ts b/lumen/tests/browser/curated-collections.spec.ts
index 58214d6..0d13254 100644
--- a/lumen/tests/browser/curated-collections.spec.ts
+++ b/lumen/tests/browser/curated-collections.spec.ts
@@ -147,7 +147,8 @@ test('series and album details reach their curated collections', async ({
await expect(
page.getByRole('heading', { name: 'Fixture Series' })
).toBeVisible();
- expect(seriesReads).toEqual([]);
+ // asked once as the page opens, so a series in no collection shows no empty box
+ await expect.poll(() => seriesReads.length).toBe(1);
await page.getByText('Series Collections', { exact: true }).click();
await page.getByRole('link', { name: 'Fixture Series Collection' }).click();
await expect(
diff --git a/lumen/tests/browser/detail-options-localization.spec.ts b/lumen/tests/browser/detail-options-localization.spec.ts
index 14dbe17..2d58739 100644
--- a/lumen/tests/browser/detail-options-localization.spec.ts
+++ b/lumen/tests/browser/detail-options-localization.spec.ts
@@ -270,7 +270,11 @@ for (const locale of locales) {
await expect(page.getByLabel(locale.server)).toBeVisible();
await expect(page.getByLabel(locale.quality)).toBeVisible();
await expect(page.getByLabel(locale.folder)).toBeVisible();
- await page.getByText(locale.cast, { exact: true }).click();
+ // Starring is a part of the Cast & Crew box
+ await page.locator('details#cast summary').click();
+ await expect(
+ page.getByRole('heading', { name: locale.cast, exact: true })
+ ).toBeVisible();
const expandCredits = page.getByRole('button', {
name: locale.showAll,
exact: true,
@@ -282,7 +286,7 @@ for (const locale of locales) {
await expect(
page.getByText(locale.subjectTags, { exact: true })
).toBeVisible();
- await page.getByText(locale.subjectTags, { exact: true }).click();
+ // Subject Tags is a part of the Details box opened above
const dramaTag = page.getByRole('link', { name: 'Drama', exact: true });
await expect(dramaTag).toBeVisible();
const tagsToggle = page.getByRole('button', {
diff --git a/lumen/tests/browser/detail-overview-fallback.spec.ts b/lumen/tests/browser/detail-overview-fallback.spec.ts
index 96ba8a6..645e231 100644
--- a/lumen/tests/browser/detail-overview-fallback.spec.ts
+++ b/lumen/tests/browser/detail-overview-fallback.spec.ts
@@ -83,9 +83,8 @@ for (const locale of locales) {
await expect(
page.getByRole('heading', { name: 'Fixture Series' })
).toBeVisible();
- const overview = page.locator('details.adv').filter({
- has: page.locator('summary', { hasText: /Overview|Synopsis|نظرة عامة/ }),
- });
+ // the fallback shows under the title, as on the movie page
+ const overview = page.locator('.dintro');
if (!captureOnly) await expect(overview).toBeVisible();
const tvWidthBeforeExpand = await page.evaluate(
() => document.documentElement.scrollWidth
@@ -101,7 +100,6 @@ for (const locale of locales) {
animations: 'disabled',
});
if (!captureOnly) {
- await overview.locator('summary').click();
await expect(
overview.getByText(locale.fallback, { exact: true })
).toBeVisible();
diff --git a/lumen/tests/browser/detail-tv-playback.spec.ts b/lumen/tests/browser/detail-tv-playback.spec.ts
index 893cbe7..0ffdc56 100644
--- a/lumen/tests/browser/detail-tv-playback.spec.ts
+++ b/lumen/tests/browser/detail-tv-playback.spec.ts
@@ -143,7 +143,7 @@ test('TV detail plays only selected episodes from seasons the viewer may access'
});
await page.goto(`${mount}/tv/42`);
- await page.getByTestId('tv-media-server').locator('summary').first().click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
await page.getByRole('button', { name: 'Playback Options' }).click();
const dialog = page.getByRole('dialog', { name: 'Play Series' });
await expect(dialog).toBeVisible();
diff --git a/lumen/tests/browser/discover-feature-meta.spec.ts b/lumen/tests/browser/discover-feature-meta.spec.ts
index 1c14975..1786514 100755
--- a/lumen/tests/browser/discover-feature-meta.spec.ts
+++ b/lumen/tests/browser/discover-feature-meta.spec.ts
@@ -1,9 +1,11 @@
import { expect, test, type Page } from '@playwright/test';
+import { openDiscoveryFilters } from './discoveryFilters';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen';
async function openMoreFilters(page: Page) {
+ await openDiscoveryFilters(page);
const details = page.locator('details.more-filters');
if (!(await details.evaluate((el) => (el as HTMLDetailsElement).open)))
await details.locator('summary').click();
diff --git a/lumen/tests/browser/discover-localization.spec.ts b/lumen/tests/browser/discover-localization.spec.ts
index 975cf8d..4b0d08e 100644
--- a/lumen/tests/browser/discover-localization.spec.ts
+++ b/lumen/tests/browser/discover-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openSections } from './discoveryFilters';
import { testAppPath } from './testAppPath';
const locale = ['en', 'fr', 'ar'].includes(
@@ -176,22 +177,11 @@ test('Discover shell, shelves, and recovery follow the account locale', async ({
page.getByRole('heading', { name: expected.newOn })
).toBeVisible();
await expect(page.getByText(expected.added)).toBeVisible();
- const titleView = page.getByRole('button', {
- name: expected.titleViewAction,
- });
- await expect(titleView).toBeVisible();
- if (!process.env.LUMEN_DISCOVER_BASELINE) {
- await titleView.click();
- await expect(
- page.getByRole('button', { name: expected.titleViewOnHoverAction })
- ).toHaveAttribute('aria-pressed', 'true');
- await page
- .getByRole('button', { name: expected.titleViewOnHoverAction })
- .click();
+ // Title View is a setting under You > Appearance, not a chip on the shelves
+ if (!process.env.LUMEN_DISCOVER_BASELINE)
await expect(
page.getByRole('button', { name: expected.titleViewAction })
- ).toHaveAttribute('aria-pressed', 'false');
- }
+ ).toHaveCount(0);
await expect(
page.getByRole('link', { name: expected.movies, exact: true }).last()
).toBeVisible();
@@ -285,6 +275,7 @@ test('administrator Discover row controls follow the account locale', async ({
: '/me/lumen'
)
);
+ await openSections(page);
for (const label of expected)
await expect(page.getByText(label).first()).toBeVisible();
if (process.env.LUMEN_DISCOVER_CAPTURE)
diff --git a/lumen/tests/browser/discover-menu-destinations.spec.ts b/lumen/tests/browser/discover-menu-destinations.spec.ts
index b8de383..8bffb10 100644
--- a/lumen/tests/browser/discover-menu-destinations.spec.ts
+++ b/lumen/tests/browser/discover-menu-destinations.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -42,6 +43,7 @@ async function prepare(
return route.fulfill({ json: { results: [], page: 1, totalPages: 1 } });
});
await page.goto(`${mount}/me`);
+ await openPhoneSections(page);
if ((page.viewportSize()?.width ?? 0) < 1040)
await page.getByRole('button', { name: 'More navigation' }).click();
return page.locator('.side');
diff --git a/lumen/tests/browser/discoveryFilters.ts b/lumen/tests/browser/discoveryFilters.ts
new file mode 100644
index 0000000..9a934d5
--- /dev/null
+++ b/lumen/tests/browser/discoveryFilters.ts
@@ -0,0 +1,73 @@
+import { expect, type Page } from '@playwright/test';
+
+// Phones keep the discovery filters in a bottom sheet behind one Filters button; wider screens
+// show them inline, so these do nothing there.
+const isPhone = (page: Page) => (page.viewportSize()?.width ?? 1440) < 700;
+
+export async function openDiscoveryFilters(page: Page) {
+ if (!isPhone(page)) return;
+ const sheet = page.locator('.browse-filter-sheet');
+ if (await sheet.isVisible()) return;
+ // pages without the Filters button (comics, for one) keep More Filters on the page
+ const button = page.locator('.browse-filters-btn');
+ await page
+ .locator('.browse-filters-btn, details.more-filters')
+ .first()
+ .waitFor();
+ if (!(await button.isVisible())) return;
+ await button.click();
+ await expect(sheet).toBeVisible();
+}
+
+export async function closeDiscoveryFilters(page: Page) {
+ if (!isPhone(page)) return;
+ const sheet = page.locator('.browse-filter-sheet');
+ if (!(await sheet.isVisible())) return;
+ await sheet.locator('.pk-foot .btn-primary').click();
+ await expect(sheet).toHaveCount(0);
+}
+
+// Phones fold a detail page's occasional actions into the More sheet
+export async function openMoreActions(page: Page) {
+ if (!isPhone(page)) return;
+ // by its list, so it works in every language
+ const sheet = page
+ .getByRole('dialog')
+ .filter({ has: page.locator('.more-actions-list') });
+ if (await sheet.isVisible()) return;
+ // a lone action shows in place, and some pages (magazines) have no More: nothing to open
+ await page
+ .locator('.more-actions-btn, .more-actions-single')
+ .first()
+ .waitFor({ state: 'attached', timeout: 5000 })
+ .catch(() => {});
+ const button = page.locator('.more-actions-btn');
+ if (!(await button.count())) return;
+ await button.click();
+ await expect(sheet).toBeVisible();
+}
+
+// An album keeps its own More menu; on phones Library Health sits in it
+export async function openAlbumMore(page: Page) {
+ const menu = page.locator('details.music-more');
+ if (await menu.evaluate((el) => (el as HTMLDetailsElement).open)) return;
+ await menu.locator('summary').click();
+}
+
+// Phones fold the sections of long settings pages (Account, Lumen settings): open them all
+export async function openSections(page: Page) {
+ if (!isPhone(page)) return;
+ // only the two folded pages; their sub-pages keep plain sections
+ if (!/\/me\/(account|lumen)$/.test(new URL(page.url()).pathname)) return;
+ await page
+ .locator('details.phone-section')
+ .first()
+ .waitFor({ timeout: 5000 })
+ .catch(() => {});
+ // opening one changes the list of closed ones, so open the first until none is left
+ const closed = page.locator('details.phone-section:not([open]) > summary');
+ for (let i = 0; i < 40 && (await closed.count()); i++)
+ await closed.first().click();
+ // opening scrolls the page; start from the top again like a fresh load
+ await page.evaluate(() => window.scrollTo(0, 0));
+}
diff --git a/lumen/tests/browser/download-inbox.spec.ts b/lumen/tests/browser/download-inbox.spec.ts
index 5ec52c5..9fc93bf 100644
--- a/lumen/tests/browser/download-inbox.spec.ts
+++ b/lumen/tests/browser/download-inbox.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -54,6 +55,7 @@ for (const permissions of [32, 8796093022208]) {
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const entry = page.getByRole('link', { name: 'Open Download Inbox' });
if (permissions === 32) {
await expect(
diff --git a/lumen/tests/browser/following.spec.ts b/lumen/tests/browser/following.spec.ts
index 27595c6..16587a3 100644
--- a/lumen/tests/browser/following.spec.ts
+++ b/lumen/tests/browser/following.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -123,6 +124,7 @@ test('household users can open Following and manage their own updates', async ({
});
await page.goto(mountedTestAppPath('./me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Following', exact: true }).click();
await expect(
page.getByRole('heading', { name: 'Following', exact: true })
diff --git a/lumen/tests/browser/followups.spec.ts b/lumen/tests/browser/followups.spec.ts
index 67a93d0..19128b3 100644
--- a/lumen/tests/browser/followups.spec.ts
+++ b/lumen/tests/browser/followups.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openSections } from './discoveryFilters';
import { testAppPath } from './testAppPath';
// Follow-ups to the audit pass: sideways phones, search tap target, settings checkbox, and
@@ -185,6 +186,7 @@ test('the Lumen settings checkbox has a 44px touch target and stays keyboard fri
}) => {
await fixtures(page);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
const lock = page.locator('.cfg-lock').first();
await expect(lock).toBeVisible();
const input = lock.locator('input');
diff --git a/lumen/tests/browser/game-finder-navigation.spec.ts b/lumen/tests/browser/game-finder-navigation.spec.ts
index 27a1d91..f7f7e0a 100644
--- a/lumen/tests/browser/game-finder-navigation.spec.ts
+++ b/lumen/tests/browser/game-finder-navigation.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -86,6 +87,7 @@ for (const locale of [
const baseline = process.env.LUMEN_CAPTURE_MODE === 'baseline';
await fixture(page, 2, { game: true }, locale.tag);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', locale.tag);
const menu = await openNavigation(page);
const games = menu.getByRole('link', {
@@ -139,6 +141,7 @@ for (const locale of [
).toBeVisible();
if (!baseline) {
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', locale.tag);
const reopenedMenu = await openNavigation(page);
await reopenedMenu
@@ -167,6 +170,7 @@ for (const scenario of [
test(`Game Finder stays hidden ${scenario.name}`, async ({ page }) => {
await fixture(page, scenario.permissions, scenario.categories);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(page.locator('html')).toHaveAttribute('lang', 'en');
const menu = await openNavigation(page);
await expect(
@@ -186,6 +190,7 @@ test('My Games stays hidden when game categories are disabled', async ({
}) => {
await fixture(page, 32, {});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const menu = await openNavigation(page);
await expect(
menu.getByRole('link', { name: 'Games', exact: true })
@@ -202,6 +207,7 @@ test('Game Finder stays reachable in the compact phone navigation', async ({
await page.setViewportSize({ width: 320, height: 568 });
await fixture(page, 2, { game: true });
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('button', { name: 'More navigation' }).click();
const menu = page.locator('.side');
const finder = menu.getByRole('link', {
diff --git a/lumen/tests/browser/game-library-navigation.spec.ts b/lumen/tests/browser/game-library-navigation.spec.ts
index 8a231d6..c0b4937 100644
--- a/lumen/tests/browser/game-library-navigation.spec.ts
+++ b/lumen/tests/browser/game-library-navigation.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -58,6 +59,7 @@ test('globally disabled game categories omit My Games from You', async ({
}, info) => {
const gameCatalogRequests = await fixture(page, false);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const link = page.getByRole('link', { name: 'Open My Games', exact: true });
await expect(link).toHaveCount(0);
if (info.project.name === 'iphone')
@@ -75,6 +77,7 @@ test('user-disabled game categories omit My Games from You', async ({
}) => {
const gameCatalogRequests = await fixture(page, true, false);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open My Games', exact: true })
).toHaveCount(0);
@@ -86,6 +89,7 @@ test('enabled game catalogs keep My Games reachable from You', async ({
}) => {
const gameCatalogRequests = await fixture(page, true);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open My Games', exact: true })
).toBeVisible();
diff --git a/lumen/tests/browser/game-library.spec.ts b/lumen/tests/browser/game-library.spec.ts
index df57cc3..993ce1d 100644
--- a/lumen/tests/browser/game-library.spec.ts
+++ b/lumen/tests/browser/game-library.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const appPath = (path: string) =>
`${process.env.LUMEN_TEST_MOUNT ? '/lumen' : ''}${path}`;
@@ -117,6 +118,7 @@ test('My Games keeps private edits separate from household results', async ({
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open My Games' }).click();
await expect(page.getByRole('link', { name: game.title })).toHaveAttribute(
'href',
diff --git a/lumen/tests/browser/genre-picker.spec.ts b/lumen/tests/browser/genre-picker.spec.ts
index 3411b5f..7f43052 100644
--- a/lumen/tests/browser/genre-picker.spec.ts
+++ b/lumen/tests/browser/genre-picker.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openDiscoveryFilters } from './discoveryFilters';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -72,6 +73,7 @@ test('Movies: All genres by default; ticking genres updates the address and the
}) => {
const feed = await fixtures(page);
await page.goto(mountedTestAppPath('/movies'));
+ await openDiscoveryFilters(page);
await expect(
page.getByRole('button', { name: 'Genres: All genres' })
).toBeVisible();
@@ -162,6 +164,7 @@ test('Series: a shared address shows its genres on the button; a click outside c
}) => {
await fixtures(page);
await page.goto(mountedTestAppPath('/series?genre=18,27,14'));
+ await openDiscoveryFilters(page);
const picker = page.getByRole('button', { name: /^Genres:/ });
await expect(picker).toHaveText('Drama + 2');
await picker.click();
@@ -170,7 +173,9 @@ test('Series: a shared address shows its genres on the button; a click outside c
genres.getByRole('button', { name: 'Horror', exact: true })
).toHaveAttribute('aria-pressed', 'true');
if (page.viewportSize()!.width < 700)
- await page.locator('.sheet-scrim').click({ position: { x: 20, y: 20 } });
+ await page
+ .locator('.sheet-wrap:has(.gp-sheet) .sheet-scrim')
+ .click({ position: { x: 20, y: 20 } });
else await page.getByRole('heading', { name: 'Series', level: 1 }).click();
await expect(genres).toHaveCount(0);
});
@@ -213,6 +218,7 @@ test('phones: the genres open in a bottom sheet', async ({ page }, info) => {
);
const feed = await fixtures(page);
await page.goto(mountedTestAppPath('/movies'));
+ await openDiscoveryFilters(page);
const picker = page.getByRole('button', { name: /^Genres:/ });
expect((await picker.boundingBox())!.height).toBeGreaterThanOrEqual(43.5);
await picker.click();
diff --git a/lumen/tests/browser/household-profile-localization.spec.ts b/lumen/tests/browser/household-profile-localization.spec.ts
index 9048853..081c8be 100644
--- a/lumen/tests/browser/household-profile-localization.spec.ts
+++ b/lumen/tests/browser/household-profile-localization.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test';
import { mkdirSync } from 'node:fs';
import { join } from 'node:path';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -83,6 +84,7 @@ for (const language of locales) {
});
await page.goto(appPath('/household/me'));
+ await openPhoneSections(page);
await expect(page.getByRole('heading', { name: 'Member' })).toBeVisible();
await expect(
page.getByRole('heading', { name: language.requests })
diff --git a/lumen/tests/browser/household-profile.spec.ts b/lumen/tests/browser/household-profile.spec.ts
index e48f00b..40c80c4 100644
--- a/lumen/tests/browser/household-profile.spec.ts
+++ b/lumen/tests/browser/household-profile.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -291,6 +292,7 @@ test('incomplete household preview responses recover independently', async ({
}
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open My Profile' }).click();
await expect(page).toHaveURL(appPath('/household/me'));
await expect(
@@ -375,6 +377,7 @@ test('a local account can retry a picture upload without losing its current avat
}
});
await page.goto(appPath('/household/me'));
+ await openPhoneSections(page);
const button = page.getByRole('button', { name: 'Change Profile Picture' });
const picture = page.locator('.ph .avatar[aria-hidden="true"] img');
async function selectPicture() {
diff --git a/lumen/tests/browser/indexer-search.spec.ts b/lumen/tests/browser/indexer-search.spec.ts
index 5f3a57d..2c4117a 100644
--- a/lumen/tests/browser/indexer-search.spec.ts
+++ b/lumen/tests/browser/indexer-search.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -58,6 +59,8 @@ test('Indexer Search is reachable from the permission-aware mobile You menu', as
.locator(`a[href="${appPath('/me')}"]`)
.click();
}
+ // after the tab: opening the folded groups scrolls, which tucks the tab bar away
+ await openPhoneSections(page);
const link = desktop
? page.getByRole('link', {
name: indexerMenuByLocale[savedLocale],
@@ -103,6 +106,7 @@ test('Indexer Search is absent from the You menu without permission', async ({
);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open Indexer Search', exact: true })
).toHaveCount(0);
diff --git a/lumen/tests/browser/issues.spec.ts b/lumen/tests/browser/issues.spec.ts
index a6ea5bb..f651cf5 100644
--- a/lumen/tests/browser/issues.spec.ts
+++ b/lumen/tests/browser/issues.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openMoreActions } from './discoveryFilters';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) => `${testMount}${path}`;
@@ -692,6 +693,7 @@ test('reporting uses the internal media row and opens the confirmed report', asy
return route.fulfill({ json: { results: [] } });
});
await page.goto(testAppPath('/movie/20'));
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Report an Issue' }).click();
const dialog = page.getByRole('dialog', { name: 'Report an Issue' });
await expect(
@@ -766,6 +768,7 @@ test('issue managers can report for a selected user', async ({
return route.fulfill({ json: { results: [] } });
});
await page.goto(testAppPath('/movie/20'));
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Report an Issue' }).click();
const dialog = page.getByRole('dialog', { name: 'Report an Issue' });
await dialog.getByRole('searchbox').fill('demo');
diff --git a/lumen/tests/browser/jellyfin.spec.ts b/lumen/tests/browser/jellyfin.spec.ts
index 5da09da..8b95297 100644
--- a/lumen/tests/browser/jellyfin.spec.ts
+++ b/lumen/tests/browser/jellyfin.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
// Jellyfin/Emby households: sign-in, Quick Connect and the media-server wording.
@@ -140,6 +141,7 @@ test('Jellyfin password sign-in and Jellyfin wording', async ({ page }) => {
).toBeVisible();
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(page.getByText('Media server: Jellyfin')).toBeVisible();
await expect(page.getByText('New on Jellyfin')).toBeVisible();
expect(errors).toEqual([]);
diff --git a/lumen/tests/browser/linked-account-localization.spec.ts b/lumen/tests/browser/linked-account-localization.spec.ts
index 496cc59..bd886e0 100644
--- a/lumen/tests/browser/linked-account-localization.spec.ts
+++ b/lumen/tests/browser/linked-account-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page, type TestInfo } from '@playwright/test';
+import { openSections } from './discoveryFilters';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -61,6 +62,8 @@ test('Linked Accounts exposes translated sign-in and recovery controls', async (
});
await page.goto(appPath('/me/account/linked-accounts'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', {
name: translated('Linked Accounts', 'Comptes liés', 'الحسابات المرتبطة'),
diff --git a/lumen/tests/browser/linked-accounts.spec.ts b/lumen/tests/browser/linked-accounts.spec.ts
index 7c6c51c..e93e714 100644
--- a/lumen/tests/browser/linked-accounts.spec.ts
+++ b/lumen/tests/browser/linked-accounts.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openSections } from './discoveryFilters';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -44,6 +45,8 @@ test('failed unlink stays in the confirmation sheet for retry', async ({
});
await page.goto(mountedTestAppPath('./me/account/linked-accounts'));
+
+ await openSections(page);
await page.getByRole('button', { name: 'Unlink Fixture Identity' }).click();
const confirmation = page.getByRole('alertdialog');
await confirmation.getByRole('button', { name: 'Unlink Account' }).click();
@@ -103,6 +106,8 @@ test('Plex links the signed-in user without calling Plex sign-in', async ({
});
await page.goto(mountedTestAppPath('./me/account/linked-accounts'));
+
+ await openSections(page);
await page.bringToFront();
const popupOpened = page.waitForEvent('popup');
await page.getByRole('button', { name: 'Authorize Plex' }).click();
@@ -155,6 +160,7 @@ test('Quick Connect links the signed-in account without calling login', async ({
return route.fulfill({ json: {} });
});
await page.goto(mountedTestAppPath('./me/account/linked-accounts'));
+ await openSections(page);
await page.getByRole('button', { name: 'Start Quick Connect' }).click();
await expect(page.getByText('123456')).toBeVisible();
await expect(page.getByText('Account linked.')).toBeVisible();
@@ -236,6 +242,7 @@ test('OIDC linking validates the round trip and consumes the callback once', asy
return route.fulfill({ json: {} });
});
await page.goto(mountedTestAppPath('./me/account/linked-accounts'));
+ await openSections(page);
await page
.getByRole('button', { name: 'Link Fixture Identity', exact: true })
.click();
@@ -288,6 +295,8 @@ test('tracking accounts read back write preferences and confirm disconnect', asy
});
await page.goto(mountedTestAppPath('./me/account/linked-accounts'));
+
+ await openSections(page);
const writes = page.getByRole('checkbox', { name: 'Allow writes to Trakt' });
await writes.check({ trial: true });
await writes.click();
@@ -359,6 +368,7 @@ test('AniList connects through a code submitted in the request body', async ({
return route.fulfill({ json: {} });
});
await page.goto(mountedTestAppPath('./me/account/linked-accounts'));
+ await openSections(page);
const connect = page.getByRole('button', {
name: 'Connect AniList',
exact: true,
@@ -443,6 +453,7 @@ test('Simkl stops polling on cancel and links after provider approval', async ({
return route.fulfill({ json: {} });
});
await page.goto(mountedTestAppPath('./me/account/linked-accounts'));
+ await openSections(page);
const connect = page.getByRole('button', {
name: 'Connect Simkl',
exact: true,
diff --git a/lumen/tests/browser/lumen-preferences.spec.ts b/lumen/tests/browser/lumen-preferences.spec.ts
index 23945dc..50f6be3 100644
--- a/lumen/tests/browser/lumen-preferences.spec.ts
+++ b/lumen/tests/browser/lumen-preferences.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -66,6 +67,7 @@ test('account preferences are read by a separate browser profile', async ({
}) => {
const { profile, writes } = await fixture(page);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const narrator = page.getByRole('switch', {
name: /Choose audiobook narrators/,
});
@@ -88,9 +90,11 @@ test('account preferences are read by a separate browser profile', async ({
);
});
await secondPage.goto(appPath('/me'));
+ await openPhoneSections(secondPage);
await expect(
secondPage.getByRole('switch', { name: /Choose audiobook narrators/ })
).toHaveAttribute('aria-checked', 'true');
+ await openPhoneSections(page);
await expect(
secondPage.getByRole('group', { name: 'Theme' }).getByRole('button', {
name: 'Light',
@@ -118,7 +122,9 @@ test('server preferences override browser copies, retain admin locks, and surviv
);
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(page.getByRole('heading', { name: 'You' })).toBeVisible();
+ await openPhoneSections(page);
const theme = page.getByRole('group', { name: 'Theme' });
await expect(theme.getByRole('button', { name: 'Light' })).toHaveAttribute(
'aria-pressed',
@@ -149,6 +155,7 @@ test('server preferences override browser copies, retain admin locks, and surviv
});
await page.reload();
+ await openPhoneSections(page);
await expect(
page.getByRole('switch', { name: /Choose audiobook narrators/ })
).toHaveAttribute('aria-checked', 'true');
@@ -178,6 +185,7 @@ test('failed preference writes remain visible and can be retried', async ({
return route.fulfill({ json: profile });
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const narrator = page.getByRole('switch', {
name: /Choose audiobook narrators/,
});
@@ -201,6 +209,7 @@ test('reset clears the account copy and its legacy browser copy', async ({
}) => {
const { profile, writes } = await fixture(page);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('button', { name: 'Reset to defaults' }).click();
await expect(
page.getByRole('heading', { name: 'Reset to defaults?' })
@@ -212,6 +221,7 @@ test('reset clears the account copy and its legacy browser copy', async ({
.poll(() => page.evaluate(() => localStorage.getItem('lumen-prefs:4')))
.toBeNull();
await page.reload();
+ await openPhoneSections(page);
await expect(
page.getByRole('button', { name: 'Dark', exact: true })
).toHaveAttribute('aria-pressed', 'true');
diff --git a/lumen/tests/browser/media-server-saved-item.spec.ts b/lumen/tests/browser/media-server-saved-item.spec.ts
index 5ba30ea..a6fa815 100644
--- a/lumen/tests/browser/media-server-saved-item.spec.ts
+++ b/lumen/tests/browser/media-server-saved-item.spec.ts
@@ -126,7 +126,7 @@ async function fixture(
}
async function openMediaServerActions(page: Page) {
- await page.getByTestId('tv-media-server').locator('summary').first().click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
}
for (const [serverType, name] of [
diff --git a/lumen/tests/browser/member-pass.spec.ts b/lumen/tests/browser/member-pass.spec.ts
new file mode 100644
index 0000000..0187987
--- /dev/null
+++ b/lumen/tests/browser/member-pass.spec.ts
@@ -0,0 +1,125 @@
+import { expect, test, type Page } from '@playwright/test';
+import { testAppPath } from './testAppPath';
+
+// A household member: may request movies and series (auto-approved), view requests and
+// auto-request, nothing more. Pages must work for them and keep admin tools out of sight.
+const MEMBER =
+ 262144 | // REQUEST_MOVIE
+ 524288 | // REQUEST_TV
+ 16384 | // REQUEST_VIEW
+ 256 | // AUTO_APPROVE_MOVIE
+ 512 | // AUTO_APPROVE_TV
+ 8388608; // AUTO_REQUEST
+
+const paged = (results: unknown[]) => ({
+ page: 1,
+ totalPages: 1,
+ totalResults: results.length,
+ results,
+});
+const movie = {
+ id: 55,
+ title: 'Member Movie',
+ overview: 'A film for the household.',
+ releaseDate: '2024-03-01',
+ runtime: 100,
+ genres: [{ id: 18, name: 'Drama' }],
+ credits: { cast: [], crew: [] },
+ voteAverage: 7.1,
+ voteCount: 20,
+};
+const show = {
+ id: 84773,
+ name: 'Member Series',
+ overview: 'A series for the household.',
+ genres: [],
+ numberOfSeasons: 1,
+ firstAirDate: '2022-09-01',
+ seasons: [
+ {
+ seasonNumber: 1,
+ episodeCount: 8,
+ name: 'Season 1',
+ airDate: '2022-09-01',
+ },
+ ],
+ credits: { cast: [], crew: [] },
+};
+
+async function member(page: Page) {
+ await page.route('https://**/*', (route) => route.abort());
+ await page.route('**/lumen-config.json', (route) =>
+ route.fulfill({ json: {} })
+ );
+ await page.route('**/api/v1/**', (route) => {
+ const path = new URL(route.request().url()).pathname
+ .replace(/^\/lumen(?=\/)/, '')
+ .slice(7);
+ if (path === '/lumen/configuration') return route.fulfill({ json: {} });
+ if (path === '/auth/me')
+ return route.fulfill({
+ json: { id: 7, displayName: 'Household', permissions: MEMBER },
+ });
+ if (path === '/settings/public')
+ return route.fulfill({
+ json: {
+ mediaServerType: 1,
+ enabledMediaCategories: { movie: true, tv: true },
+ },
+ });
+ if (path === '/user/7/settings/main') return route.fulfill({ json: {} });
+ if (path === '/movie/55') return route.fulfill({ json: movie });
+ if (path === '/tv/84773') return route.fulfill({ json: show });
+ if (path.startsWith('/genres/') || path.startsWith('/service/'))
+ return route.fulfill({ json: [] });
+ if (
+ path.startsWith('/discover/genreslider') ||
+ path === '/settings/discover'
+ )
+ return route.fulfill({ json: [] });
+ return route.fulfill({ json: paged([]) });
+ });
+}
+
+// admin and manager tools a household member never gets
+const ADMIN_ONLY = [
+ 'Search Prowlarr',
+ 'Add to Blocklist',
+ 'Remove from Blocklist',
+ 'Lumen Settings',
+ 'SeerrNG Administration',
+ 'User List',
+ 'Indexer Search',
+ 'Download Inbox',
+];
+
+for (const [name, path] of [
+ ['Discover', '/'],
+ ['Movies', '/movies'],
+ ['Series', '/series'],
+ ['a movie', '/movie/55'],
+ ['a series', '/tv/84773'],
+ ['Requests', '/requests'],
+ ['You', '/me'],
+] as const) {
+ test(`a household member gets a working ${name} page without admin tools`, async ({
+ page,
+ }) => {
+ await member(page);
+ await page.goto(testAppPath(path));
+ await expect(page.locator('h1').first()).toBeVisible();
+ await page.waitForTimeout(500);
+ await expect(
+ page.getByText('Something went wrong on this page')
+ ).toHaveCount(0);
+ // the More sheet may hold actions too: check it as well
+ const more = page.locator('.more-actions-btn');
+ if (await more.count()) await more.click();
+ for (const label of ADMIN_ONLY)
+ await expect(
+ page
+ .getByRole('link', { name: label, exact: true })
+ .or(page.getByRole('button', { name: label, exact: true }))
+ ).toHaveCount(0);
+ });
+}
diff --git a/lumen/tests/browser/mobile-navigation.spec.ts b/lumen/tests/browser/mobile-navigation.spec.ts
index 651a165..0f456c6 100644
--- a/lumen/tests/browser/mobile-navigation.spec.ts
+++ b/lumen/tests/browser/mobile-navigation.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -71,6 +72,7 @@ test('shell navigation landmarks and request badges follow the account locale',
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await expect(page.locator('.side')).toHaveAttribute(
'aria-label',
labels.primary
@@ -206,6 +208,7 @@ for (const configuration of [
new URL(response.url()).pathname.endsWith('/api/v1/settings/public')
);
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await publicSettingsLoaded;
await page.evaluate(
() =>
@@ -273,6 +276,7 @@ test('open issue count appears only for issue managers', async ({ page }) => {
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
if ((page.viewportSize()?.width ?? 0) < 1040)
await page.getByRole('button', { name: 'More navigation' }).click();
const sidebar = page.locator('.side');
@@ -347,6 +351,7 @@ test('Following unread count is permission scoped and capped visually', async ({
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const following = page.locator(`.side a[href="${appPath('/following')}"]`);
if (permission & 32) {
await countRequested;
@@ -470,6 +475,7 @@ test('admin sidebar exposes version status without querying for regular users',
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
if (permission === 2) {
await statusRequested;
expect(updateCheckRequested).toBe('true');
@@ -560,6 +566,7 @@ test('More navigation filters categories and fits a compact phone', async ({
});
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('button', { name: 'More navigation' }).click();
const menu = page.locator('.side');
await expect(menu).toHaveAttribute('data-mobile-open', 'true');
diff --git a/lumen/tests/browser/music-format-request.spec.ts b/lumen/tests/browser/music-format-request.spec.ts
index a1e8f95..90401b3 100644
--- a/lumen/tests/browser/music-format-request.spec.ts
+++ b/lumen/tests/browser/music-format-request.spec.ts
@@ -223,7 +223,7 @@ test('music album details show the MusicBrainz identity and artist facts', async
artistType: 'Person',
artistArea: 'Québec & Canada',
});
- await page.locator('summary', { hasText: 'Album Details' }).click();
+ await page.locator('summary', { hasText: 'Credits & Details' }).click();
const facts = page.locator('.facts2');
await expect(facts.getByRole('link', { name: albumId })).toHaveAttribute(
'href',
@@ -250,7 +250,7 @@ test('music album details do not create a MusicBrainz link from an invalid ID',
page,
}) => {
await fixture(page, { albumId: 'https://attacker.example/album' });
- await page.locator('summary', { hasText: 'Album Details' }).click();
+ await page.locator('summary', { hasText: 'Credits & Details' }).click();
await expect(
page.locator('.facts2').getByRole('link', { name: /MusicBrainz/i })
).toHaveCount(0);
@@ -312,8 +312,9 @@ test('music album details disclose each unique contributing artist in the saved
{ mbid: 'fixture-featured-artist', name: 'Featured Artist' },
],
});
+ // the artists are a part of the album's Credits & Details box
const disclosure = page.getByTestId('music-artist-list');
- await expect(disclosure).toHaveJSProperty('open', false);
+ await expect(disclosure).toBeHidden();
const capture = process.env.LUMEN_MUSIC_ARTIST_LIST_CAPTURE;
if (capture) {
await page.screenshot({
@@ -321,7 +322,12 @@ test('music album details disclose each unique contributing artist in the saved
fullPage: true,
});
}
- await disclosure.locator('summary').click();
+ await page
+ .locator('details.adv')
+ .filter({ hasText: copy.details })
+ .locator('summary')
+ .first()
+ .click();
await expect(
disclosure.getByRole('link', {
name: `Fixture Artist · ${copy.album}`,
diff --git a/lumen/tests/browser/music-playback.spec.ts b/lumen/tests/browser/music-playback.spec.ts
index 87e674d..68c9b83 100644
--- a/lumen/tests/browser/music-playback.spec.ts
+++ b/lumen/tests/browser/music-playback.spec.ts
@@ -1,4 +1,6 @@
import { expect, test, type Page } from '@playwright/test';
+import { openDiscoveryFilters, openSections } from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
const testAppPath = (path: string) =>
`${process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : ''}${path}`;
@@ -579,75 +581,36 @@ test('a preview asks SeerrNG for the clip and shows the preview bar', async ({
for (const [
locale,
- playerLabel,
- playOpensLabel,
settingsTitle,
- handoff,
previews,
+ plexHelp,
previewLabel,
noPreview,
previewRegionLabel,
previewProgressLabel,
closePreviewLabel,
- doneLabel,
- baselinePlayOpensLabel,
- baselineSettingsTitle,
- baselineHandoff,
- baselinePreviews,
- baselinePreviewLabel,
- baselineNoPreview,
- baselinePreviewRegionLabel,
- baselinePreviewProgressLabel,
- baselineClosePreviewLabel,
- baselineDoneLabel,
] of [
[
'fr',
- 'Application Shelf',
- 'La lecture s’ouvre dans : Aurral',
'Quand vous appuyez sur Lire',
- 'Lumen ouvre dans votre application musicale les morceaux que vous possédez.',
'Extraits de 30 secondes',
+ 'Recherche dans Plex dans le même onglet réutilisé.',
'Écouter un extrait de Missing Song',
'Aucun extrait disponible pour ce morceau',
'Lecteur d’extraits',
'Progression de l’extrait',
'Fermer l’extrait',
- 'Terminé',
- 'Play opens in: Aurral',
- 'When you press Play',
- 'Lumen hands songs you have to your music app.',
- '30-second previews',
- 'Preview Missing Song',
- 'No preview for this song',
- 'Preview player',
- 'Preview progress',
- 'Close preview',
- 'Done',
],
[
'ar',
- 'تطبيق Shelf',
- 'يفتح التشغيل في: Aurral',
'عند الضغط على تشغيل',
- 'يفتح Lumen الأغاني المتوفرة لديك في تطبيق الموسيقى.',
'مقاطع معاينة مدتها 30 ثانية',
+ 'يبحث عنه في Plex باستخدام علامة التبويب نفسها.',
'معاينة Missing Song',
'لا تتوفر معاينة لهذه الأغنية',
'مشغل المعاينة',
'تقدم المعاينة',
'إغلاق المعاينة',
- 'تم',
- 'Play opens in: Aurral',
- 'When you press Play',
- 'Lumen hands songs you have to your music app.',
- '30-second previews',
- 'Preview Missing Song',
- 'No preview for this song',
- 'Preview player',
- 'Preview progress',
- 'Close preview',
- 'Done',
],
] as const) {
test(`music playback controls use the saved ${locale} locale`, async ({
@@ -655,74 +618,54 @@ for (const [
}, testInfo) => {
const baseline = process.env.LUMEN_CAPTURE_BASELINE === '1';
await mockMusic(page, { previews: [], saved: [] }, locale);
- await page.goto(testAppPath('/music'));
- await page
- .getByRole('button', {
- name: baseline ? baselinePlayOpensLabel : playOpensLabel,
- })
- .click();
- const sheet = page.getByRole('dialog', {
- name: baseline ? baselineSettingsTitle : settingsTitle,
+ // "When you press Play" is a setting on the You page now
+ await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ const settings = page.locator('section').filter({
+ has: page.getByRole('heading', {
+ name: baseline ? 'When you press Play' : settingsTitle,
+ }),
});
- await expect(sheet).toBeVisible();
+ await expect(settings).toBeVisible();
await expect(
- sheet.getByText(baseline ? baselineHandoff : handoff)
+ settings.getByText(baseline ? '30-second previews' : previews)
).toBeVisible();
await expect(
- sheet.getByRole('radio', {
- name: baseline ? 'Shelf app' : playerLabel,
- })
- ).toBeDisabled();
- await expect(
- sheet.getByText(baseline ? baselinePreviews : previews)
- ).toBeVisible();
- await expect(
- sheet.getByText(
- locale === 'fr'
- ? 'Recherche dans Plex dans le même onglet réutilisé.'
- : 'يبحث عنه في Plex باستخدام علامة التبويب نفسها.'
- )
- ).toBeVisible();
- await expect(
- sheet.getByText(
- locale === 'fr'
- ? 'L’application mobile Shelf. Disponible lorsque l’application pourra ouvrir des liens.'
- : 'تطبيق Shelf للهاتف. سيتوفر عند دعم فتح الروابط في التطبيق.'
+ settings.getByText(
+ baseline ? 'Searches for it in Plex, in the same reused tab.' : plexHelp
)
).toBeVisible();
await page.screenshot({
path: testInfo.outputPath('music-playback-settings.png'),
fullPage: false,
});
- await sheet
- .getByRole('button', { name: baseline ? baselineDoneLabel : doneLabel })
- .click();
+ await page.goto(testAppPath('/music'));
await page
.locator('li', { hasText: 'Missing Song' })
.getByRole('button', {
- name: baseline ? baselinePreviewLabel : previewLabel,
+ name: baseline ? 'Preview Missing Song' : previewLabel,
})
.click();
const preview = page.getByRole('region', {
- name: baseline ? baselinePreviewRegionLabel : previewRegionLabel,
+ name: baseline ? 'Preview player' : previewRegionLabel,
});
await expect(
- preview.getByText(baseline ? baselineNoPreview : noPreview)
+ preview.getByText(baseline ? 'No preview for this song' : noPreview)
).toBeVisible();
await expect(
preview.getByRole('button', {
- name: baseline ? baselinePreviewLabel : previewLabel,
+ name: baseline ? 'Preview Missing Song' : previewLabel,
})
).toBeDisabled();
await expect(
preview.getByRole('progressbar', {
- name: baseline ? baselinePreviewProgressLabel : previewProgressLabel,
+ name: baseline ? 'Preview progress' : previewProgressLabel,
})
).toBeVisible();
await expect(
preview.getByRole('button', {
- name: baseline ? baselineClosePreviewLabel : closePreviewLabel,
+ name: baseline ? 'Close preview' : closePreviewLabel,
})
).toBeVisible();
await expect(page.locator('html')).toHaveAttribute('lang', locale);
@@ -738,21 +681,30 @@ for (const [
});
}
-test('Play opens in: picking Plex is saved and changes the links', async ({
+test('When you press Play is a You setting: picking Plex is saved and changes the links', async ({
page,
-}) => {
+}, info) => {
const seen: Seen = { previews: [], saved: [] };
await mockMusic(page, seen);
await page.goto(testAppPath('/music'));
- await page.getByRole('button', { name: /Play opens in: Aurral/ }).click();
- const sheet = page.getByRole('dialog', { name: 'When you press Play' });
- await expect(sheet).toBeVisible();
- await expect(sheet.getByRole('radio', { name: /Shelf app/ })).toBeDisabled();
- await sheet.getByRole('radio', { name: /Plex/ }).check();
+ await expect(
+ page.getByRole('heading', { name: 'Trending songs' })
+ ).toBeVisible();
+ // the Music page no longer carries the setting
+ await expect(page.getByText(/Play opens in/)).toHaveCount(0);
+ await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ const apps = page.getByRole('radiogroup', { name: 'Music app' });
+ await expect(apps.getByRole('radio', { name: 'Aurral' })).toBeChecked();
+ // Hearth is an Android app
+ await expect(apps.getByRole('radio', { name: 'Hearth app' })).toHaveCount(
+ info.project.name === 'android' ? 1 : 0
+ );
+ await apps.getByRole('radio', { name: 'Plex' }).check();
await expect
.poll(() => seen.saved.at(-1))
.toMatchObject({ musicPlayer: 'plex' });
- await sheet.getByRole('button', { name: 'Done' }).click();
+ await page.goto(testAppPath('/music'));
const play = page
.locator('li', { hasText: 'Owned Song' })
.getByRole('link', { name: /Play Owned Song in Plex/ });
@@ -762,6 +714,101 @@ test('Play opens in: picking Plex is saved and changes the links', async ({
);
});
+test('Hearth opens through an Android intent and is saved under its old name', async ({
+ page,
+}, info) => {
+ test.skip(info.project.name !== 'android', 'Hearth is an Android app');
+ const seen: Seen = { previews: [], saved: [] };
+ await mockMusic(page, seen);
+ await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await page
+ .getByRole('radiogroup', { name: 'Music app' })
+ .getByRole('radio', { name: 'Hearth app' })
+ .check();
+ // SeerrNG keeps the account value it already knows
+ await expect
+ .poll(() => seen.saved.at(-1))
+ .toMatchObject({ musicPlayer: 'shelf' });
+ await page.goto(testAppPath('/music'));
+ const play = page
+ .locator('li', { hasText: 'Owned Song' })
+ .getByRole('link', { name: /Play Owned Song/ });
+ const href = await play.getAttribute('href');
+ expect(href).toMatch(
+ /^intent:\/\/play\?(album=[^&]+&)?title=Owned%20Song&by=Owned%20Artist.*#Intent;scheme=shelf;package=org\.ncbudd\.abswatch;S\.browser_fallback_url=https%3A%2F%2Fmusic\.example\.com/
+ );
+});
+
+test('the admin music apps decide what people can pick', async ({ page }) => {
+ await mockMusic(page, { previews: [], saved: [] });
+ let config: Record = {
+ musicPlayers: ['plex'],
+ defaults: { musicPlayer: 'plex' },
+ };
+ // registered after mockMusic, so this answer wins
+ await page.route('**/lumen-config.json', (route) =>
+ route.fulfill({ json: config })
+ );
+ await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ const apps = page.getByRole('radiogroup', { name: 'Music app' });
+ await expect(apps.getByRole('radio', { name: 'Plex' })).toBeChecked();
+ await expect(apps.getByRole('radio', { name: 'Aurral' })).toHaveCount(0);
+ await page.goto(testAppPath('/music'));
+ await expect(
+ page
+ .locator('li', { hasText: 'Owned Song' })
+ .getByRole('link', { name: /Play Owned Song in Plex/ })
+ ).toBeVisible();
+
+ // nothing allowed: no app to pick, previews stay
+ config = { musicPlayers: [] };
+ await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
+ await expect(page.getByText('30-second previews')).toBeVisible();
+ await expect(page.getByRole('radiogroup', { name: 'Music app' })).toHaveCount(
+ 0
+ );
+
+ // the Lumen settings page writes the list
+ config = {};
+ await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
+ const section = page
+ .locator('section')
+ .filter({ has: page.getByRole('heading', { name: 'Music apps' }) });
+ await expect(
+ section.getByRole('checkbox', { name: 'Hearth app' })
+ ).toBeChecked();
+ await section.getByRole('checkbox', { name: 'Aurral' }).uncheck();
+ const fallback = section.getByRole('combobox', { name: 'Default app' });
+ await expect(fallback.getByRole('option')).toHaveText(['Plex', 'Hearth app']);
+});
+
+test('Discover filters open the catalogue list and Back to Discover returns to the rows', async ({
+ page,
+}) => {
+ const asked: URLSearchParams[] = [];
+ await mockMusic(page, { previews: [], saved: [] });
+ await page.route('**/api/v1/discover/music?*', (route) => {
+ asked.push(new URL(route.request().url()).searchParams);
+ return route.fulfill({
+ json: { page: 1, totalPages: 1, totalResults: 0, results: [] },
+ });
+ });
+ await page.goto(testAppPath('/music?type=album'));
+ await expect.poll(() => asked.at(-1)?.get('releaseType')).toBe('album');
+ await expect(
+ page.getByRole('heading', { name: 'Trending songs' })
+ ).toHaveCount(0);
+ await page.getByRole('button', { name: 'Back to Discover' }).click();
+ await expect(
+ page.getByRole('heading', { name: 'Trending songs' })
+ ).toBeVisible();
+ expect(new URL(page.url()).searchParams.has('type')).toBe(false);
+});
+
test('an album page counts the songs you have and offers the rest', async ({
page,
}) => {
@@ -949,7 +996,6 @@ for (const [
trendingSongsLabel,
genresLabel,
madeForYouLabel,
- browseCatalogLabel,
] of [
[
'fr',
@@ -960,7 +1006,6 @@ for (const [
'Chansons tendance',
'Vos genres musicaux',
'Pour vous sur Aurral',
- 'Parcourir le catalogue',
],
[
'ar',
@@ -971,7 +1016,6 @@ for (const [
'الأغاني الرائجة',
'أنواعك الموسيقية',
'مخصص لك على Aurral',
- 'تصفح الفهرس',
],
] as const) {
test(`music search and discovery use the saved ${locale} locale`, async ({
@@ -1031,7 +1075,6 @@ for (const [
['Trending songs', trendingSongsLabel, false],
['Your genres', genresLabel, false],
['Made for you in Aurral', madeForYouLabel, false],
- ['Browse catalog', browseCatalogLabel, false],
[
'Recommended for you',
locale === 'fr' ? 'Recommandé pour vous' : 'مقترحة لك',
@@ -2079,6 +2122,7 @@ test('catalog lookups send spaces as %20, never +', async ({ page }) => {
await expect
.poll(() => sent.find((url) => url.includes('/discover/music?')))
.toContain('genre=hip%20hop');
+ await openDiscoveryFilters(page);
// the artist filter's lookup
await page
.getByRole('searchbox', { name: 'Artist', exact: true })
@@ -3780,5 +3824,5 @@ test('with Lidarr instead of Aurral, Music has the same pages and Play goes to P
).toBeVisible();
const play = page.locator('a.btn', { hasText: 'Play' }).first();
await expect(play).toHaveAttribute('href', /^https:\/\/app\.plex\.tv\//);
- await expect(page.getByText('Play opens in: Plex')).toBeVisible();
+ await expect(page.getByText(/Play opens in/)).toHaveCount(0);
});
diff --git a/lumen/tests/browser/my-media.spec.ts b/lumen/tests/browser/my-media.spec.ts
index c47a684..5a0a436 100644
--- a/lumen/tests/browser/my-media.spec.ts
+++ b/lumen/tests/browser/my-media.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const route = (path: string) => `${testMount}/${path.replace(/^\//, '')}`;
@@ -55,6 +56,7 @@ test('My Media retains provider cursors and leaves unmapped items unlinked', asy
});
await page.goto(route('me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open My Media' }).click();
await expect(page.getByRole('heading', { name: 'My Media' })).toBeVisible();
await expect(
diff --git a/lumen/tests/browser/phone-filters.spec.ts b/lumen/tests/browser/phone-filters.spec.ts
new file mode 100644
index 0000000..d71f4fe
--- /dev/null
+++ b/lumen/tests/browser/phone-filters.spec.ts
@@ -0,0 +1,192 @@
+import { expect, test, type Page } from '@playwright/test';
+import { testAppPath } from './testAppPath';
+
+// Phones keep each page's filters to one row, the chips for filters in use, and a sheet. These
+// load every page with filters set and check the always-visible part stays small.
+const paged = (results: unknown[]) => ({
+ page: 1,
+ totalPages: 1,
+ totalResults: results.length,
+ results,
+});
+
+async function fixtures(page: Page) {
+ await page.route('https://**/*', (route) => route.abort());
+ await page.route('**/lumen-config.json', (route) =>
+ route.fulfill({ json: {} })
+ );
+ await page.route('**/api/v1/**', (route) => {
+ const path = new URL(route.request().url()).pathname
+ .replace(/^\/lumen(?=\/)/, '')
+ .slice(7);
+ if (path === '/lumen/configuration') return route.fulfill({ json: {} });
+ if (path === '/auth/me')
+ return route.fulfill({
+ json: { id: 1, displayName: 'fam', permissions: 2 },
+ });
+ if (path === '/settings/public')
+ return route.fulfill({
+ json: {
+ mediaServerType: 1,
+ enabledMediaCategories: {
+ movie: true,
+ tv: true,
+ ebook: true,
+ audiobook: true,
+ music: true,
+ comic: true,
+ },
+ },
+ });
+ if (path === '/user/1/settings/main') return route.fulfill({ json: {} });
+ if (path === '/podcast/status')
+ return route.fulfill({ json: { configured: true } });
+ if (path === '/podcast/genres')
+ return route.fulfill({
+ json: {
+ genres: Array.from({ length: 16 }, (_, i) => ({
+ id: 1300 + i,
+ name: `Category ${i + 1}`,
+ })),
+ },
+ });
+ if (path.endsWith('/watchlist'))
+ return route.fulfill({ json: { ...paged([]), filtersSupported: true } });
+ if (
+ path.startsWith('/discover/genreslider') ||
+ path === '/settings/discover' ||
+ path.endsWith('/discover-book-sections')
+ )
+ return route.fulfill({ json: [] });
+ if (path === '/issue')
+ return route.fulfill({
+ json: { results: [], pageInfo: { pages: 1, results: 0 } },
+ });
+ if (path.startsWith('/genres/') || path.startsWith('/service/'))
+ return route.fulfill({ json: [] });
+ return route.fulfill({ json: paged([]) });
+ });
+}
+
+const PHONE_AREA = '.phone-filter-row, .browse-applied';
+// [name, address with filters set, what the always-visible filter area is on phones, the
+// wider selector that also finds the old (pre-sheet) filter blocks, for before/after numbers]
+const PAGES: [string, string, string, string, number][] = [
+ ['discover', '/', '.navchips', '.navchips', 70],
+ [
+ 'comics',
+ '/comics?type=manga&genre=Action&status=ongoing&sort=trending',
+ PHONE_AREA,
+ '.toolbar:has(> .seg), details.more-filters',
+ 140,
+ ],
+ [
+ 'books',
+ '/books?sort=trending&genre=fantasy',
+ PHONE_AREA,
+ 'form[aria-label="Book Discovery Search"], section > .toolbar:has(> .seg)',
+ 140,
+ ],
+ [
+ 'music',
+ '/music?type=album&genre=rock',
+ PHONE_AREA,
+ '.toolbar:has(> .sel), details.more-filters:not(.music-catalog)',
+ 140,
+ ],
+ ['podcasts', '/podcasts', '.pod-genres', '.pod-genres', 70],
+ [
+ 'requests',
+ '/requests?tab=everyone&mediaType=movie&timeFrame=7d',
+ PHONE_AREA,
+ '.chips.wrap[role="group"], .toolbar[role="group"]',
+ 140,
+ ],
+];
+
+async function filterArea(page: Page, selector: string) {
+ return page.evaluate((selector) => {
+ const boxes = [...document.querySelectorAll(selector)]
+ .filter((el) => !el.closest('.sheet-wrap'))
+ .map((el) => el.getBoundingClientRect())
+ .filter((r) => r.width > 0 && r.height > 0);
+ if (!boxes.length) return 0;
+ return Math.round(
+ Math.max(...boxes.map((r) => r.bottom)) -
+ Math.min(...boxes.map((r) => r.top))
+ );
+ }, selector);
+}
+
+for (const [name, path, phoneArea, wideArea, limit] of PAGES) {
+ test(`phone filters on ${name} stay compact with filters set`, async ({
+ page,
+ }, info) => {
+ test.skip(
+ (page.viewportSize()?.width ?? 1440) >= 700 && !process.env.FILTER_SHOTS,
+ 'phones only'
+ );
+ await fixtures(page);
+ if (process.env.FILTER_SHOTS)
+ await page.setViewportSize({ width: 390, height: 844 });
+ await page.goto(testAppPath(path));
+ await expect(page.locator('h1').first()).toBeVisible();
+ await page.waitForTimeout(600);
+ if (process.env.FILTER_SHOTS) {
+ console.log(
+ `MEASURE ${name} ${await filterArea(page, `${wideArea}, ${PHONE_AREA}`)}`
+ );
+ await page.screenshot({
+ path: `${process.env.FILTER_SHOTS}/${process.env.FILTER_LABEL ?? 'shot'}-${name}.png`,
+ });
+ return;
+ }
+ expect(info.project.name).not.toBe('desktop');
+ await expect(page.locator(phoneArea).first()).toBeVisible();
+ const height = await filterArea(page, phoneArea);
+ expect(height).toBeLessThan(limit);
+ });
+}
+
+test('podcasts: Following narrows the chart to the shows you follow', async ({
+ page,
+}) => {
+ await fixtures(page);
+ // registered after the fixtures, so this answer wins
+ await page.route('**/api/v1/podcast/discover?*', (route) =>
+ route.fulfill({
+ json: {
+ results: [
+ {
+ title: 'Followed Show',
+ author: 'Host A',
+ feedUrl: 'https://feeds.example.com/a',
+ inLibrary: true,
+ libraryItemId: 'li-a',
+ genres: [],
+ },
+ {
+ title: 'Other Show',
+ author: 'Host B',
+ feedUrl: 'https://feeds.example.com/b',
+ inLibrary: false,
+ genres: [],
+ },
+ ],
+ },
+ })
+ );
+ await page.goto(testAppPath('/podcasts'));
+ const chart = page.locator('.pod-chart');
+ await expect(chart.getByText('Followed Show')).toBeVisible();
+ await expect(chart.getByText('Other Show')).toBeVisible();
+ const following = page.getByRole('group', { name: 'Following' });
+ await following
+ .getByRole('button', { name: 'Following', exact: true })
+ .click();
+ await expect(chart.getByText('Other Show')).toHaveCount(0);
+ await expect(chart.getByText('Followed Show')).toBeVisible();
+ await following.getByRole('button', { name: 'Not following' }).click();
+ await expect(chart.getByText('Followed Show')).toHaveCount(0);
+ await expect(chart.getByText('Other Show')).toBeVisible();
+});
diff --git a/lumen/tests/browser/phoneSections.ts b/lumen/tests/browser/phoneSections.ts
new file mode 100644
index 0000000..9800077
--- /dev/null
+++ b/lumen/tests/browser/phoneSections.ts
@@ -0,0 +1,21 @@
+import type { Page } from '@playwright/test';
+
+// Phones fold settings groups (You, Administration) behind their titles. Opens every folded
+// group on the page so a test can check what is inside; wider screens show them open already.
+// Groups can appear as the page's data arrives, so it keeps looking for a moment.
+export async function openPhoneSections(page: Page) {
+ // wider screens never fold these groups, so there is nothing to wait for
+ if ((page.viewportSize()?.width ?? 0) >= 700) return;
+ const closed = page.locator('details.phone-section:not([open]) > summary');
+ await closed
+ .first()
+ .waitFor({ timeout: 3000 })
+ .catch(() => {});
+ const until = Date.now() + 1500;
+ while (Date.now() < until) {
+ if (await closed.count()) await closed.first().click();
+ else await page.waitForTimeout(150);
+ }
+ // opening groups scrolls the page, which tucks the tab bar away; the top shows it again
+ await page.evaluate(() => window.scrollTo(0, 0));
+}
diff --git a/lumen/tests/browser/push-registration.spec.ts b/lumen/tests/browser/push-registration.spec.ts
index 6acae0c..c5c49f8 100644
--- a/lumen/tests/browser/push-registration.spec.ts
+++ b/lumen/tests/browser/push-registration.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openSections } from './discoveryFilters';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -130,6 +131,8 @@ for (const permission of ['granted', 'denied'] as const) {
await installBrowserPush(page, permission);
await page.goto(appPath('/me/account/notifications'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', { name: 'Manage Devices' })
).toBeVisible();
diff --git a/lumen/tests/browser/reader-issue-reports.spec.ts b/lumen/tests/browser/reader-issue-reports.spec.ts
index 519f6cb..5052ca6 100644
--- a/lumen/tests/browser/reader-issue-reports.spec.ts
+++ b/lumen/tests/browser/reader-issue-reports.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openMoreActions } from './discoveryFilters';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -121,6 +122,7 @@ test('reader and music detail reports expose category-specific issue controls',
// the album page keeps Report an Issue in its More menu
if (item.path.startsWith('/music/'))
await page.locator('#view').getByText('More', { exact: true }).click();
+ else await openMoreActions(page);
const report = page.getByRole('button', { name: 'Report an Issue' });
await expect(report, item.path).toBeEnabled();
await report.click();
diff --git a/lumen/tests/browser/recordings.spec.ts b/lumen/tests/browser/recordings.spec.ts
index 4643c97..1013b29 100644
--- a/lumen/tests/browser/recordings.spec.ts
+++ b/lumen/tests/browser/recordings.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -241,6 +242,7 @@ test('recording managers can review all users and approve an airing', async ({
}, info) => {
const { writes, reads } = await fixture(page, 2);
await page.goto(mountedTestAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Recordings' }).click();
await expect(page.getByText('Fixture Airing')).toBeVisible();
await page.getByRole('combobox', { name: 'Scope' }).selectOption('all');
diff --git a/lumen/tests/browser/requests-filter-localization.spec.ts b/lumen/tests/browser/requests-filter-localization.spec.ts
index 9333405..a91fcab 100644
--- a/lumen/tests/browser/requests-filter-localization.spec.ts
+++ b/lumen/tests/browser/requests-filter-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openDiscoveryFilters } from './discoveryFilters';
const locale = ['en', 'fr', 'ar'].includes(
process.env.LUMEN_REQUESTS_LOCALE ?? ''
@@ -222,6 +223,7 @@ test('manager request filters follow the saved locale and keep URL behavior', as
requestFilters.getByRole('button', { name: label, exact: true })
).toBeVisible();
}
+ await openDiscoveryFilters(page);
const filters = page.getByRole('group', { name: text.group });
await expect(filters).toBeVisible();
await expect(
@@ -282,6 +284,7 @@ test('manager request filters follow the saved locale and keep URL behavior', as
page.locator('.empty').filter({ hasText: text.emptyTitle })
).toContainText(text.emptyBody);
+ await openDiscoveryFilters(page);
await media.selectOption('music');
await expect(page).toHaveURL(/mediaType=music/);
await sort.selectOption('newest');
diff --git a/lumen/tests/browser/review-core.spec.ts b/lumen/tests/browser/review-core.spec.ts
index 4f79d51..88a5960 100755
--- a/lumen/tests/browser/review-core.spec.ts
+++ b/lumen/tests/browser/review-core.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page, type Route } from '@playwright/test';
+import { openSections } from './discoveryFilters';
import { testAppPath } from './testAppPath';
// Review fixes: admin settings never save over a config they couldn't read, settings
@@ -104,6 +105,7 @@ test('a config that fails to load keeps Save and Upload off', async ({
});
const puts = await writableStorage(page);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect(page.getByRole('alert')).toContainText(
'Couldn’t load the current settings'
);
@@ -159,6 +161,7 @@ test('changes made while the config is still loading are saved on top of it', as
});
const puts = await writableStorage(page);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
// the settings are read again after sign-in; should that share the failed read, retry
const retry = page.getByRole('button', { name: 'Try again' });
const loading = page.getByText('Loading the current settings…');
@@ -187,6 +190,7 @@ test('settings controls keep focus while they change', async ({ page }) => {
await fixtures(page);
await writableStorage(page);
await page.goto(testAppPath('/me/lumen'));
+ await openSections(page);
await expect(
page.getByRole('button', { name: 'Save for everyone' })
).toBeEnabled();
@@ -199,7 +203,9 @@ test('settings controls keep focus while they change', async ({ page }) => {
await expect(select).toBeFocused();
await select.selectOption('on');
await expect(select).toBeFocused();
- const lock = page.getByRole('checkbox', { name: 'Let people change it' });
+ const lock = page
+ .getByRole('checkbox', { name: 'Let people change it' })
+ .first();
await lock.focus();
await lock.press('Space');
await expect(lock).not.toBeChecked();
diff --git a/lumen/tests/browser/review-pages.spec.ts b/lumen/tests/browser/review-pages.spec.ts
index 26cecb7..2032fe4 100755
--- a/lumen/tests/browser/review-pages.spec.ts
+++ b/lumen/tests/browser/review-pages.spec.ts
@@ -1,4 +1,6 @@
import { expect, test, type Page, type Route } from '@playwright/test';
+import { openMoreActions } from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -229,6 +231,8 @@ test('a confirmation focuses Keep it, not the action that cannot be undone', asy
}) => {
await fixtures(page);
await page.goto(mountedTestAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await page.getByRole('button', { name: 'Reset to defaults' }).click();
const ask = page.getByRole('alertdialog', { name: 'Reset to defaults?' });
await expect(ask.getByRole('button', { name: 'Keep it' })).toBeFocused();
@@ -238,6 +242,8 @@ test('a confirmation focuses Keep it, not the action that cannot be undone', asy
test('the toast live region sits outside #root', async ({ page }) => {
await fixtures(page);
await page.goto(mountedTestAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
const toast = page.locator('.toast[role="status"]');
await expect(toast).toHaveCount(1);
expect(await toast.evaluate((e) => !!e.closest('#root'))).toBe(false);
@@ -867,6 +873,8 @@ test('a card that goes away during its lookup does not navigate', async ({
await card.getByRole('button', { name: 'Request', exact: true }).click();
await expect.poll(() => !!release).toBe(true);
await page.goto(mountedTestAppPath('/me'));
+ await openPhoneSections(page);
+ await openPhoneSections(page);
await expect(page).toHaveURL(/\/me$/);
release!();
await page.waitForTimeout(300);
@@ -1011,6 +1019,7 @@ test('comic reader shelves preview the selected edition and require empty shelf
});
await page.goto(mountedTestAppPath('/comic/al-1'));
await page.getByRole('radio', { name: /French/ }).click();
+ await openMoreActions(page);
await page.getByRole('button', { name: 'Manage Reader Shelf' }).click();
const dialog = page.getByRole('dialog', { name: 'Reader Shelf' });
await expect(dialog.getByLabel('Reader Service')).toHaveValue('bookorbit');
@@ -1049,3 +1058,103 @@ test('comic reader shelves preview the selected edition and require empty shelf
},
]);
});
+
+test('settings pages stack their folded sections closely, under one chip row', async ({
+ page,
+}, info) => {
+ await fixtures(page);
+ if ((page.viewportSize()?.width ?? 1440) >= 700) {
+ await page.goto(mountedTestAppPath('/me/account'));
+ // wider screens keep the toolbar and open sections
+ await expect(page.locator('.account-jump')).toHaveCount(0);
+ await expect(
+ page.locator('.toolbar').getByRole('link', { name: 'Permissions' })
+ ).toBeVisible();
+ return;
+ }
+ const measured: Record = {};
+ for (const path of ['/me/account', '/me/lumen']) {
+ await page.goto(mountedTestAppPath(path));
+ await page.locator('section.phone-fold').nth(2).waitFor();
+ // consecutive collapsed sections sit 10px apart, not a full page gap
+ const gaps = await page.evaluate(() => {
+ const folds = [...document.querySelectorAll('section.phone-fold')];
+ return folds.slice(1).flatMap((fold, i) => {
+ const prev = folds[i];
+ if (prev.nextElementSibling !== fold) return [];
+ return [
+ Math.round(
+ fold.getBoundingClientRect().top -
+ prev.getBoundingClientRect().bottom
+ ),
+ ];
+ });
+ });
+ expect(gaps.length, path).toBeGreaterThan(1);
+ for (const gap of gaps) expect(gap, path).toBeLessThanOrEqual(12);
+ measured[path] = gaps;
+ }
+ // Account: one sideways chip row, Import lists first, nothing twice
+ await page.goto(mountedTestAppPath('/me/account'));
+ const row = page.locator('nav.account-jump');
+ await expect(row).toHaveCount(1);
+ const labels = await row.locator('.chip').allTextContents();
+ expect(labels[0]).toBe('Import lists');
+ expect(new Set(labels).size).toBe(labels.length);
+ for (const label of [
+ 'Password',
+ 'Permissions',
+ 'Linked Accounts',
+ 'Back to You',
+ ])
+ expect(labels).toContain(label);
+ expect((await row.boundingBox())!.height).toBeLessThanOrEqual(50);
+ await expect(page.locator('.view > .toolbar')).toHaveCount(0);
+ // a chip opens the folded section it points to
+ await row.getByText('Password', { exact: true }).click();
+ await expect(
+ page.locator('#password > details.phone-section')
+ ).toHaveAttribute('open', '');
+ info.annotations.push({
+ type: 'gaps',
+ description: JSON.stringify(measured),
+ });
+});
+
+test('phones fold the occasional detail actions into More, and disclosures sit close together', async ({
+ page,
+}, info) => {
+ await fixtures(page, {
+ handle: (path) => (path === '/tv/84773' ? { json: show } : undefined),
+ });
+ await page.goto(mountedTestAppPath('/tv/84773'));
+ const report = page.getByRole('button', { name: 'Report an Issue' });
+ if ((page.viewportSize()?.width ?? 1440) >= 700) {
+ // wider screens keep them inline
+ await expect(report).toBeVisible();
+ await expect(page.locator('.more-actions-btn')).toHaveCount(0);
+ return;
+ }
+ await expect(report).toHaveCount(0);
+ await page.getByRole('button', { name: 'More actions' }).click();
+ const sheet = page.getByRole('dialog', { name: 'More actions' });
+ await expect(
+ sheet.getByRole('button', { name: 'Report an Issue' })
+ ).toBeVisible();
+ await expect(sheet.getByText('Search Prowlarr')).toBeVisible();
+ await sheet.getByRole('button', { name: 'Close' }).click();
+ await expect(sheet).toHaveCount(0);
+ // consecutive collapsed panels keep the page's normal spacing, no extra margin
+ const gaps = await page.evaluate(() => {
+ const panels = [...document.querySelectorAll('.dbody > details.adv')];
+ return panels.slice(1).map((panel, i) => {
+ const prev = panels[i];
+ if (prev.nextElementSibling !== panel) return 0;
+ return Math.round(
+ panel.getBoundingClientRect().top - prev.getBoundingClientRect().bottom
+ );
+ });
+ });
+ for (const gap of gaps) expect(gap).toBeLessThanOrEqual(30);
+ info.annotations.push({ type: 'gaps', description: JSON.stringify(gaps) });
+});
diff --git a/lumen/tests/browser/search-localization.spec.ts b/lumen/tests/browser/search-localization.spec.ts
index e4f9641..7078ddd 100644
--- a/lumen/tests/browser/search-localization.spec.ts
+++ b/lumen/tests/browser/search-localization.spec.ts
@@ -220,7 +220,10 @@ test('Search scopes, results, sorting, and pagination follow the saved locale',
).toBeVisible();
const sorting = page.getByRole('combobox');
await expect(sorting).toBeVisible();
- await expect(page.getByText(expected.sort, { exact: true })).toBeVisible();
+ if ((page.viewportSize()?.width ?? 1440) < 700)
+ await expect(sorting).toHaveAccessibleName(expected.sort);
+ else
+ await expect(page.getByText(expected.sort, { exact: true })).toBeVisible();
await expect(
sorting.getByRole('option', { name: expected.bestMatch, exact: true })
).toBeAttached();
diff --git a/lumen/tests/browser/settings-ui-pass.spec.ts b/lumen/tests/browser/settings-ui-pass.spec.ts
index 45f7240..6b9f6ca 100644
--- a/lumen/tests/browser/settings-ui-pass.spec.ts
+++ b/lumen/tests/browser/settings-ui-pass.spec.ts
@@ -1,4 +1,6 @@
import { expect, test, type Page } from '@playwright/test';
+import { openDiscoveryFilters } from './discoveryFilters';
+import { openPhoneSections } from './phoneSections';
const testAppPath = (path: string) =>
`${process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : ''}${path}`;
@@ -47,6 +49,7 @@ for (const shareEnabled of [true, false]) {
}) => {
await mockServer(page, { shareEnabled });
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', { name: 'Open Share & Identify' })
).toHaveCount(shareEnabled ? 1 : 0);
@@ -98,6 +101,7 @@ test('More Filters applies the title and every range with one button', async ({
}) => {
await mockServer(page);
await page.goto(testAppPath('/movies'));
+ await openDiscoveryFilters(page);
const panel = page.locator('details.more-filters');
await expect(panel).not.toHaveAttribute('open', '');
await panel.locator('summary').click();
@@ -122,6 +126,7 @@ test('More Filters applies the title and every range with one button', async ({
// the panel stays open on reload while one of its filters is in use
await page.reload();
+ await openDiscoveryFilters(page);
await expect(page.locator('details.more-filters')).toHaveAttribute(
'open',
''
diff --git a/lumen/tests/browser/setup.spec.ts b/lumen/tests/browser/setup.spec.ts
index 890133a..7e887f8 100644
--- a/lumen/tests/browser/setup.spec.ts
+++ b/lumen/tests/browser/setup.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const testApiPath = (url: string) =>
new URL(url).pathname.replace(/^\/lumen(?=\/)/, '').slice(7);
@@ -76,6 +77,7 @@ for (const administrator of [true, false]) {
return;
}
await page.goto(`${mount}/admin`);
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Setup Guide' }).click();
await expect(page).toHaveURL(`${mount}/setup?guide=1`);
await expect(
diff --git a/lumen/tests/browser/share.spec.ts b/lumen/tests/browser/share.spec.ts
index ec51211..36f0ec6 100644
--- a/lumen/tests/browser/share.spec.ts
+++ b/lumen/tests/browser/share.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath as mountedTestAppPath } from './testAppPath';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
@@ -162,16 +163,13 @@ for (const permissions of [32, 2]) {
});
await page.goto(mountedTestAppPath('/'));
- const discoverShortcut = page.locator('#view').getByRole('link', {
- name: 'Share & Identify',
- exact: true,
- });
- await discoverShortcut.scrollIntoViewIfNeeded();
- await expect(discoverShortcut).toBeVisible();
- await page.screenshot({ path: info.outputPath('discover-share.png') });
- await discoverShortcut.click();
- await expect(page).toHaveURL(/\/share$/);
- await page.goto(mountedTestAppPath('/'));
+ // Discover's top row lists media types only; Share & Identify lives in the navigation
+ await expect(
+ page.locator('#view').getByRole('link', {
+ name: 'Share & Identify',
+ exact: true,
+ })
+ ).toHaveCount(0);
const desktop = (page.viewportSize()?.width ?? 0) >= 1040;
if (desktop) {
const main = page.getByRole('navigation', {
@@ -190,6 +188,7 @@ for (const permissions of [32, 2]) {
} else {
const tabs = page.getByRole('navigation', { name: 'Tabs', exact: true });
await tabs.locator(`a[href="${mount}/me"]`).click();
+ await openPhoneSections(page);
const link = page.getByRole('link', {
name: 'Open Share & Identify',
exact: true,
@@ -244,6 +243,7 @@ test('Share & Identify navigation stays hidden without request access', async ({
})
).toHaveCount(0);
await page.goto(mountedTestAppPath('/me'));
+ await openPhoneSections(page);
await expect(
page.getByRole('link', {
name: 'Open Share & Identify',
diff --git a/lumen/tests/browser/swipe-navigation.spec.ts b/lumen/tests/browser/swipe-navigation.spec.ts
index 2880e5b..39fabab 100644
--- a/lumen/tests/browser/swipe-navigation.spec.ts
+++ b/lumen/tests/browser/swipe-navigation.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -36,6 +37,7 @@ test('Swipe navigation stays hidden when the administrator disables it', async (
}
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const accountSwipe = page.getByRole('link', {
name: 'Open Swipe',
exact: true,
diff --git a/lumen/tests/browser/theme.spec.ts b/lumen/tests/browser/theme.spec.ts
index 1de956b..0c81aba 100644
--- a/lumen/tests/browser/theme.spec.ts
+++ b/lumen/tests/browser/theme.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath } from './testAppPath';
// "Device" follows the system light/dark setting, live, and so does the browser's bar.
@@ -30,6 +31,7 @@ test('Device theme follows the system, page and browser bar', async ({
);
await page.emulateMedia({ colorScheme: 'light' });
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await expect(page.getByRole('button', { name: 'Device' })).toHaveAttribute(
'aria-pressed',
'true'
diff --git a/lumen/tests/browser/tv-episode-queue-default.spec.ts b/lumen/tests/browser/tv-episode-queue-default.spec.ts
index 558407d..66c09b5 100644
--- a/lumen/tests/browser/tv-episode-queue-default.spec.ts
+++ b/lumen/tests/browser/tv-episode-queue-default.spec.ts
@@ -4,9 +4,9 @@ import { expect, test } from '@playwright/test';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
for (const [count, expected] of [
- [0, 'Episode Queue · off · managed by admin'],
- [1, 'Episode Queue · 1 episode set by admin'],
- [4, 'Episode Queue · 4 episodes set by admin'],
+ [0, 'Episode Queue: off'],
+ [1, 'Episode Queue: 1 episode'],
+ [4, 'Episode Queue: 4 episodes'],
] as const) {
test(`TV detail shows the signed-in user's Episode Queue default (${count})`, async ({
page,
@@ -91,7 +91,7 @@ test('TV detail does not request Episode Queue settings when signed out', async
});
await page.goto(`${mount}/tv/42`);
- await expect(page.getByText(/Episode Queue ·/)).toHaveCount(0);
+ await expect(page.getByText(/Episode Queue:/)).toHaveCount(0);
expect(paths.some((path) => path.includes('/settings/episode-queue'))).toBe(
false
);
diff --git a/lumen/tests/browser/tv-media-server-collections.spec.ts b/lumen/tests/browser/tv-media-server-collections.spec.ts
index c026d8d..2e173d5 100644
--- a/lumen/tests/browser/tv-media-server-collections.spec.ts
+++ b/lumen/tests/browser/tv-media-server-collections.spec.ts
@@ -80,7 +80,7 @@ test('TV detail changes only the selected server collection and confirms state',
});
await page.goto(`${mount}/tv/42`);
- await page.getByTestId('tv-media-server').locator('summary').first().click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
const disclosure = page.getByTestId('media-server-collections');
await expect(disclosure).toBeVisible();
await disclosure.locator('summary').click();
@@ -151,7 +151,7 @@ test('TV detail does not offer a partial collection list after a server limit re
});
await page.goto(`${mount}/tv/42`);
- await page.getByTestId('tv-media-server').locator('summary').first().click();
+ await page.locator('summary').getByText('Details', { exact: true }).click();
await page.getByTestId('media-server-collections').locator('summary').click();
await expect(
page
diff --git a/lumen/tests/browser/tv-request-settings.spec.ts b/lumen/tests/browser/tv-request-settings.spec.ts
index 774d0a3..6d278e5 100644
--- a/lumen/tests/browser/tv-request-settings.spec.ts
+++ b/lumen/tests/browser/tv-request-settings.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page, type TestInfo } from '@playwright/test';
+import { openSections } from './discoveryFilters';
import { testAppPath } from './testAppPath';
async function captureSettings(page: Page, info: TestInfo, locale: string) {
@@ -43,6 +44,8 @@ for (const { locale, expected } of [
});
await page.goto(testAppPath('/me/account/tv-requests'));
+
+ await openSections(page);
const loading = page.getByRole('status').filter({ hasText: expected });
await expect(loading).toBeVisible();
if (locale === 'ar')
@@ -81,6 +84,8 @@ test('TV request settings localize the policy and keep viewer controls read-only
});
await page.goto(testAppPath('/me/account/tv-requests'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', { name: 'Paramètres des demandes TV' })
).toBeVisible();
@@ -133,6 +138,8 @@ test('Arabic TV request settings use RTL and native Arabic plural forms', async
});
await page.goto(testAppPath('/me/account/tv-requests'));
+
+ await openSections(page);
await expect(page.getByText('2 episodes ahead')).toBeVisible();
await captureSettings(page, info, 'ar-en-baseline');
@@ -218,6 +225,8 @@ test('user managers can review access and save the account Episode Queue default
});
await page.goto(testAppPath('/me/account/tv-requests'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', { name: 'Previous-season watch requests' })
).toBeVisible();
@@ -333,6 +342,8 @@ test('TV request account controls follow the viewer permission matrix', async ({
});
await page.goto(testAppPath('/me/account/tv-requests'));
+
+ await openSections(page);
for (const role of roles) {
currentRole = role;
await page.reload();
@@ -408,6 +419,8 @@ test('Episode Queue options use Arabic and French plural forms', async ({
});
await page.goto(testAppPath('/me/account/tv-requests'));
+
+ await openSections(page);
const queueSelect = page.getByRole('combobox', {
name: 'Episodes to keep requested',
});
@@ -488,6 +501,7 @@ test('TV request confirmation dismissals follow the selected locale', async ({
] as const) {
locale = tag;
await page.goto(testAppPath('/me/account/tv-requests'));
+ await openSections(page);
await page.getByRole('combobox').selectOption('3');
await page.getByRole('button', { name: save }).click();
const dialog = page.getByRole('alertdialog');
diff --git a/lumen/tests/browser/tv-request-state.spec.ts b/lumen/tests/browser/tv-request-state.spec.ts
index 244ef23..1ec6d74 100755
--- a/lumen/tests/browser/tv-request-state.spec.ts
+++ b/lumen/tests/browser/tv-request-state.spec.ts
@@ -1,6 +1,7 @@
import { expect, test, type Page, type TestInfo } from '@playwright/test';
import { mkdir } from 'node:fs/promises';
import { basename, dirname, join } from 'node:path';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${testMount}${path}`;
@@ -832,6 +833,7 @@ test('Sonarr language, season order, and tags follow the selected destination',
]);
expect(posts[0].body).not.toHaveProperty('languageProfileId');
await page.goto(appPath('/me'));
+ await openPhoneSections(page);
const preference = page.getByRole('switch', {
name: /Choose server and folder on quick requests/,
});
diff --git a/lumen/tests/browser/user-management-navigation.spec.ts b/lumen/tests/browser/user-management-navigation.spec.ts
index d8ca84d..4fa5996 100644
--- a/lumen/tests/browser/user-management-navigation.spec.ts
+++ b/lumen/tests/browser/user-management-navigation.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -25,6 +26,7 @@ async function openMenu(page: Page, permissions: number) {
return route.fulfill({ json: {} });
});
await page.goto(`${mount}/me`);
+ await openPhoneSections(page);
if ((page.viewportSize()?.width ?? 0) < 1040)
await page.getByRole('button', { name: 'More navigation' }).click();
return page.locator('.side');
diff --git a/lumen/tests/browser/user-notifications-localization.spec.ts b/lumen/tests/browser/user-notifications-localization.spec.ts
index 22122d1..c2bbaf9 100644
--- a/lumen/tests/browser/user-notifications-localization.spec.ts
+++ b/lumen/tests/browser/user-notifications-localization.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openSections } from './discoveryFilters';
const mount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const appPath = (path: string) => `${mount}${path}`;
@@ -126,6 +127,8 @@ test('personal notification settings recover from an initial load failure', asyn
});
await page.goto(appPath('/me/account/notifications'));
+
+ await openSections(page);
const alert = page.getByRole('alert');
await expect(alert).toContainText('Temporary notification failure.');
await expect(alert).toContainText(localized.loadFailure);
@@ -284,6 +287,8 @@ test('personal notification controls follow the account locale and preserve chan
});
await page.goto(appPath('/me/account/notifications'));
+
+ await openSections(page);
await expect(
page.getByRole('heading', { name: pageLabels.title })
).toBeVisible();
diff --git a/lumen/tests/browser/ux-fixes.spec.ts b/lumen/tests/browser/ux-fixes.spec.ts
index 48ec406..4c5acb0 100644
--- a/lumen/tests/browser/ux-fixes.spec.ts
+++ b/lumen/tests/browser/ux-fixes.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Page } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
import { testAppPath as mountedTestAppPath } from './testAppPath';
// Phone-pass and audit fixes: whole book covers, author and description, empty narrator list,
@@ -306,6 +307,7 @@ test('cancelling your own request asks first', async ({ page }) => {
test('Reset to defaults asks first', async ({ page }) => {
await fixtures(page);
await page.goto(mountedTestAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('button', { name: 'Reset to defaults' }).click();
const ask = page.getByRole('alertdialog', { name: 'Reset to defaults?' });
await expect(ask).toBeVisible();
@@ -405,8 +407,8 @@ test.describe('touch screens', () => {
getComputedStyle(e, '::after').content,
])
);
- for (const [before] of marks) expect(before).toBe('none');
- expect(marks[0][1]).toContain('·');
- expect(marks[marks.length - 1][1]).toBe('none');
+ // each item carries a leading dot; the one starting a line is clipped by the line's box
+ for (const [, after] of marks) expect(after).toBe('none');
+ for (const [before] of marks) expect(before).toContain('·');
});
});
diff --git a/lumen/tests/browser/video-metadata-provenance.spec.ts b/lumen/tests/browser/video-metadata-provenance.spec.ts
index 04b71ec..b54c604 100644
--- a/lumen/tests/browser/video-metadata-provenance.spec.ts
+++ b/lumen/tests/browser/video-metadata-provenance.spec.ts
@@ -170,7 +170,7 @@ for (const locale of Object.keys(locales) as (keyof typeof locales)[]) {
await expect(
page.getByRole('heading', { name: 'Fixture Film' })
).toBeVisible();
- await page.getByText(copy.movie, { exact: true }).click();
+ await page.locator('details#details > summary').click();
const drama = page.getByRole('link', { name: 'Drama', exact: true });
const comedy = page.getByRole('link', { name: 'Comedy', exact: true });
if (!captureOnly) {
@@ -216,7 +216,7 @@ for (const locale of Object.keys(locales) as (keyof typeof locales)[]) {
await expect(
page.getByRole('heading', { name: 'Fixture Series' })
).toBeVisible();
- await page.getByText(copy.tv, { exact: true }).click();
+ await page.locator('details#details > summary').click();
const studioLabel = page
.locator('#details dt')
.getByText(copy.studio, { exact: true });
@@ -292,7 +292,7 @@ for (const locale of Object.keys(locales) as (keyof typeof locales)[]) {
await expect(
page.getByRole('heading', { name: 'Fixture Series' })
).toBeVisible();
- await page.getByText(copy.tv, { exact: true }).click();
+ await page.locator('details#details > summary').click();
await expect(
page.locator('#details dt').getByText(copy.lastAired, { exact: true })
).toHaveCount(0);
diff --git a/lumen/tests/browser/watch-sessions.spec.ts b/lumen/tests/browser/watch-sessions.spec.ts
index 3f9f1a1..0dcdc7d 100644
--- a/lumen/tests/browser/watch-sessions.spec.ts
+++ b/lumen/tests/browser/watch-sessions.spec.ts
@@ -1,4 +1,5 @@
import { expect, test } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) => `${testMount}${path}`;
@@ -79,6 +80,7 @@ test('a household can create a watch session and opt in to watchlist contributio
return route.fulfill({ json: {} });
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Watch Sessions' }).click();
await page.getByLabel('Session Title').fill('Movie Night');
await page
diff --git a/lumen/tests/browser/watchlist.spec.ts b/lumen/tests/browser/watchlist.spec.ts
index d9b6656..8eafc96 100644
--- a/lumen/tests/browser/watchlist.spec.ts
+++ b/lumen/tests/browser/watchlist.spec.ts
@@ -1,4 +1,5 @@
import { expect, test, type Locator } from '@playwright/test';
+import { openPhoneSections } from './phoneSections';
const testMount = process.env.LUMEN_TEST_MOUNT === '/lumen' ? '/lumen' : '';
const testAppPath = (path: string) => `${testMount}${path}`;
@@ -407,6 +408,7 @@ for (const combined of [false, true]) {
});
});
await page.goto(testAppPath('/me'));
+ await openPhoneSections(page);
await page.getByRole('link', { name: 'Open Watchlist' }).click();
await expect(
page.getByRole('heading', { name: 'Watchlist' })
@@ -624,9 +626,10 @@ test('video Watchlist action confirms the current title and server response', as
).toBeVisible();
await expect(remove).toBeVisible();
await remove.click();
+ // one Watchlist button: the page no longer leaves stale copies behind
await expect(
page.getByRole('button', { name: 'Add Example Movie to your Watchlist' })
- ).toHaveCount(3);
+ ).toHaveCount(1);
expect(writes).toBe(2);
});
diff --git a/lumen/tests/hearthLink.test.mjs b/lumen/tests/hearthLink.test.mjs
new file mode 100644
index 0000000..114f023
--- /dev/null
+++ b/lumen/tests/hearthLink.test.mjs
@@ -0,0 +1,157 @@
+import assert from 'node:assert/strict';
+import { readFile } from 'node:fs/promises';
+import test from 'node:test';
+import ts from 'typescript';
+
+// musicPlayback.ts with its imports swapped for small stand-ins: these tests only need the
+// link builders
+const moduleUrl = (source) =>
+ `data:text/javascript,${encodeURIComponent(
+ ts.transpileModule(source, {
+ compilerOptions: {
+ target: ts.ScriptTarget.ES2022,
+ module: ts.ModuleKind.ESNext,
+ },
+ }).outputText
+ )}`;
+const stub = (code) => `data:text/javascript,${encodeURIComponent(code)}`;
+const source = (
+ await readFile(new URL('../src/musicPlayback.ts', import.meta.url), 'utf8')
+)
+ .replace(
+ "'react'",
+ JSON.stringify(stub('export const useSyncExternalStore = () => null;'))
+ )
+ .replace(
+ "'./api'",
+ JSON.stringify(stub('export const readerServiceUrl = (v) => new URL(v);'))
+ )
+ .replace(
+ "'./sessionState'",
+ JSON.stringify(stub('export const onSessionReset = () => {};'))
+ );
+const music = await import(moduleUrl(source));
+
+const ALBUM = 'b1a9c0e9-d987-4042-ae91-78d6a3267d69';
+const ARTIST = '056e4f3e-d505-4dad-8ec1-d04f521cbb56';
+const intent = (path, fallback) =>
+ `intent://${path}#Intent;scheme=shelf;package=org.ncbudd.abswatch;S.browser_fallback_url=${encodeURIComponent(fallback)};end`;
+
+test('an album with its MusicBrainz id plays the album', () => {
+ assert.equal(
+ music.hearthPath({
+ kind: 'album',
+ album: {
+ title: 'Discovery & More',
+ artistName: 'Daft Punk',
+ mbid: ALBUM,
+ },
+ }),
+ `play?album=${ALBUM}&by=Daft%20Punk&name=Discovery%20%26%20More`
+ );
+});
+
+test('an album without an id falls back to a search', () => {
+ assert.equal(
+ music.hearthPath({
+ kind: 'album',
+ album: { title: 'Discovery', artistName: 'Daft Punk' },
+ }),
+ 'search?q=Daft%20Punk%20Discovery'
+ );
+});
+
+test('a song on a known album plays it on that album', () => {
+ assert.equal(
+ music.hearthPath({
+ kind: 'track',
+ track: {
+ title: 'One More Time',
+ artistName: 'Daft Punk',
+ albumTitle: 'Discovery',
+ albumMbid: ALBUM,
+ },
+ }),
+ `play?album=${ALBUM}&title=One%20More%20Time&by=Daft%20Punk&name=Discovery`
+ );
+});
+
+test('a song without an album id plays by title and artist', () => {
+ assert.equal(
+ music.hearthPath({
+ kind: 'track',
+ track: { title: 'Digital Love', artistName: 'Daft Punk' },
+ }),
+ 'play?title=Digital%20Love&by=Daft%20Punk'
+ );
+});
+
+test('an artist with an id plays the artist; without one it is a search', () => {
+ assert.equal(
+ music.hearthPath({
+ kind: 'artist',
+ artist: { name: 'Daft Punk', mbid: ARTIST },
+ }),
+ `play?artist=${ARTIST}&name=Daft%20Punk`
+ );
+ assert.equal(
+ music.hearthPath({ kind: 'artist', artist: { name: 'Daft Punk' } }),
+ 'search?q=Daft%20Punk'
+ );
+});
+
+test('the intent carries the encoded fallback page', () => {
+ const target = {
+ kind: 'track',
+ track: { title: 'Digital Love', artistName: 'Daft Punk' },
+ };
+ const fallback = 'https://music.example.com/search?q=Daft Punk&x=1#frag';
+ assert.equal(
+ music.hearthLink(target, fallback),
+ intent('play?title=Digital%20Love&by=Daft%20Punk', fallback)
+ );
+ assert.equal(
+ music.hearthLink(target, null),
+ 'intent://play?title=Digital%20Love&by=Daft%20Punk#Intent;scheme=shelf;package=org.ncbudd.abswatch;end'
+ );
+});
+
+test('playLink sends Hearth to Aurral, or Plex without Aurral, when the app is missing', () => {
+ const target = {
+ kind: 'track',
+ track: { title: 'Digital Love', artistName: 'Daft Punk' },
+ };
+ const withAurral = music.playLink(
+ 'hearth',
+ target,
+ 'https://music.example.com'
+ );
+ assert.ok(withAurral.startsWith('intent://play?'));
+ assert.ok(
+ withAurral.includes(
+ `S.browser_fallback_url=${encodeURIComponent(
+ music.aurralLink('https://music.example.com', target)
+ )};`
+ )
+ );
+ const withoutAurral = music.playLink('hearth', target, null);
+ assert.ok(
+ withoutAurral.includes(
+ `S.browser_fallback_url=${encodeURIComponent(music.plexLink(target))};`
+ )
+ );
+});
+
+test('the old Shelf name still reads as Hearth and is saved under it', () => {
+ assert.equal(music.asMusicPlayer('shelf'), 'hearth');
+ assert.equal(music.storedMusicPlayer('hearth'), 'shelf');
+ assert.deepEqual(music.allowedMusicPlayers(['plex', 'shelf', 'bogus']), [
+ 'plex',
+ 'hearth',
+ ]);
+ assert.deepEqual(music.allowedMusicPlayers(undefined), [
+ 'aurral',
+ 'plex',
+ 'hearth',
+ ]);
+});