You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #81