feat(manga): library state badges on galleries and listing pages #3

Merged
rms merged 1 commit from feat/gallery-badges into master 2026-11-28 02:13:41 -06:00
Owner

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.

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.
rms merged commit 2c1f086bb8 into master 2026-11-28 02:13:41 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rms/userscripts!3
No description provided.