Skip to content

Conversation

@richard-to
Copy link
Collaborator

Previously, when me.navigate() was called during initial page load
(e.g., in an on_load handler), the URL would change in the browser
but the target page would not actually render. This was because the
navigate command was sent to the client, but the server immediately
ended the response stream without actually loading the target page.

This fix adds logic to check for navigate commands after the initial
page load and on_load handler execution. If a navigate command is
present, it is processed the same way as during event handling:

  • External URLs are handled by sending the command to the client
  • Internal URLs trigger server-side navigation to load and render
    the target page, including running its on_load handler if present

This enables common authentication redirect patterns where
unauthenticated users are automatically redirected to a login page.

Also includes a test file demonstrating the fix.

claude and others added 2 commits December 16, 2025 22:12
Previously, when me.navigate() was called during initial page load
(e.g., in an on_load handler), the URL would change in the browser
but the target page would not actually render. This was because the
navigate command was sent to the client, but the server immediately
ended the response stream without actually loading the target page.

This fix adds logic to check for navigate commands after the initial
page load and on_load handler execution. If a navigate command is
present, it is processed the same way as during event handling:
- External URLs are handled by sending the command to the client
- Internal URLs trigger server-side navigation to load and render
  the target page, including running its on_load handler if present

This enables common authentication redirect patterns where
unauthenticated users are automatically redirected to a login page.

Also includes a test file demonstrating the fix.
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