Skip to content

feat: add 10-per-page pagination and search filter to Top Sources (#530) - #533

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
marceli1404:feat/top-sources-pagination-filter
Jul 27, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
marceli1404:feat/top-sources-pagination-filter

Conversation

@marceli1404

Copy link
Copy Markdown
Contributor

Fixes #530

Changes

table-pager.tsx

  • Added optional pageSize parameter to usePagination (default PAGE_SIZE = 100)
  • All existing callers unaffected (default preserved for citations page)

Prompt detail page

  • Search filter: added <Input> to TopSourcesCard that filters rows by case-insensitive substring match on domain, URL, and title
  • 10-per-page pagination: Top Sources tables now use pageSize=10 (down from 100)
  • Filter resets pager to page 1 via resetKey
  • Rank numbers stay continuous across filtered pages

Acceptance criteria

  • Both Top Sources tabs page through rows 10 at a time
  • Citations page still pages by 100 (unchanged)
  • Filter narrows both tabs by domain/URL/title and resets pager
  • Rank numbers stay continuous across pages of the filtered list

- Add optional pageSize parameter to usePagination (default PAGE_SIZE=100)
- Add search input to TopSourcesCard for filtering by domain/URL/title
- Top Sources tables now page 10 rows at a time (down from 100)
- Filter resets pager to page 1 and applies across both tabs
- Rank numbers stay continuous across filtered pages

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — the implementation is exactly what #530 asked for: pageSize defaulting keeps the citations page untouched, the filter drives both tabs with live counts, and the pager resets via resetKey. Typecheck and ESLint both pass on my local run.

One blocker: Prettier fails on prompts/[id]/page.tsx (the new long signature lines exceed the print width). CI couldn't tell you because workflow runs for first-time contributors need maintainer approval — that's being sorted. Fix:

cd web && npx prettier --write "src/app/[locale]/(dashboard)/dashboard/prompts/[id]/page.tsx"

commit, push, and this is good to go.

@marceli1404

Copy link
Copy Markdown
Contributor Author

Prettier formatting has been applied and pushed (commit 5ee3491). Ready for another look.

@marceli1404

Copy link
Copy Markdown
Contributor Author

Friendly bump on this one — Prettier pass was pushed as commit 5ee3491 yesterday. Re-requesting review in case it dropped off your queue. Let me know if there's anything else I should clean up.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting fixed and CI is green — thanks for the quick turnaround and for the clean pagination + filter work, @marceli1404!

@gkhngyk
gkhngyk merged commit 13953d0 into ansvisor:main Jul 27, 2026
3 checks passed
@marceli1404

Copy link
Copy Markdown
Contributor Author

Is there any chance I could become an admin since I really want to try out reviewing code etc... (: thank you in advance

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.

Prompt detail: 10-per-page Top Sources pagination and a URL/domain filter

2 participants