Skip to content

feat: add Audiobooks/Ebooks type filter to admin's Request Management table - #519

Closed
NichCodes wants to merge 1 commit into
kikootwo:mainfrom
NichCodes:feature/admin-request-type-filter
Closed

NichCodes wants to merge 1 commit into
kikootwo:mainfrom
NichCodes:feature/admin-request-type-filter

Conversation

@NichCodes

Copy link
Copy Markdown
Contributor

Summary

Still working on getting automatic eBook delivery working smoothly in a future PR, but here's a small PR for the admin request filter on its own as requested in #236.

This adds a Type dropdown (All Types / Audiobooks / Ebooks) to the Request Management table on the Admin dashboard, backed by a type query param on GET /api/admin/requests.

Details

  • API: type=audiobook or type=ebook filters by Request.type. all, a missing value or an unknown value means no filter, so bad input never reaches the query.
  • Table: the dropdown sits between the Status and User filters, styled the same way. Like the other filters, it's kept in the URL (left out for All Types), resets to page 1, counts toward Clear, and follows back/forward navigation.
  • It shows even when the ebook sidecar is off, since older ebook requests stay in the list.

Testing

  • tests/api/admin-requests.routes.test.ts: filters for audiobook and ebook, no filter for all or an unknown value.
  • tests/app/admin/components/RecentRequestsTable.test.tsx: the Type dropdown renders; choosing Ebooks sends type=ebook and goes back to page 1; Clear resets it.
  • tests/app/admin.page.test.tsx: the table's expected request URL now includes type=all.
  • Full suite passes: 6450 passed, 68 skipped, 0 failed. docker compose build succeeds.
  • Docs: documentation/admin-dashboard.md.

Admins couldn't narrow the Request Management table to one kind of
request. Add a `type` query param to GET /api/admin/requests
(`audiobook` or `ebook`; `all` or an unknown value means no filter) and a
Type dropdown between the Status and User filters.

Like the other filters, it's kept in the URL (left out for All Types),
resets to page 1, counts toward Clear, and follows back/forward. It shows
even with the ebook sidecar off, since older ebook requests stay listed.
@kikootwo

kikootwo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

@NichCodes thanks, this is the filter I was hoping for. I'm bringing it in on a branch of mine with you as co-author, and I'll close this one when it lands.

kikootwo added a commit that referenced this pull request Nov 2, 2026
…pping Clear

With four filters plus Clear in one non-wrapping row, between 640 and about
710 px wide Clear was cut off by the card and the search box shrank to about
54 px. From 640 px the row now wraps, and the search box keeps at least
240 px. Phone widths still stack, and 1280 px is unchanged.

The #519 e2e spec checks Clear sits inside the card and the search box is at
least 160 px wide at 680 and 375 px, with screenshots at those widths.

Co-authored-by: NichCodes <90598280+NichCodes@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kikootwo added a commit that referenced this pull request Nov 2, 2026
Co-authored-by: NichCodes <90598280+NichCodes@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kikootwo added a commit that referenced this pull request Nov 2, 2026
…requests (#537)

The admin Request Management table gets a Type select (All Types / Audiobooks / Ebooks), backed by GET /api/admin/requests?type=. The API takes only audiobook or ebook; all, missing or any other value applies no type filter. The select works like the status filter: kept in the address (left out for All Types), restored by back and forward, resets to page 1, and counts toward Clear. It shows with the ebook sidecar off, since earlier ebook requests stay listed. From 640 px the filter row wraps instead of shrinking the search box, so Clear is never cut off by the card. Every string filter in the table's API URL is now encoded, so a crafted page address cannot add API parameters.

Based on #519 by @NichCodes.

Co-authored-by: NichCodes <90598280+NichCodes@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kikootwo

kikootwo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

@NichCodes thanks again. It's in now as #537 with you as co-author: Request Management has the Type filter (All Types, Audiobooks, Ebooks), kept in the page address like the status filter. I also let the filter row wrap on narrower windows so the Clear button isn't cut off. It will be in the next release. Closing this one in favour of #537.

@kikootwo kikootwo closed this Nov 2, 2026
@kikootwo

kikootwo commented Nov 3, 2026

Copy link
Copy Markdown
Owner

@NichCodes these are all out in v1.2.13: the request type filter from here (#537), the settings tab in the URL from #517 (#534), the DRM release skip from #518 (#528), and the trailing-slash fix from #236 (#536). Thanks for all of them.

@NichCodes
NichCodes deleted the feature/admin-request-type-filter branch November 3, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants