feat(library): add "Progress Read" sort option (#4427) (#4893)

Sort the library by reading progress (current/total pages). Books that
have never been opened read 0% and sort to the unread end; groups sort
by their most-progressed book. Direction reuses the existing
ascending/descending toggle, so "most read first" is Descending.

Adds the "Progress Read" entry to the Sort by menu and translates it
across all locales.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-07-02 23:52:17 +09:00
committed by GitHub
parent df34de1c38
commit 4d645befde
38 changed files with 132 additions and 33 deletions
@@ -544,6 +544,18 @@ describe('getGroupSortValue', () => {
expect(getGroupSortValue(group, LibrarySortByType.Series)).toBe('My Series');
});
it('should return max read ratio for progress sort', () => {
const group = createMockGroup({
books: [
createMockBook({ progress: [10, 100] }),
createMockBook({ progress: [80, 100] }),
createMockBook({}),
],
});
expect(getGroupSortValue(group, LibrarySortByType.Progress)).toBe(0.8);
});
it('should handle empty groups gracefully', () => {
const group = createMockGroup({ books: [] });