fix(filters): live count follows the top library picker (user report)
The count fetch reads the library select at fetch time, but nothing re-triggered it on a scope change — the number stayed stale (8 across all books) after switching to a library where the rules match nothing. The picker's change event now reschedules the count, same as rule edits do.
This commit is contained in:
1 parent
ab713e2feb
commit
68701d6b94
2 files changed
+11
-1
No files matched your search
@@ -562,6 +562,16 @@ function initBookshelf(): void {
|
||||
refreshFilterChips();
|
||||
});
|
||||
|
||||
// The live match count is scope-aware: switching the top library
|
||||
// picker re-runs it (the count fetch reads the select at fetch time —
|
||||
// this is what makes it fire).
|
||||
const librarySelect = document.getElementById(
|
||||
"library-select",
|
||||
) as HTMLSelectElement | null;
|
||||
librarySelect?.addEventListener("change", () => {
|
||||
builderData()?.scheduleMatchCount();
|
||||
});
|
||||
|
||||
// A2c §5.3: deep-linkable filters — /bookshelf?author_filter=Sapkowski
|
||||
// pre-fills the form and applies it to the first grid load. Author
|
||||
// links on the detail page (and anything else) can share filtered
|
||||
|
||||
Reference in new issue
Block a user