Skip to content

Inject route-change script for Live Preview path sync @W-21574818@#34

Merged
deepu-mungamuri94 merged 2 commits intomainfrom
feat/webapp-title-bar-ui-preview
Mar 17, 2026
Merged

Inject route-change script for Live Preview path sync @W-21574818@#34
deepu-mungamuri94 merged 2 commits intomainfrom
feat/webapp-title-bar-ui-preview

Conversation

@deepu-mungamuri94
Copy link
Copy Markdown
Collaborator

What does this PR do?

Keeps the Live Preview path input in sync when users navigate inside the webapp (e.g., clicking "Go to Home" or other in-app links).

What this change does

  • Injects a route-change script into HTML responses served by the proxy (wrapResponseForRouteInjection() in ProxyServer.ts).
  • The script listens for route changes via:
    • history.pushState / replaceState
    • popstate
    • Navigation API
  • When the route changes, it sends a routeChanged message to the parent (Live Preview webview), which updates the path input accordingly.

Without this change

  • The path input in the Live Preview toolbar stays stale after in-app navigation.
  • Users clicking links like "Go to Home" would see the path remain at / instead of updating to /home.

What issues does this PR fix or reference?

@W-21574818@

@deepu-mungamuri94 deepu-mungamuri94 merged commit fbc4da7 into main Mar 17, 2026
15 checks passed
@deepu-mungamuri94 deepu-mungamuri94 deleted the feat/webapp-title-bar-ui-preview branch March 17, 2026 09:01
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.

2 participants