Skip to content

fix(routing): keep scroll on search-param updates - #483

Merged
chiptus merged 2 commits into
mainfrom
claude/vote-screen-jump-bug-uundrv
Aug 31, 2026
Merged

fix(routing): keep scroll on search-param updates#483
chiptus merged 2 commits into
mainfrom
claude/vote-screen-jump-bug-uundrv

Conversation

@chiptus

@chiptus chiptus commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Adds resetScroll: false to search-param-only replace navigations (vote sort-lock, vote/timeline/admin filters) so they no longer scroll the window to top. Closes #386; the invite-flow site from that audit was already refactored into a real page navigation and needs no change.
Also guards the global router.invalidate() so Supabase's refocus auth events (same user) no longer re-run all route loaders — which could swap in the pending fallback and reset scroll on tab refocus.

Verification

  • Scroll down the sets list and vote on a set (first vote, unsorted-locked state); the list stays in place and the sort locks.
  • Scroll down the schedule list view and toggle a day/stage/vote filter chip; no jump to top.
  • In admin artists, scroll down and change sort/filter; no jump to top.
  • Click "clear filters" on the vote tab; page scrolls to top (intentional, unchanged).
  • While logged in, scroll down, switch to another tab and back; page stays in place. Sign out and back in; route data still refreshes.

Audit from #386: add resetScroll: false to search-param replace
navigations so filter/sort/vote-lock updates no longer scroll the
window to top. Covers useUrlState, useTimelineUrlState filter
updates, and the admin artists URL state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HWv7vC96Coh27Y4xjjeD4
Copilot AI lite review requested due to automatic review settings August 31, 2026 13:37
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
upline Ready Ready Preview Aug 31, 2026 5:57pm

Copilot AI 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.

🟢 Approval recommended

The changes are narrowly scoped, consistent with existing resetScroll: false usage in the codebase, and preserve intentional scroll-reset behavior on clear-filters actions.

Pull request overview

This PR addresses an app-wide UX issue where search-param-only replace navigations in TanStack Router reset the window scroll position to the top. It updates the relevant URL-state hooks so filter/sort/vote state changes no longer cause unintended scroll jumps, aligning with the fix pattern previously applied for timeline scroll sync.

Changes:

  • Add resetScroll: false to search-param-only replace navigations for admin artists filter/sort updates.
  • Add resetScroll: false to the generic sets-page URL-state update helper (used for vote sort-lock / filters).
  • Add resetScroll: false to timeline/list schedule filter updates (day/time/stages/votes/types).
File summaries
File Description
src/pages/admin/ArtistsManagement/hooks/useAdminArtistsUrlState.ts Prevents scroll-to-top on admin artists search-param updates by disabling scroll reset.
src/hooks/useUrlState.ts Prevents scroll-to-top on sets page search-param updates while preserving existing “clear filters” scroll behavior.
src/hooks/useTimelineUrlState.ts Prevents scroll-to-top on schedule timeline/list filter chip updates by disabling scroll reset.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Playwright test results

passed  65 passed

Details

stats  65 tests across 21 suites
duration  1 minute, 29 seconds
commit  cab2bb9

Copilot AI 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.

🟢 Approval recommended

The focused navigation options correctly address the reported behavior and follow the established fix.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Supabase fires auth events on every tab refocus (SIGNED_IN /
TOKEN_REFRESHED with the same user), and unconditionally calling
router.invalidate() re-runs all route loaders, which can swap in the
pending fallback and reset scroll to top.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HWv7vC96Coh27Y4xjjeD4

Copilot AI 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.

🟢 Approval recommended

The targeted navigation sites are covered and the auth guard preserves invalidation when user identity changes.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@chiptus
chiptus merged commit 3fc9ddd into main Aug 31, 2026
11 checks passed
@chiptus
chiptus deleted the claude/vote-screen-jump-bug-uundrv branch August 31, 2026 18:46
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.

Audit other search-param-only navigate() calls for latent scroll-to-top bug

3 participants