Commit Graph

4 Commits

Author SHA1 Message Date
6dae35001e fix: out-of-range page wrap returns a per_page slice; validate cache length
get_page() out-of-range/negative wrap reset to page 0 but returned pages[0] (a single item) even with per_page>1, mis-shaping the page downstream; it now reroutes through get_page(0) so the normal slice logic applies. cache shorter than max_pages now raises ValueError at construction instead of an IndexError when the cache button is clicked on a later page.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-28 17:46:20 -04:00
4d52ef7f50 fix: reject empty pages at construction (v0.1.1)
empty pages gave max_pages=0; get_page(0)/start() then IndexError'd on self.pages[0].
guard in __init__ with a clear ValueError instead of a deferred crash at render.

verified: ButtonPaginator([]) -> ValueError; non-empty and single-page intact.
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-28 15:51:40 -04:00
958920a6ba add package: pyproject + src
ButtonPaginator: button-navigated discord.py paginator (discord.ui.View)
over mixed page content (str/embed/file/attachment/dict) with per-page
custom buttons, jump-to-page modal, and a mention-cache primer button.
config-free — emojis injectable with unicode fallback, everything passed
at construction. src/ layout, hatchling build.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-24 21:36:43 -04:00
0a1f4f609f init: button paginator for discord.py
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-24 15:10:18 -04:00