Skip to content

Fix pagination on all pages#227

Merged
oskarszoon merged 6 commits into
bsv-blockchain:mainfrom
oskarszoon:bugfix/pagination
Nov 27, 2025
Merged

Fix pagination on all pages#227
oskarszoon merged 6 commits into
bsv-blockchain:mainfrom
oskarszoon:bugfix/pagination

Conversation

@oskarszoon

Copy link
Copy Markdown
Contributor

Fixes #81

@github-actions

github-actions Bot commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Status: Complete


Analysis:

This PR refactors pagination logic to fix issue #81 where pagination controls sometimes disappear. The changes move from event-based total page calculation to reactive computed values.

Key improvements:

  • Removes on:total event handler pattern, calculating totalPages directly via reactive statements
  • Adds URL-based pagination state management in blocks-table-card for shareable URLs
  • Simplifies pagination logic by removing dependency on event dispatch for total pages

Observations:

  1. Potential reactive loop in blocks-table-card: The reactive block at lines 38-58 reads from URL params and updates local page/pageSize variables. The onPage handler calls updateURL which uses goto() to update the URL. This creates a cycle: URL change → reactive block updates variables → triggers reactive statement at line 135 → calls fetchData. In practice, goto with replaceState:true should prevent re-triggering, but edge cases may exist.

  2. Unused event dispatch: The Pager component still dispatches the total event (line 57 in index.svelte) even though no components listen to it anymore. Harmless but creates maintenance confusion.

Recommendation:

Test blocks-table-card thoroughly for:

  • Rapid page changes
  • Browser back/forward navigation
  • Direct URL manipulation
  • Initial page load with URL parameters

The refactoring simplifies the code overall and should fix the disappearing pagination controls issue.

@oskarszoon oskarszoon merged commit 8cc02fb into bsv-blockchain:main Nov 27, 2025
8 checks passed
@oskarszoon oskarszoon deleted the bugfix/pagination branch December 3, 2025 09:30
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.

[BUG] Pagination and page limit buttons sometimes disappear

2 participants