Skip to content

feat(browser): polish embedded browser pane, sidebar parity, OSS auth gates#70

Merged
BunsDev merged 2 commits into
mainfrom
feat/browser-panel-polish
May 19, 2026
Merged

feat(browser): polish embedded browser pane, sidebar parity, OSS auth gates#70
BunsDev merged 2 commits into
mainfrom
feat/browser-panel-polish

Conversation

@BunsDev
Copy link
Copy Markdown
Member

@BunsDev BunsDev commented May 19, 2026

Summary

Closes the user-reported polish items on the embedded browser pane and aligns its toggle with the rest of the workspace chrome.

Browser pane

  • Default search engine is now Google (was DuckDuckGo) with a new user-level setting `general.default_search_engine` (Google / DuckDuckGo / Bing / Kagi / Brave), plumbed through the URL bar's resolver.
  • URL bar gets a `URL_BAR_MIN_WIDTH` so it never collapses to icon width in narrow splits.
  • Layout invariant documented for why the GPUI toolbar stays clickable above the native wry overlay (Flex column places the webview strictly below the toolbar, so hit-testing routes correctly).
  • Toggle-close bug fix. Under `FeatureFlag::UndoClosedPanes`, `PaneGroup::close_pane` detaches into a hidden-for-close shadow instead of destroying the pane — toggle was leaving the `wry::WebView` alive and the next toggle short-circuited on the "already hidden" early-return. `toggle_browser_pane` now filters lookups to visible panes, follows `close_pane` with `cleanup_closed_pane` on the close path, and proactively cleans up stale shadows on the open path. The tab-bar button's active state and `navigate_or_open_browser_pane` use the same filter so icon state matches reality. Cmd+W still uses the undo-friendly path.

Tab-bar parity

  • Tab-bar settings cog replaced with a Globe browser-pane toggle on non-wasm builds. Settings remain reachable via Cmd+, the app menu, and the command palette. Wasm keeps the cog because it has no embedded browser.
  • `workspace:toggle_left_panel` now defaults to Cmd+B / Ctrl+B, matching the convention used by the right-panel and browser-pane toggles.

Link handoff

  • New `WorkspaceAction::NavigateBrowserPane { url }`. Terminal-output URL clicks now load in the embedded pane (navigating an existing pane or opening one if none is visible). On wasm the handler falls back to `open_url`.
  • `BrowserView::navigate` promoted to `pub(crate)` so the workspace can drive it.

OSS auth gates

  • `root_view.rs` `requires_login` now also requires `ChannelState::cloud_services_available()`, so the public CastCodes OSS build never blocks agent/Cast Drive onboarding behind a Warp account.
  • Remote-control chip in the agent input footer skips the login gate on OSS builds — there are no hosted services to authenticate to.

Test plan

  • `./script/check_rebrand` — CastCodes rebrand guard passes.
  • `cargo check -p warp-app --lib` — clean.
  • `cargo check -p warp-app --bin cast-codes --features gui` — clean.
  • `cargo test -p warp-app --lib browser::url_input::` — 9 passing (default-Google behavior, per-engine selection, all-prefixes-distinct invariant).
  • All commits signed (ED25519); verified `git log main..HEAD --pretty='%H %G?'` reports `G` on every commit.
  • Manual: open browser pane (Cmd+Alt+B), type a query, confirm it routes to Google by default and to the chosen engine after changing the setting.
  • Manual: toggle browser pane closed via the tab-bar Globe / Cmd+Alt+B and confirm the wry webview is fully gone (no orphaned overlay, next toggle opens a fresh pane).
  • Manual: click a URL in terminal output with the browser pane open and confirm the pane navigates to it instead of the system browser opening.
  • Manual: on the public `cast-codes` binary, start agent / remote-control flows without logging in and confirm no login gate is hit.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 19, 2026 02:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR polishes the embedded browser-pane UX and aligns workspace chrome behavior by fixing toggle-close lifecycle issues (especially under UndoClosedPanes), adding a configurable default search engine for the URL bar, routing terminal URL clicks into the embedded browser, and relaxing login gating for OSS builds where cloud services aren’t available.

Changes:

  • Fix browser pane toggle-close behavior by ignoring hidden-for-close panes and force-cleaning up stale shadows; add NavigateBrowserPane { url } for internal link handoff.
  • Add general.default_search_engine (default Google) and plumb it through URL resolution; introduce a URL bar minimum width and document toolbar/webview layout invariant.
  • Update tab-bar controls (Globe toggle on native, settings cog on wasm) and adjust left-panel default keybinding to Cmd/Ctrl+B; update OSS login gating for onboarding and remote-control chip.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/workspace/view.rs Fixes browser pane toggle lifecycle; adds navigate-or-open action handler; updates tab-bar button rendering (Globe vs settings)
app/src/workspace/util.rs Adds mouse state handle for the new browser toggle icon (native) and gates settings icon to wasm
app/src/workspace/mod.rs Adds default keybindings for toggling the left panel (Cmd/Ctrl+B)
app/src/workspace/action.rs Introduces WorkspaceAction::NavigateBrowserPane and excludes it from app-state persistence
app/src/terminal/view.rs Routes URL link clicks to the workspace’s embedded browser instead of the system browser
app/src/terminal/general_settings.rs Adds general.default_search_engine setting backed by SearchEngine
app/src/root_view.rs Skips login gating in OSS builds by also requiring cloud_services_available()
app/src/browser/url_input.rs Adds SearchEngine enum and resolver that uses the selected engine; expands tests
app/src/browser/browser_view.rs Uses selected default search engine; adds URL bar min width; exposes navigate to workspace
app/src/ai/blocklist/agent_view/agent_input_footer/mod.rs Skips remote-control login gate on OSS builds via cloud_services_available()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/workspace/view.rs
Comment on lines +18350 to +18353
// Browser-pane toggle replaces the standalone settings cog so the
// toggle is always reachable next to the left/right panel toggles,
// mirroring those affordances. Settings remain accessible via
// Cmd+, , the app menu, and the command palette.
Comment thread app/src/workspace/mod.rs
.with_custom_action(CustomAction::ToggleWarpDrive),
.with_custom_action(CustomAction::ToggleWarpDrive)
.with_mac_key_binding("cmd-b")
.with_linux_or_windows_key_binding("ctrl-b"),
BunsDev and others added 2 commits May 18, 2026 22:15
… gates

Browser pane:
- Default search engine is now Google (was DuckDuckGo); add user-level
  `general.default_search_engine` setting with variants Google /
  DuckDuckGo / Bing / Kagi / Brave, plumbed through the URL bar's
  resolver.
- Give the URL bar a `URL_BAR_MIN_WIDTH` so it never collapses to icon
  width in narrow split layouts.
- Document the toolbar-vs-webview layout invariant that keeps GPUI
  toolbar buttons clickable above the native wry overlay.

Sidebar / tab-bar parity:
- Replace the tab-bar settings cog with a browser-pane toggle (Globe
  icon) on non-wasm builds; settings remain accessible via Cmd+,, the
  app menu, and the command palette. Wasm keeps the cog because it has
  no embedded browser.
- Give `workspace:toggle_left_panel` a default `Cmd+B` (Mac) /
  `Ctrl+B` (Linux/Windows) keybinding, matching the convention used by
  the right panel and browser pane toggles.

Link handoff:
- Terminal-output URL clicks now dispatch a new
  `WorkspaceAction::NavigateBrowserPane { url }`. If a browser pane is
  open in the active pane group, the click navigates its active tab;
  otherwise a new pane is opened pointed at the URL. Wasm falls back
  to the platform's external URL handler.
- `BrowserView::navigate` is promoted to `pub(crate)` so the workspace
  can populate the open pane.

OSS auth gates:
- `root_view.rs` `requires_login` check now also requires
  `cloud_services_available()`, so the public OSS build never blocks
  agent or Cast Drive onboarding behind a Warp account.
- Remote-control chip in the agent input footer skips the login gate
  on OSS builds for the same reason — there are no hosted services to
  authenticate to.

Tests:
- `url_input.rs` covers default-Google behavior, per-engine selection,
  and that all engine variants ship distinct URL prefixes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…hadow)

`PaneGroup::close_pane` under `FeatureFlag::UndoClosedPanes` does not
destroy the pane — it detaches into a hidden-for-close shadow so Cmd+Z
can restore it. `toggle_browser_pane` was calling only `close_pane`,
which left two latent bugs:

1. The wry::WebView outlived the visible "close": memory and a
   detached native overlay stayed around until the tab itself closed.
2. `pane_ids().find(is_browser_pane)` kept reporting the hidden
   shadow as an existing pane, so the next toggle short-circuited on
   the early-return in `close_pane` for already-hidden panes — toggle
   appeared to do nothing.

`toggle_browser_pane` now:
- filters the lookup to visible (not hidden-for-close) panes,
- on the close path, follows `close_pane` with `cleanup_closed_pane`
  to drop the wry::WebView for real,
- on the open path, proactively cleans up any stale hidden shadow
  before opening a fresh pane.

The tab-bar browser-toggle button and `navigate_or_open_browser_pane`
use the same visibility filter so the icon's active state and link
handoff agree with what the user actually sees. Cmd+W still goes
through the undo-friendly path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@BunsDev BunsDev force-pushed the feat/browser-panel-polish branch from afe96a5 to 3c4efdd Compare May 19, 2026 03:17
@BunsDev BunsDev merged commit aaf47f2 into main May 19, 2026
8 checks passed
@BunsDev BunsDev deleted the feat/browser-panel-polish branch May 19, 2026 03:18
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