// Pure helper for reflecting a reader's personal progress on a manga's // chapter list. Kept UI-free so the read/unread logic is unit-testable // without rendering the detail page. /** * A chapter counts as read once its number is at or before the reader's * last-read chapter number. An unknown last-read position (guest, never * opened, or a deleted chapter) marks nothing — we never guess. */ export function isChapterRead(chapterNumber: number, lastReadNumber: number | null): boolean { return lastReadNumber != null && chapterNumber <= lastReadNumber; } // Note: the "new since last read" *count* is computed server-side // (distinct chapter numbers over ALL chapters — see // repo::read_progress) and delivered on the read-progress payloads, so it // isn't recomputed here over the detail page's paginated chapter list.