Skip to content

Remember Agentic UI preview path per site when switching sites - #4281

Merged
sejas merged 4 commits into
trunkfrom
stu-1971-in-app-browser-preview-may-keep-url-path-when-switching
Jul 23, 2026
Merged

Remember Agentic UI preview path per site when switching sites#4281
sejas merged 4 commits into
trunkfrom
stu-1971-in-app-browser-preview-may-keep-url-path-when-switching

Conversation

@sejas

@sejas sejas commented Jul 21, 2026

Copy link
Copy Markdown
Member

Related issues

The in-app browser preview kept the current URL path when switching sites: viewing /about on one site and then opening a different site loaded that site's /about instead of its home page — confusing, and a 404 when the path doesn't exist on the new site.

How AI was used in this PR

AI assisted with the implementation and tests; the change was reviewed and verified manually.

Proposed Changes

  • The preview now remembers the last visited path per site. Switching to a site you haven't previewed opens its home page; switching back to a site restores where you left off (e.g. site A on /about, site B on /blog, and returning to A shows /about again). The old site's path never leaks onto the new site.
  • Path memory is in-memory only — it resets when the app restarts.

Testing Instructions

  • Run npm start enable the Agentic UI
  • Open a session for site A and navigate the preview to a subpage, e.g. /about.
  • Switch to a session on site B: the preview opens site B at its home page, not the carried-over path.
  • Navigate site B to another page, then switch back to site A: the preview restores site A's last path. Return to site B and confirm its path is restored too.

Before

preview-path-before.mp4

After

preview-path-after.mp4

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@sejas sejas self-assigned this Jul 21, 2026
@sejas sejas changed the title Reset Agentic UI preview path when switching sites Jul 23, 2026
@sejas
sejas marked this pull request as ready for review July 23, 2026 10:14
@sejas
sejas requested review from bcotrim and nightnei July 23, 2026 10:17
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 9f7f5e8 vs trunk

app-size

Metric trunk 9f7f5e8 Diff Change
App Size (Mac) 1362.04 MB 1362.04 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 9f7f5e8 Diff Change
load 1078 ms 1053 ms 25 ms ⚪ 0.0%

site-startup

Metric trunk 9f7f5e8 Diff Change
siteCreation 7012 ms 7010 ms 2 ms ⚪ 0.0%
siteStartup 2356 ms 2349 ms 7 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a very nice improvement, thanks!
I found an issue: if you navigate away from a site while it is starting it can change the preview of another site

Screen.Recording.2026-07-23.at.13.56.44.mov

@nightnei nightnei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great improvement, works perfectly 👍

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can no longer replicate the issue I flagged.
There was an error with some of my local worktrees that also probably caught this test.

Approved 👍

@sejas
sejas enabled auto-merge (squash) July 23, 2026 22:45
@sejas
sejas merged commit 16f21b8 into trunk Jul 23, 2026
13 checks passed
@sejas
sejas deleted the stu-1971-in-app-browser-preview-may-keep-url-path-when-switching branch July 23, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants