Skip to content

fix(frontend): render exact batches in relay list and reset paging on new matches - #577

Merged
JuliusHenke merged 1 commit into
masterfrom
fix/frontend-relay-list-paging
Oct 10, 2026
Merged

JuliusHenke merged 1 commit into
masterfrom
fix/frontend-relay-list-paging

Conversation

@JuliusHenke

Copy link
Copy Markdown
Member

Follow-up to #249 (resolved by d89dd7b in #569, which replaced react-infinite-scroller with an IntersectionObserver sentinel). Two small issues remained in RelayList; both existed before the library switch:

  • Off-by-one: each batch rendered 51 relays instead of 50 (slice(0, numberOfMatchesToDisplay + 1)).
  • No reset on new matches: the number of rendered relays was kept when relayMatches changed (e.g. after a search), so a new list rendered every previously loaded batch at once. The list now starts again with the first batch. It uses the same "synced state during render" pattern as ResponsiveRelayDetailsDialog and RelayDetailsDialogSmall. relayMatches is memoized upstream, so the reset only fires on a real change.

Tests

  • New RelayList.test.tsx (browser mode): the first render shows exactly 50 relays plus the loader; after loading all 120 and swapping in a new list, only 50 are shown again.
  • Both new tests fail on master (51 rows shown; 120 rows shown after the swap) and pass with this change.
  • yarn test:run (179 tests in 15 files), yarn lint and yarn build pass locally.

No dependency changes, so no SCA run or dependency vetting was needed.

🤖 Generated with Claude Code

https://claude.ai/code/session_012ddTD9i5zX7dGHoYf8sZSS


Generated by Claude Code

… new matches

- RelayList rendered one relay more than the batch size (slice end off by one).
- The number of rendered relays was kept when the matches changed, e.g. after
  a search, so a new list rendered every previously loaded batch at once. It now
  starts again with the first batch.
- Add RelayList browser tests for both cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ddTD9i5zX7dGHoYf8sZSS
@JuliusHenke JuliusHenke added bug Something isn't working frontend labels Oct 10, 2026 — with Claude
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 27bfadf):

https://tormap-36f44--pr577-fix-frontend-relay-l-5ae7l7mm.web.app

(expires Mon, 09 Nov 2026 22:58:03 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 0c1f71965de18e60b0e686b0d0356977fec090dc

@JuliusHenke
JuliusHenke merged commit 9aeb0cd into master Oct 10, 2026
13 checks passed
@JuliusHenke
JuliusHenke deleted the fix/frontend-relay-list-paging branch October 10, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants