feat(manga): library state badges on galleries and listing pages #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/gallery-badges"
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?
Marks every linked gallery on a page (on disk / favourite / queued / gone) via CSS ::after, one bulk /lookup per page re-scanned on scroll, plus a state line on the gallery toolbar. Site detection is now host-only with gallery-vs-listing split, and the actions pill renders only where it has something to act on.
The download action could only answer "what happens if I click", and on a listing page it did not exist at all - which is where "do I already have this one?" is actually asked. Every thumbnail the page links to now gets a mark: on disk (green) already in the library ★ (amber) in my favourites (nh only; ht has no favourites feature) queued (blue) queued, not finished gone (red) absent upstream Rendered as CSS `::after` on the existing anchors, not inserted nodes: nothing to clean up when a site re-renders its grid, and it cannot break a click target. One bulk `/lookup` request per page (chunked at 200 ids), re-scanned on scroll with a 1.5 s debounce and only when the anchor count actually changed. On a gallery page the toolbar also carries a state line ("on disk · 186p ★", "queued", "gone upstream"), refreshed after a queue post. Two structural changes this needed: * site detection is now host-only, with a separate `isGalleryPage`; listing pages have to be recognised before the page kind is known, or the badge pass could never run there. `alias` (nh/ht) is what the lookup API speaks. * the actions pill renders only on a gallery or ComicRead page - on a listing grid it would have nothing to act on and would cover the thumbnails. Verified: bun run ci clean against the pinned biome.