Skip to content

Agentic UI: Add a segmented address bar to the site preview - #4366

Merged
bcotrim merged 5 commits into
trunkfrom
stu-2012-add-site-preview-toolbar-tabs
Jul 30, 2026
Merged

Agentic UI: Add a segmented address bar to the site preview#4366
bcotrim merged 5 commits into
trunkfrom
stu-2012-add-site-preview-toolbar-tabs

Conversation

@bcotrim

@bcotrim bcotrim commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Ported from the explore-site-centric-conversation-chrome reference branch with Claude Code, trimmed to this PR's scope. Code reviewed and manually QA'd by me.

Proposed Changes

  • The toolbar's title readout becomes a segmented address bar: the site and WordPress (wp-admin), switched with one click or ⌘1/⌘2. Each realm remembers where you left off, and wp-admin routes through auto-login so the preview never shows a login form.
  • Optional Database segment (phpMyAdmin, ⌘3) behind a default-off preference; its toggle UI lands with the view-settings piece.
  • Fixes a guard that blocked navigating back to the preview's starting page.
Site WP Admin Database
image image image
image image image

Testing Instructions

Agentic UI + a running site.

  1. Click WordPress (⌘2) → wp-admin with no login form. Browse somewhere, click the site segment (⌘1) → you return to the exact page you left. Shortcuts also work with focus inside the page.
  2. localStorage.setItem( 'studio:preview-show-database-tab', 'true' ) in devtools → Database segment + ⌘3 appear.
  3. Narrow the preview below ~680px → the active segment collapses to icon-only.
  4. Verify light + dark. Regressions: refresh/back/forward, Annotate, "Open site in browser", stopped-site Start screen.

Pre-merge Checklist

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

🤖 Generated with Claude Code

@bcotrim bcotrim changed the title Agentic UI: Add a segmented address bar with omnibox to the site preview Agentic UI: Add a segmented address bar to the site preview Jul 28, 2026
@bcotrim
bcotrim marked this pull request as ready for review July 28, 2026 12:31
@bcotrim
bcotrim requested review from nightnei and sejas July 28, 2026 12:31
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 28cd63e vs trunk

app-size

Metric trunk 28cd63e Diff Change
App Size (Mac) 1375.36 MB 1375.37 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 28cd63e Diff Change
load 1027 ms 1090 ms +63 ms 🔴 6.1%

site-startup

Metric trunk 28cd63e Diff Change
siteCreation 6485 ms 6511 ms +26 ms ⚪ 0.0%
siteStartup 2397 ms 2379 ms 18 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

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

Everything works as expected 👍
Screenshot 2026-07-30 at 12 58 43
Screenshot 2026-07-30 at 12 58 53

@bcotrim
bcotrim merged commit a20f7b6 into trunk Jul 30, 2026
13 checks passed
@bcotrim
bcotrim deleted the stu-2012-add-site-preview-toolbar-tabs branch July 30, 2026 12:35
bcotrim added a commit that referenced this pull request Aug 4, 2026
## Related issues

- Fixes STU-2086

## 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 |
|--------|--------|
| <img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/f4cdf989-33ec-4bf5-95fe-8aea44dbb000"
/> | <img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/4f9273bc-2aa4-458f-ab07-3dbd478f9004"
/> |
| <img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/9ee2d477-5b3e-4946-8b26-65fbe558da1e"
/> | <img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/a068a9d2-ab38-4749-a42d-f322341bb794"
/> |

## 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

- [x] Have you checked for TypeScript, React or other console errors?

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Antonio Sejas <antonio.sejas@automattic.com>
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