diff --git a/web/src/pages/ItemDetail/MangaContent.test.tsx b/web/src/pages/ItemDetail/MangaContent.test.tsx index f6870c14..ac4bbde0 100644 --- a/web/src/pages/ItemDetail/MangaContent.test.tsx +++ b/web/src/pages/ItemDetail/MangaContent.test.tsx @@ -164,6 +164,32 @@ describe("MangaContent", () => { expect(cta).toHaveAttribute("href", "/reader/ebook/v02?libraryId=7" + seriesBackTo); }); + // Regression test for issue #188: partial progress on the resume target + // must surface as "Resume Reading", not "Start Reading". + it("shows a Resume Reading hero CTA when the target volume is partially read", () => { + render( + + + , + ); + + const cta = screen.getByRole("link", { name: /Resume Reading/i }); + expect(cta).toHaveTextContent("Volume 1"); + expect(cta).toHaveAttribute("href", "/reader/ebook/v01?libraryId=7" + seriesBackTo); + }); + it("offers a Read Again CTA from the start once every chapter is read", () => { render( diff --git a/web/src/pages/ItemDetail/MangaContent.tsx b/web/src/pages/ItemDetail/MangaContent.tsx index eac18f62..40c70da6 100644 --- a/web/src/pages/ItemDetail/MangaContent.tsx +++ b/web/src/pages/ItemDetail/MangaContent.tsx @@ -271,8 +271,12 @@ export default function MangaContent({ const anyRead = chapterRows.some((chapter) => chapter.read === true); const resume = useMemo(() => firstUnreadChapter(entries), [entries]); const fallbackStart = entries.length > 0 ? flattenFirst(entries) : null; + const resumeInProgress = (resume?.chapter.progress ?? 0) > 0; const cta = resume - ? { ...resume, verb: anyRead ? "Continue" : "Start Reading" } + ? { + ...resume, + verb: resumeInProgress ? "Resume Reading" : anyRead ? "Continue" : "Start Reading", + } : fallbackStart ? { ...fallbackStart, verb: "Read Again" } : null;