Skip to content

[Design Exploration] Full browser preview tabs - #4753

Draft
shaunandrews wants to merge 47 commits into
explore-combined-site-preview-toolbar-v2from
explore-browser-preview-tabs
Draft

[Design Exploration] Full browser preview tabs#4753
shaunandrews wants to merge 47 commits into
explore-combined-site-preview-toolbar-v2from
explore-browser-preview-tabs

Conversation

@shaunandrews

@shaunandrews shaunandrews commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

AI assisted with iterative implementation, code cleanup, and regression coverage. Shaun directed the interaction and visual design through hands-on review of the running Studio preview, including tab behavior, persistence, focus treatment, toolbar integration, responsive states, and light/dark appearance. The final branch was reviewed as a complete diff before publication.

Proposed Changes

Explore a full browser-style tab experience above the preview toolbar. Users can keep the front end, WordPress admin, phpMyAdmin, and multiple individual pages open at once instead of repeatedly replacing one preview surface.

  • Add any number of tabs from Front-end, WordPress, or Database starting points.
  • Give every tab its own URL, navigation history, page title, and warm preview surface.
  • Restore open tabs, their order, the active tab, and navigation history per site across refreshes and sessions.
  • Support reactive drag-and-drop reordering and browser-style keyboard tab cycling.
  • Open same-site links in a new preview tab with Command-click on macOS or Control-click on Windows and Linux; external links keep their existing browser behavior.
  • Keep the URL field useful with the three primary destinations plus deduplicated, per-site recent addresses.
  • Make the URL suggestions fully keyboard-operable: Up/Down move through options, Escape closes and returns focus, Tab can leave the non-modal popup, and recent entries can be removed individually.
  • Preserve browser conventions around back/forward history menus, reload, full preview, focus rings, and close controls.
  • Keep inactive-tab close controls quiet until hover or keyboard focus while leaving the selected tab's close control visible.
  • Show the overflow fade whenever the tab strip actually scrolls, without covering the tab-bar divider or tab focus treatment.
  • Align the New tab and full-preview controls on the same visual center line while leaving full preview anchored at the far edge.
  • Preserve the macOS window drag region while the address menu is closed, then temporarily hand empty tab-bar space to menu dismissal while it is open.
  • Hide empty browser chrome for stopped sites and disable preview-only controls on Database tabs with an explanatory tooltip.
  • Adapt the tab bar for light and dark themes, narrow widths, and macOS traffic-light placement in full preview.

This is intentionally a design exploration for comparing a full tab model against the simpler browser-toolbar direction in #4746. It is not a merge-ready proposal.

Stacked exploration: this PR targets explore-combined-site-preview-toolbar-v2, an integration branch combining the site-header exploration in #4400 and browser-toolbar exploration in #4746. The integration base now carries the latest adaptive header and final address-bar treatment, keeping this review focused on the tab-specific delta.

Current screenshots

The set below emphasizes the selected-tab connection to the toolbar, wide and overflow behavior, clipped-label fades, the current URL menu, and light/dark contrast.

Wide · light Wide · dark
Wide light browser tabs Wide dark browser tabs
Overflow · light Overflow · dark
Narrow light browser tabs with overflow fades Narrow dark browser tabs with overflow fades
URL menu · light URL menu · dark
Light URL suggestions with removable recents Dark URL suggestions with removable recents

Review guide

Please focus on:

  • Whether full tabs solve multi-surface navigation clearly enough to justify the added browser complexity.
  • Whether per-tab history and persistence match user expectations.
  • Whether the active tab reads as connected to the toolbar while inactive tabs remain discoverable.
  • Whether overflow fades, hover-only inactive close controls, and the fixed tab actions make crowded tab strips easier to scan.
  • Keyboard and focus behavior across the tab strip, toolbar, URL field, and embedded preview—including platform-standard modifier-click links opening in a new preview tab.
  • The usefulness of the three default destinations and per-site recent addresses.
  • Narrow-window behavior and macOS full-preview chrome.

The Electron IPC plumbing for traffic-light positioning and navigation-history restoration is mechanical support for those behaviors and can be skimmed after validating its input bounds and ownership checks.

Known tradeoffs and follow-ups

  • Tab and recent-address state currently lives in local storage, keyed by site.
  • Restored Electron navigation history is capped at 100 validated HTTP(S) entries.
  • This deliberately increases preview complexity compared with [Design Exploration] Browser-style preview toolbar #4746; the goal is to evaluate whether the additional power earns that cost.
  • The stacked base is for design comparison only. Any mergeable implementation would need to be rebuilt on the chosen direction and current trunk.

Testing Instructions

  1. Launch the Agentic UI in Studio and start a local site.
  2. Add Front-end, WordPress, and Database tabs, then add multiple pages from the same realm.
  3. Navigate independently in each tab and confirm switching tabs preserves its URL, page, and back/forward history.
  4. Command-click a same-site link on macOS, or Control-click it on Windows/Linux, and confirm it opens in a new active preview tab without moving the original tab. Confirm external links retain their existing external-browser behavior.
  5. Drag tabs across one another and confirm the remaining tabs reactively reorder.
  6. Refresh or relaunch Studio and confirm the site's tabs, order, active tab, and history return.
  7. Focus a tab, its close button, the URL field, and toolbar controls. Confirm focus rings match their shapes and browser keyboard shortcuts remain active.
  8. Hover inactive tabs and confirm their close controls appear; confirm the selected tab's close control remains visible without hover.
  9. Overflow the tab strip at several widths. Confirm the fade appears whenever scrolling is possible, stays clear of the divider and focus ring, and supports wheel scrolling.
  10. Focus the URL field. Confirm Front-end, WordPress, and Database always appear; use Up/Down to navigate, Escape to close, and Tab/Shift+Tab to leave the popup. Submit new paths, confirm they appear under Recent only for that site, and remove one with its close button.
  11. With the URL menu closed, drag the window from empty tab-bar space. Reopen the menu and confirm clicking that same empty space dismisses it; after dismissal, confirm the region drags the window again.
  12. Open a Database tab and confirm Fit and Annotate are disabled with explanatory tooltips.
  13. Stop the site and confirm the empty tab bar and toolbar disappear.
  14. Enter full preview on macOS and confirm the traffic lights align with the tab bar.
  15. Repeat the visual checks in light and dark color schemes and at narrow widths.

Automated verification completed:

  • npx eslint --fix on the modified TypeScript/TSX files
  • npm test -- apps/ui/src/components/site-toolbar/index.test.tsx apps/ui/src/components/site-preview/address-bar.test.tsx apps/ui/src/components/site-preview/index.test.tsx apps/ui/src/components/site-preview/inspector-script.test.ts (94 tests)
  • npm run typecheck
  • npm run cli:build:ui

Pre-merge Checklist

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

wojtekn added a commit that referenced this pull request Sep 11, 2026
## Related issues

- None — design exploration.
- Compare the permanent site-header exploration in #4400 and the full
browser-tab exploration in #4753, which extends this toolbar with
independent tab/history state and platform-standard modifier-click
navigation.

## How AI was used in this PR

AI assisted with iterative implementation, refactoring, and test
updates. Shaun directed the interaction and visual design through
hands-on review of the running Studio preview, including toolbar
spacing, responsive behavior, control states, icon treatment, and
dark-mode corrections.

## Proposed Changes

- Explore a conventional browser-style preview toolbar that replaces the
realm tab selector with a filled URL field and familiar navigation
controls.
- Give the URL field a deliberate browser-address treatment: 32px tall,
comfortably padded, strongly rounded, filled rather than bordered, and
theme-aware in light and dark mode.
- Keep Front-end, WordPress admin, and Database available from the
address menu, then add deduplicated per-site recent addresses as the
user navigates.
- Make navigation more useful with browser-like back, forward, and
refresh controls, including right-click history menus for jumping
between visited pages.
- Keep preview tools understandable at a glance: Annotate uses a
bordered secondary treatment, while Responsive always keeps its current
mode visible and uses a checkmark to identify the selected menu item.
- Move the Open in action to the chat header, where its split button
stays visually quiet at rest and preserves external destinations without
crowding the browser toolbar.
- Preserve compact behavior, truncation, theme-aware colors, and legible
controls across narrow layouts and light/dark appearances.
- Hide empty browser chrome while a site is stopped, remove obsolete
realm-number shortcuts, and disable preview-only controls on Database
with explanatory tooltips.

This is intentionally a design exploration. The interaction model and
visual treatment are presented for feedback rather than as a final
approved direction.

## Current screenshots

The set below covers the address menu and recents, compact toolbar
behavior, dark mode, and the disabled Database state.

| Wide · light · address menu | Narrow · light · toolbar |
|---|---|
| ![Wide light browser toolbar with address
menu](https://github.com/Automattic/studio/blob/7c1c118e301db04605e88671e9fa64a316599e89/full-preview-light-address-menu.png?raw=true)
| ![Narrow light browser
toolbar](https://github.com/Automattic/studio/blob/7c1c118e301db04605e88671e9fa64a316599e89/narrow-light-toolbar.png?raw=true)
|

| Wide · dark · address menu | Narrow · light · Database state |
|---|---|
| ![Wide dark browser toolbar with address
menu](https://github.com/Automattic/studio/blob/7c1c118e301db04605e88671e9fa64a316599e89/full-preview-dark-address-menu.png?raw=true)
| ![Narrow Database toolbar with preview controls
disabled](https://github.com/Automattic/studio/blob/7c1c118e301db04605e88671e9fa64a316599e89/narrow-light-database.png?raw=true)
|

![Full preview toolbar in dark
mode](https://github.com/Automattic/studio/blob/7c1c118e301db04605e88671e9fa64a316599e89/full-preview-dark.png?raw=true)

## Testing Instructions

1. Launch the Agentic UI in Studio and open a running local site with
the preview visible.
2. Confirm the toolbar presents back, forward, refresh, the 32px filled
URL field, Responsive, and Annotate.
3. Confirm the URL field has no resting border, retains a clear focus
treatment, and remains legible in light and dark mode.
4. Focus the URL field and use Front-end, WordPress, and Database;
verify the menu closes after selection.
5. Submit new paths, reopen the address menu, and confirm deduplicated
recent addresses appear only for that site.
6. Navigate through several pages, then right-click Back and Forward;
verify each history menu opens below its button and can jump to an
entry.
7. Open the Responsive dropdown and try Responsive, Mobile, Tablet,
Desktop, and Desktop + Mobile. Confirm the trigger label updates and
only the selected row has a checkmark.
8. Open a Database destination and confirm Responsive and Annotate are
disabled with explanatory tooltips.
9. Stop the site and confirm the empty browser toolbar is hidden.
10. Confirm Open in appears at the top-right of the chat panel, repeats
the current default destination, has no border or fill at rest, and
remains legible as chat content scrolls behind it.
11. Narrow the preview and confirm Responsive keeps its visible label
while Annotate can collapse to its icon.
12. Repeat the visual checks in both light and dark color schemes.

Automated verification completed for the latest update:

- `npm test -- apps/ui/src/components/site-preview/address-bar.test.tsx
apps/ui/src/components/site-preview/index.test.tsx
apps/ui/src/components/site-preview/inspector-script.test.ts` (65 tests)
- `npm run typecheck -w @studio/ui`
- `npm run cli:build:ui` on the combined exploration branch

## Pre-merge Checklist

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

---------

Co-authored-by: Wojtek Naruniec <wojtek@naruniec.me>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant