Skip to content

Agentic UI: Add the Open in… split button to the preview toolbar - #4365

Open
bcotrim wants to merge 48 commits into
trunkfrom
stu-2086-add-open-in-split-button
Open

Agentic UI: Add the Open in… split button to the preview toolbar#4365
bcotrim wants to merge 48 commits into
trunkfrom
stu-2086-add-open-in-split-button

Conversation

@bcotrim

@bcotrim bcotrim commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude Code ported open-in-menu/ from the Design Preview exploration (45fd6fb4c, #3975) and wrote the tests. I reviewed the diff and tested in the app.

Proposed Changes

The preview toolbar's external-link icon becomes an Open in… split button: the left half repeats the last destination (persisted), the chevron opens Browser, Finder/File Explorer, editor, terminal, phpMyAdmin. Browser opens the page currently shown in the preview, and is the only destination disabled while the site is stopped.

The control itself stays in the toolbar in every state, including stopped — unlike the button it replaces, which #4366 moved inside the canPreview guard — so files, editor and terminal are reachable without starting the site first.

Running Stopped
image image
image image

Testing Instructions

Needs agentic features enabled.

  1. Running site: try each destination from the chevron menu. The main half repeats the last one and persists across restarts.
  2. Navigate inside the preview, then click the main half on Browser — opens that page, not the site root.
  3. Stop the site: the control stays, Browser and is disabled, the rest still work.
  4. Check light + dark, and RTL.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

🤖 Generated with Claude Code

@bcotrim bcotrim changed the title Add the Open in… split button to the preview toolbar Agentic UI: Add the Open in… split button to the preview toolbar Jul 28, 2026
@bcotrim
bcotrim requested review from nightnei and sejas July 28, 2026 10:28
@wpmobilebot

wpmobilebot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 48d70a2 vs trunk

app-size

Metric trunk 48d70a2 Diff Change
App Size (Mac) 1402.79 MB 1373.09 MB 29.70 MB 🟢 -2.1%

site-editor

Metric trunk 48d70a2 Diff Change
load 1033 ms 1030 ms 3 ms ⚪ 0.0%

site-startup

Metric trunk 48d70a2 Diff Change
siteCreation 7530 ms 6540 ms 990 ms 🟢 -13.1%
siteStartup 2864 ms 2395 ms 469 ms 🟢 -16.4%

Results are median values from multiple test runs.

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

@bcotrim
bcotrim force-pushed the stu-2086-add-open-in-split-button branch from 8e72208 to 42381fd Compare July 28, 2026 11:20
@bcotrim
bcotrim changed the base branch from trunk to stu-2012-add-preview-omnibox July 28, 2026 11:20
@bcotrim
bcotrim force-pushed the stu-2086-add-open-in-split-button branch from 42381fd to 0d3b4d2 Compare July 28, 2026 16:22
@bcotrim
bcotrim changed the base branch from stu-2012-add-preview-omnibox to stu-2012-add-preview-site-search July 28, 2026 16:22
@bcotrim
bcotrim marked this pull request as draft July 28, 2026 16:48
bcotrim added 6 commits July 28, 2026 17:57
stu-2012-add-preview-site-search

# Conflicts:
#	apps/ui/src/components/site-preview/address-bar.test.tsx
#	apps/ui/src/components/site-preview/address-bar.tsx
#	apps/ui/src/components/site-preview/index.tsx
…-omnibox

# Conflicts:
#	apps/ui/src/components/site-preview/address-bar.module.css
#	apps/ui/src/components/site-preview/address-bar.test.tsx
#	apps/ui/src/components/site-preview/address-bar.tsx
#	apps/ui/src/components/site-preview/index.tsx
@bcotrim
bcotrim marked this pull request as ready for review July 31, 2026 12:25

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested the PR and it works as expected. A few inconsistencies I found:

The phpMyAdmin has a weird state in the main part of the preview button. And depending on the size of Studio window it shows only the sidebar, kind of the mobile version of phpMyAdmin (minute 0:27 of the video).

Image

I noticed that Open in Browser opens the current preview page, Frontend, wp-admin or phpMyAdmin. While the rest of buttons open the site in finder, IDE, terminal.
phpMyAdmin is a bit different because it doesn't open the site in any app, it just navigates there. I suggest removing this item from the dropdown and having it always available in the center part.

Open in browser wp-admin should append the magic path to auto-login with the redirect URL, currently users need to enter their credentials in the browser and the magic link is not used.

open-in.mp4

@bcotrim

bcotrim commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @sejas can you take another look, please?

@bcotrim
bcotrim requested a review from sejas August 3, 2026 16:43
@katinthehatsite

Copy link
Copy Markdown
Contributor

I noticed that Open in Browser opens the current preview page, Frontend, wp-admin or phpMyAdmin. While the rest of buttons open the site in finder, IDE, terminal.
phpMyAdmin is a bit different because it doesn't open the site in any app, it just navigates there. I suggest removing this item from the dropdown and having it always available in the center part.

I had the same thought while testing this. The options in the dropdown menu seemed mixed as some of them were related to the IDE and some of them to browser so it was a bit of a mixed bag. I have not tested the newest changes yet though

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work @bcotrim ! I confirm it works much better. Really exciting UI. I tested it with multiple sites.

open-new-window.mp4

This PR uses stu-2012-add-preview-site-search as its base.

Comment thread apps/ui/src/components/open-in-menu/index.tsx Outdated

@katinthehatsite katinthehatsite 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.

For me, the changes mostly worked well. One thing that was making me confused is the default icons, for example, when the site is stopped:

Image

For example, not every user might know what the default icon for the iTerm is.

Also, how do I, for example, choose Cursor. I have it installed, I see it in the classic UI but it is not present here?

Base automatically changed from stu-2012-add-preview-site-search to trunk August 3, 2026 18:16
@bcotrim

bcotrim commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

For me, the changes mostly worked well. One thing that was making me confused is the default icons

The default shows the latest used "open in..." option and displays a tooltip when hovered. What would you suggest to make it easier to understand?

image

Also, how do I, for example, choose Cursor. I have it installed, I see it in the classic UI but it is not present here?

The options should match your preferred editor/terminal from the settings:

image

bcotrim and others added 2 commits August 3, 2026 19:20
…-split-button

# Conflicts:
#	apps/ui/src/components/site-preview/address-bar.test.tsx
#	apps/ui/src/components/site-preview/address-bar.tsx
#	apps/ui/src/components/site-preview/index.tsx
Co-authored-by: Antonio Sejas <antonio.sejas@automattic.com>
@bcotrim
bcotrim requested a review from katinthehatsite August 4, 2026 08:40
@katinthehatsite

Copy link
Copy Markdown
Contributor

The default shows the latest used "open in..." option and displays a tooltip when hovered. What would you suggest to make it easier to understand?

Oh interesting, I am not sure why I am not seeing it with the most recent change 🤔

I did notice that when I select open in browser for one site, the selection persists for all sites. Should it be a per site preference?

Screen.Recording.2026-08-04.at.11.11.13.AM.mov

@katinthehatsite

Copy link
Copy Markdown
Contributor

As a sidenote, another observation that I am finding is that if you select the default opening in the browser and the site is started, we have the same icon twice which could be confusing for the user:

Screenshot 2026-08-04 at 11 12 59 AM

It is the same icon that opens the site in the built-in browser or in the external browser but I am not sure the user has an easy visual way to distinguish it or know it right away intuitively. What do you think?

@bcotrim

bcotrim commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for testing again @katinthehatsite

Added 3e71974 to address the icon issue, changing the browser icon to one that I think it makes it clear that it is an external app and not the preview panel. What do you think?

48d70a2 addressed another issue with a stale check for installed apps, maybe why you couldn't find Cursor earlier.

Please let me know if this looks good to merge now 🙇

@katinthehatsite

Copy link
Copy Markdown
Contributor

Please let me know if this looks good to merge now 🙇

Looking 👀

@katinthehatsite katinthehatsite 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 think this is in a good shape to go 🚢

Thanks for improving the icons, I think it looks much better without the repetitive icon 👍

Image

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.

4 participants