Skip to content

Conversation

@mitoperni
Copy link
Owner

@mitoperni mitoperni commented Feb 9, 2026

Description

Replace document.referrer with sessionStorage for back navigation from network detail pages. document.referrer is not updated during client-side (SPA) navigations in Next.js, causing the back button to always redirect to / instead of going back.

Type of Change

  • Bug fix

Changes Made

  • Store window.location.search in sessionStorage (previousPath) when navigating to a network detail page (from NetworkCard and MapboxMap)
  • Read and clear previousPath in StationsHeader.handleBack() to navigate back with preserved filter/search params
  • Falls back to / when no previousPath exists (direct URL access, bookmarks, external links)

Screenshots (if applicable)

N/A

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No TypeScript errors
  • All CI checks pass
  • Error handling in place

Related Issues

Closes #57


Open with Devin

@vercel
Copy link

vercel bot commented Feb 9, 2026

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

Project Deployment Actions Updated (UTC)
cyclemap Ready Ready Preview, Comment Feb 9, 2026 11:38pm

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@mitoperni mitoperni merged commit 4e1fd50 into main Feb 9, 2026
6 checks passed
@mitoperni mitoperni deleted the fix/back-navigation-spa branch February 10, 2026 08:09
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.

1 participant