mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
fix(books): show read status on the book detail discovery shelf
The series, author and similar endpoints never selected a read status, so every cover in the detail shelf rendered bare. Attach the requesting user's status in one bulk lookup per lane, and draw the badge in BookCarousel using the same icons and placement as the library grid, plus an sr-only label. BookRepository has no user in scope, so it now returns UnscopedBookRecommendation and the type system forces the status on where the user exists. Also adds the untracked scanner overlap repro for issue 1094. Closes #1163
This commit is contained in:
@@ -327,10 +327,14 @@ export type BookRecommendation = {
|
||||
updatedAt: string | null;
|
||||
hasCover: boolean;
|
||||
authors: string[];
|
||||
readStatus: UserBookStatus | null;
|
||||
isAudiobook?: boolean;
|
||||
isComic?: boolean;
|
||||
};
|
||||
|
||||
/** A recommendation row before a user's read status is attached, for lookups that have no user in scope. */
|
||||
export type UnscopedBookRecommendation = Omit<BookRecommendation, "readStatus">;
|
||||
|
||||
export type SeriesBookRecommendation = {
|
||||
id: number;
|
||||
title: string | null;
|
||||
@@ -339,6 +343,7 @@ export type SeriesBookRecommendation = {
|
||||
seriesIndex: SeriesIndex | null;
|
||||
hasCover: boolean;
|
||||
authors: string[];
|
||||
readStatus: UserBookStatus | null;
|
||||
isAudiobook?: boolean;
|
||||
isComic?: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user