Search and filter the library #13
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/13/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Finding a book meant paging through covers until you saw it. This adds a Find
screen reached from the bottom bar: search by title or author, and filter by
read state, on-device status and collection.
Costs no extra requests — every field it matches on is already in memory
from the browse the app does at startup.
Scope came from the data, not from guesswork
Surveyed the live library first:
Genre filtering is deliberately excluded: 23 of 29 books have none, what
exists is mostly publisher junk scraped from EPUB metadata (
febtradepromo,givewell,sel021000), and it would cost 29 extra HTTP requests at startup —one
Series/metadatacall per series — to filter on data most books lack.What changed
core/BookFilter(new, pure) — all matching rules, 14 host tests using thereal library as fixtures, because those titles are what break naive matchers:
"Calvin and Hobbes" appears twice, "Habit" twice, and one title is Dutch.
ui/FindScreen(new) — the form and its hit-testing, sharing rectanglehelpers so a control is tappable exactly where it was drawn.
Find, and showsFind * 12 of 29 - Page 1 / 2whenever afilter is active, so a filtered shelf can never be mistaken for a shrinking
library.
main.cpppages the gallery over ag_visibleindex list.The one real hazard
g_visibleholds indices intog_entries. Only the gallery's pagearithmetic works in filtered space; details, load, unload and sync all stay in
real-entry space and convert at exactly one place. Getting that wrong would
open — or unload — the wrong book.
Notes
restart and silently hides books is a "where did my library go?" trap.
KBD_SCREENTOP+KBD_NO_SELFCLOSE_ON_OKwould allow refine-in-placesearching. Left as a future device experiment — this firmware has departed
from documented PocketBook behaviour before.
Test plan
index-mapping hazard above
🤖 Generated with Claude Code