Skip to content

Conversation

@samuv
Copy link
Collaborator

@samuv samuv commented Nov 1, 2025

MemoryHistorydoesn’t provide popStateEvent or pushStateEvent. This is blocking me to put useBlocker
We also lose browser-native behaviors (e.g., preserving the current page on reload).

There’s no clear technical justification for memory history in our case, we only can redirect to group default on index that should only happen on startup

Also Adds defaultViewTransition: true to enable view transitions by default

@samuv samuv self-assigned this Nov 1, 2025
Copilot AI review requested due to automatic review settings November 1, 2025 11:07
Copy link
Contributor

Copilot AI left a comment

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 refactors the router initialization to move away from createMemoryHistory and instead handles initial navigation through a route subscription. The router now uses browser history by default and redirects to /group/default when the root path is accessed on initial load.

Key changes:

  • Removes createMemoryHistory from imports and router configuration
  • Adds defaultViewTransition: true to enable view transitions
  • Implements a redirect mechanism using router.subscribe('onLoad') to handle root path navigation
Comments suppressed due to low confidence (1)

renderer/src/renderer.tsx:101

  • Analytics tracking will not be called for the initial redirect to /group/default because the function returns early at line 93. This means the first page view after the redirect won't be tracked. Consider calling trackPageView before the early return or restructuring the logic to ensure all navigations are tracked.
  trackPageView(data.toLocation.pathname, {
    'route.from': data.fromLocation?.pathname ?? '/',
    'route.pathname': data.toLocation.pathname,
    'route.search': JSON.stringify(data.toLocation.search),
    'route.hash': data.toLocation.hash,
  })

@samuv samuv merged commit ebaa890 into main Nov 3, 2025
17 checks passed
@samuv samuv deleted the back-to-browser-history branch November 3, 2025 09:16
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.

3 participants