Commit Graph

5 Commits

Author SHA1 Message Date
1416375e40 fix: cache=[] disables the button (not raises); nav row stays suppressed on re-render (v0.1.4)
M-3: the cache-length guard used 'cache is not None', so cache=[] ([] is not None) hit the
length check and raised at construction — contradicting README/CLAUDE that say a falsy
cache disables the button (matching the render path 'if self.cache:'). guard now uses
'if cache' so [] and None both disable; a non-empty too-short cache still raises.

dpy_paginator-F2: update_buttons() now ANDs nav with max_pages>=2, so a single-page
re-render (update_page -> _build_render_kwargs, default nav=True) no longer resurrects the
nav row over the page's custom buttons. start()'s single-page branch simplified accordingly.

verified by execution with real discord.py: []-disables and None-disables both construct,
real cache renders, too-short still raises; single-page re-render keeps nav suppressed +
custom button, multi-page control still shows nav.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 20:47:43 -04:00
8c3bacb2f2 fix: reject wrong-typed embed/file page keys; author_id is-None check (v0.1.3)
- a dict page with a wrong-typed embed/embeds/file/files key now raises a clear
  paginator-side ValueError instead of forwarding it to discord.py as a conflicting
  kwarg (opaque TypeError) (L12)
- interaction_check uses 'author_id is None' so an author_id of 0 still restricts (nit).

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 17:58:09 -04:00
20ea4f9291 fix: single page keeps custom buttons instead of dropping the view (v0.1.2)
a single-page result (max_pages < 2) suppressed the navigation row by dropping the
whole view, which also discarded the consumer's custom per-page buttons. now: if the
page carries custom buttons, keep the view and rebuild with update_buttons(nav=False)
— nav items suppressed, custom buttons kept, and stop() NOT called so their callbacks
still fire. a page with no custom buttons keeps the original drop-the-view behavior.

verified by execution against real discord.py: single page + custom button -> start()
-> callback FIRES on click (view kept, stop() not called); negative control on the old
code drops the button entirely; the no-button single-page case is unregressed.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 17:26:04 -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