From 464bffc6a763bd37e8a0a49dbe12201e58176ee2 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 12 Mar 2026 13:00:33 +0100 Subject: [PATCH] Style entry select popup --- api/bun.lock | 3 ++ front/public/translations/en.json | 2 + front/src/components/entries/select.tsx | 50 ++++++++++++++++++++++--- front/src/ui/details/season.tsx | 9 ++++- front/src/ui/details/serie.tsx | 19 +++++++--- front/tsconfig.json | 23 ++---------- 6 files changed, 74 insertions(+), 32 deletions(-) diff --git a/api/bun.lock b/api/bun.lock index 03bd1019..49bce478 100644 --- a/api/bun.lock +++ b/api/bun.lock @@ -44,6 +44,7 @@ "devDependencies": { "@biomejs/biome": "2.4.4", "@types/pg": "^8.16.0", + "typescript": "^5.9.3", }, }, }, @@ -455,6 +456,8 @@ "type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "uint8array-extras": ["uint8array-extras@1.5.0", "", {}, "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A=="], "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], diff --git a/front/public/translations/en.json b/front/public/translations/en.json index fa0313c6..db1e0bad 100644 --- a/front/public/translations/en.json +++ b/front/public/translations/en.json @@ -45,6 +45,8 @@ "season": "Season {{number}}", "multiVideos": "Multiples video files available", "videosCount": "{{number}} videos", + "version": "Version {{number}}", + "part": "Part {{number}}", "videos-map": "Edit video mappings" }, "videos-map": { diff --git a/front/src/components/entries/select.tsx b/front/src/components/entries/select.tsx index e4e48776..1f576ff0 100644 --- a/front/src/components/entries/select.tsx +++ b/front/src/components/entries/select.tsx @@ -1,19 +1,57 @@ -import { P, Popup } from "~/primitives"; +import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; +import { Fragment } from "react"; +import { useTranslation } from "react-i18next"; +import { View } from "react-native"; +import type { Entry } from "~/models"; +import { HR, Icon, Link, P, Popup, SubP } from "~/primitives"; export const EntrySelect = ({ + displayNumber, name, videos, close, }: { + displayNumber: string; name: string; - videos: { slug: string; path: string }[]; + videos: Entry["videos"]; close?: () => void; }) => { + const { t } = useTranslation(); + return ( - - {videos.map((x) => ( -

{x.path}

- ))} + x).join(" · ")} + close={close} + > + {[...Map.groupBy(videos, (v) => v.rendering).entries()].map( + ([rendering, items], i) => ( + + {i > 0 &&
} + {items.map((x) => ( + + + +

{x.path}

+ + {[ + t("show.version", { number: x.version }), + x.part !== null + ? t("show.part", { number: x.part }) + : null, + ] + .filter((s) => s != null) + .join(" · ")} + +
+ + ))} +
+ ), + )}
); }; diff --git a/front/src/ui/details/season.tsx b/front/src/ui/details/season.tsx index 525b69ab..c76b74a3 100644 --- a/front/src/ui/details/season.tsx +++ b/front/src/ui/details/season.tsx @@ -100,8 +100,9 @@ export const EntryList = ({ slug: string; season: string | number; onSelectVideos?: (entry: { + displayNumber: string; name: string | null; - videos: { slug: string; path: string }[]; + videos: Entry["videos"]; }) => void; } & Partial>>) => { const { t } = useTranslation(); @@ -146,7 +147,11 @@ export const EntryList = ({ displayNumber={entryDisplayNumber(item)} watchedPercent={item.progress.percent} onSelectVideos={() => - onSelectVideos?.({ name: item.name, videos: item.videos }) + onSelectVideos?.({ + displayNumber: entryDisplayNumber(item), + name: item.name, + videos: item.videos, + }) } /> )} diff --git a/front/src/ui/details/serie.tsx b/front/src/ui/details/serie.tsx index 204b55f7..af179250 100644 --- a/front/src/ui/details/serie.tsx +++ b/front/src/ui/details/serie.tsx @@ -30,11 +30,13 @@ export const NextUp = ({ }: { entry: Entry; onSelectVideos?: (entry: { + displayNumber: string; name: string | null; - videos: { slug: string; path: string }[]; + videos: Entry["videos"]; }) => void; }) => { const { t } = useTranslation(); + const displayNumber = entryDisplayNumber(entry); return ( @@ -45,9 +47,13 @@ export const NextUp = ({ serieSlug={null} videosCount={entry.videos.length} watchedPercent={entry.progress.percent} - displayNumber={entryDisplayNumber(entry)} + displayNumber={displayNumber} onSelectVideos={() => - onSelectVideos?.({ name: entry.name, videos: entry.videos }) + onSelectVideos?.({ + displayNumber, + name: entry.name, + videos: entry.videos, + }) } /> @@ -76,8 +82,9 @@ const SerieHeader = ({ slug: string; onImageLayout?: ViewProps["onLayout"]; onSelectVideos?: (entry: { + displayNumber: string; name: string | null; - videos: { slug: string; path: string }[]; + videos: Entry["videos"]; }) => void; }) => { return ( @@ -112,11 +119,13 @@ export const SerieDetails = () => { const openEntrySelect = useCallback( (entry: { + displayNumber: string; name: string | null; - videos: { slug: string; path: string }[]; + videos: Entry["videos"]; }) => { setPopup(