Skip to content

fix(editions): move redirect to beforeLoad#130

Merged
chiptus merged 1 commit into
mainfrom
fix/edition-selection-beforeload-redirect
Jul 10, 2026
Merged

fix(editions): move redirect to beforeLoad#130
chiptus merged 1 commit into
mainfrom
fix/edition-selection-beforeload-redirect

Conversation

@chiptus

@chiptus chiptus commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Moves the single-edition auto-redirect from a useEffect in EditionSelection into the route's beforeLoad, so it never flashes before redirecting.
Festivals with exactly one edition now redirect with no visible "Redirecting..." state.

Verification

  • Visit a festival with exactly one edition; it redirects straight to that edition with no "Redirecting..." flash.
  • Visit a festival with zero editions; the "No Editions Available" card still renders.
  • Visit a festival with two or more editions; the edition list still renders unchanged.

Closes #84


Generated by Claude Code

Redirects festivals with exactly one edition before EditionSelection
renders, eliminating the "Redirecting to current edition..." flash.

Closes #84
Copilot AI review requested due to automatic review settings July 10, 2026 10:45
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@vercel

vercel Bot commented Jul 10, 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, Comment Jul 10, 2026 10:46am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves the single-edition auto-redirect out of the EditionSelection React component and into the TanStack Router route beforeLoad, preventing the component from rendering (and briefly showing a “Redirecting…” state) when the redirect should occur.

Changes:

  • Added a beforeLoad hook on /festivals/$festivalSlug/ to prefetch the festival + editions and throw redirect(...) when exactly one edition exists.
  • Removed the useEffect-based navigation and the “Redirecting to current edition...” render branch from EditionSelection.
  • Cleaned up unused imports (useNavigate, useEffect) after removing the component-level redirect.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/routes/festivals/$festivalSlug/index.tsx Performs the single-edition redirect in beforeLoad after fetching festival + editions via the query client.
src/pages/EditionSelection.tsx Removes component-driven redirect logic so the page only renders list/empty/loading states.

@chiptus chiptus merged commit e8d7c30 into main Jul 10, 2026
11 checks passed
@chiptus chiptus deleted the fix/edition-selection-beforeload-redirect branch July 10, 2026 11:03
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.

Move EditionSelection single-edition auto-redirect to route beforeLoad

3 participants