fix(series): show selected books in KOReader series views

Pass bulk selection state through the dedicated series-page model so grid and list layouts render the same selection cues as the library.

Closes #1956
This commit is contained in:
neon
2026-10-28 15:23:35 +00:00
parent 62e8690b30
commit 63e16ad757
3 changed files with 30 additions and 1 deletions
@@ -1221,6 +1221,8 @@ function CatalogLists:listBody(kind, context)
local m = {
entries = books, view = self:listView(kind), screen_w = sw, screen_h = sh, local_page = context.local_page,
offline = context.list_offline and {} or nil,
select = self:isBulkSelectionActive(),
selected = function(b) return self.bulk_select_all or self:bulkIsBookSelected(b) end,
order_label = (context.params or {}).sort == "title" and _("Title A–Z") or _("Reading order"),
states = states, indexes = indexes, current_index = cur, next_book = next_book,
range = #books > 0 and T(_("Books %1 – %2"), first, last) or nil,
@@ -255,6 +255,8 @@ function Pages.seriesBody(m, f)
local short = ListData.distinctTitles(books)
content = ListView.cellsGrid(list_w, g, books, function(b)
return ListView.bookCell(g, b, {
select = m.select,
selected = m.selected and m.selected(b),
title = function(x) return x.seriesIndex and (tostring(x.seriesIndex) .. ". " .. (short[x.id] or x.title or "")) or (short[x.id] or x.title or "") end,
meta = function(x)
local st = ListData.stateOf(x)
@@ -272,7 +274,12 @@ function Pages.seriesBody(m, f)
content = ListView.indexList(list_w, list_h, {
entries = books, rows_per_col = rows.n, row_h = rows.rh, cols = 1, gutter = 34, rail = false,
groupOf = function(b) return "#" .. tostring(b.seriesIndex or "") end, group_rules = false,
row = function(w, hh, b) return ListView.bookRow(w, hh, b, { context = "series" }) end, action = m.action,
row = function(w, hh, b) return ListView.bookRow(w, hh, b, {
select = m.select,
selected = m.selected and m.selected(b),
context = "series",
}) end,
action = m.action,
})
end
local list = vstack({ w = list_w }, { head, space(nil, px(8)), content })