Skip to content

fix: unify Prompts page pagination with shared TablePager (closes #544) - #546

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Maqbool61:fix/issue-544-unified-pagination
Aug 1, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Maqbool61:fix/issue-544-unified-pagination

Conversation

@Maqbool61

Copy link
Copy Markdown
Contributor

Summary

Fixes the pagination inconsistency on the Prompts page described in #544.
Both affected views now use the same TablePager + usePagination that
the Citations page and prompt-detail Top Sources card already use.

Changes

_fanout-tab.tsx — Fan-out tab (High frequency view)

  • Replaced the bespoke getPagerItems numbered pager (1 2 … 9 buttons)
    with the shared <TablePager> component
  • usePagination (pageSize = 10) is now called in QueryFanoutTab and
    passed down to HighFrequencyView via a single pager prop
  • Deleted getPagerItems entirely — no remaining usages anywhere
  • ByPromptView is unchanged

page.tsx — Main prompt list (All Prompts tab)

  • Added usePagination(filtered.length, resetKey) + <TablePager> below
    the table (PAGE_SIZE = 100, matching the shared default)
  • resetKey encodes search text + work status filter + sort column + sort
    direction, so changing any filter or sort automatically returns to page 1
  • filtered.map(...) → filtered.slice(pager.start, pager.end).map(...)
  • All other logic (sorting, filtering, row rendering, dialogs) untouched

Acceptance criteria (from issue)

  • Prompts main list shows at most one page of rows with the shared
    pager below the table; filter/sort changes reset to page 1
  • Fan-out tab High frequency view uses the same TablePager UI as
    Citations
  • No remaining usages of getPagerItems
  • format:check, lint, typecheck, and test all pass (47/47)

Testing

cd web
npm run format:check   # ✅ All matched files use Prettier code style!
npm run lint           # ✅ No issues
npm run typecheck      # ✅ No errors
npm run test           # ✅ 47/47 tests passed

Manually verified on npm run dev:

  • All Prompts tab: Previous/Next pager appears below the table, page
    resets to 1 when search or sort changes
  • Fan-out → High frequency: Previous/Next pager replaces the old numbered
    buttons, styling matches Citations page exactly

- Main prompt list: add usePagination + TablePager (PAGE_SIZE=100);
  resetKey encodes search + workFilter + sort so filter/sort changes
  automatically reset to page 1
- Fan-out tab: replace bespoke getPagerItems numbered pager with
  TablePager; HighFrequencyView now uses usePagination (pageSize=10)
- Deletes getPagerItems entirely; no remaining custom pager markup

format:check, lint, typecheck, and test all pass (47/47).

Closes #544
@gkhngyk

gkhngyk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Thanks — this is a solid implementation and CI is green. #545 was opened first for the same issue, so we've asked its author to address review findings and given them a ~3-day window, per first-come courtesy. If #545 isn't updated in that window, we'll merge this one. We'll keep you posted either way.

@Maqbool61

Copy link
Copy Markdown
Contributor Author

Thanks — this is a solid implementation and CI is green. #545 was opened first for the same issue, so we've asked its author to address review findings and given them a ~3-day window, per first-come courtesy. If #545 isn't updated in that window, we'll merge this one. We'll keep you posted either way.

Thanks for the context and the fair process — I appreciate it.

Just to note: I was assigned to #544, and #545 didn't reference the issue anywhere (no Closes #544, no mention in the description), so it didn't appear on the issue page. That's what made this a duplicate without either of us realising it.

Happy to wait out the 3-day window. If there's any review feedback on #546 in the meantime I'm glad to address it.

@Maqbool61 Maqbool61 closed this Jul 30, 2026
@Maqbool61 Maqbool61 reopened this Jul 31, 2026
@Maqbool61

Copy link
Copy Markdown
Contributor Author

@gkhngyk Any Update?

@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 for the clean implementation — using the shared TablePager in both views and deleting the bespoke pager entirely is exactly the right shape for #544. Verified it merges cleanly with current main and all checks pass on the combined tree. 🙌

@gkhngyk
gkhngyk merged commit e7df867 into ansvisor:main Aug 1, 2026
7 checks passed
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