Repository navigation
Conversation
The browser was reachable from exactly one place nobody could find: the "+" at the end of the file tab strip — which the strip did not even render while it had no tabs, so a person with an empty column had no way to open a page at all. This adds the four entrances that were missing, and one policy hook they all share. - The strip keeps its "+" with zero tabs instead of rendering nothing. - The empty file column offers "Browser tab" rather than only telling you to open a file from the right panel. - mod+shift+b opens a page where it can be seen; mod+L puts the caret in the address bar of the page already on screen (or opens one). - The ⌘K dialog offers a browser tab while empty, and — once what you typed reads as an address and not a search — opens it in the browser instead. `useBrowserSurface` answers "where does a page go from here" once, because the answer differs by route: on the conversations route a page is a tab of the file column, while a full-page route (the assistant) paints over that column and must use its transcript drawer. Every new entrance asks it.
"Send to chat" lived in the browser tab's own toolbar, which means it was reachable only from a tab that some other path had to open first — and it always went to the conversation in the top bar, so from the assistant page it went to the wrong place. Both boxes now offer the same hand-offs where the person already is: open a page, pick an element, take a screenshot, send what the page printed to the console. - One delivery path (`deliverPageHandoff`), shared with the tab toolbar, so a picked element reads the same wherever it was picked: same badge name, same redacted URL, same picture name, same "sent"/"gone"/"failed". - A hand-off now names its target composer (`targetTabId`). The assistant's box is named by its assistant rather than a conversation tab, so two boxes mounted at once no longer race for one page; an untargeted hand-off behaves exactly as before. - The assistant composer registers the listener at all, which it did not. - `useComposerBrowserHandoff` arms a pick through `useBrowserSurface`, so a pick from the assistant page runs against that page's drawer and ends on Escape, on unmount, and when the box goes away.
…er asks for `useBrowserSurface` reads the optional forms of the workspace route and the workspace actions so it can answer outside a workspace, and asks the backend what the browser can do. The chrome-controller suite mocks those modules wholesale, so the three new reads threw "No export is defined on the mock" and took all sixteen ⌘W tests down with them. Mocking the optional hooks as absent and the capabilities as unknown is the honest shape here: these tests are about ⌘W, and a page has nowhere to go in them.
The conversations list is empty while what was typed is an address, so the palette announced "No results found." directly above the row offering to open that very page. The empty state now steps aside when the browser row is going to appear. Next: prove it in the live app, and in a test that asserts absence.
…at/browser-everywhere-v052
…menu
Opening a page was three steps deep: +, a submenu whose trigger reads like a
noun ("Browser tab"), then "Open browser tab". People looking for the browser
found neither the noun nor the depth.
"Open browser tab" is a top-level row now, next to "Attach files" — one click,
same place in both composers. It is only drawn where a page would actually go
somewhere (placement is not null), so the row cannot be a silent no-op. The
submenu keeps what acts on a page that already exists: pick, screenshot,
console. The hand-off exposes placement for that, and the composer test now
opens the browser without touching the submenu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto v0.52.0, and supersedes #1429
This is #1429's work rebased onto
upstream/main(08ad3e96f, the 0.52.0release) — the merge was conflict-free — plus one change made after a day of
using the first build: the browser is one click from the composer. "Open
browser tab" is a top-level row in the
+menu of both composers now, not astep inside a submenu, and it is drawn only where a page would actually go
somewhere.
#1429's body and CI notes are kept below, unchanged. GitHub will not retarget an
open PR's head branch, so I'll close #1429 and point it here.
What this is
The built-in browser worked, but there was almost no way to get to it. Opening a page required either an agent to write a link and clicking it, or finding the
+at the end of the file tab strip — which the strip did not render at all while it had no tabs, so a person with an empty column had no route to a page whatsoever. Andsend to chat,pick an element,screenshot,console errorslived only in the browser tab's own toolbar, so they could only be reached from a page that some other path had already opened. From the assistant page they were unreachable entirely.This adds the entrances that were missing, and one policy hook they all share.
Where a page can be put — the part that is actually subtle
The answer differs by route, and getting it wrong opens a page where nobody can see it:
app/workspace/layout.tsx:594)SessionViewerHost)useBrowserSurface()answers this once, as a pure function (decideBrowserSurface), and reportsnullrather than guessing when a surface has nowhere to put a page. Every new entrance asks it, so the strip, the empty column, the palette, the shortcuts and the composers cannot drift into three different behaviours.Entrances added
+stays when the strip is empty. A blank strip renderednull, taking its own+with it. It now renders the trailing row with no tabs in it, so "open a file" and "open a browser tab" are reachable from the emptiest possible workspace.Browser tabinstead of only telling you to open a file from the right panel.mod+shift+bopens a page where it can be seen (returning to the conversations route first if another route is covering it).mod+Lputs the caret in the address bar of the page already on screen — bringing that page forward by its own URL first (the one-tab-per-URL rule activates it in place) — and opens a blank one when there is no page to focus. Both are new shortcut ids, so they appear in Settings → Shortcuts and are rebindable, like every other shortcut.normalizeTypedAddress, the address bar's own parser, solocalhost:3000andexample.comwork andauthkeeps searching conversations). It is listed last, so Enter still prefers a real conversation.Handing a page to the box you are typing in
Both composers — the chat one and the assistant's — gain a Browser section in the existing
+menu: open a page, pick an element, screenshot, console errors.deliverPageHandoffis exported frombrowser-page-handoff.tsxand used by both the tab toolbar and the composers, so a picked element reads the same wherever it was picked: same badge name, same redacted URL, same picture name, samesent/gone/failed.targetTabIdaddresses one composer; the assistant's box is addressed by its assistant (personalAgent:<uid>) because it is not a conversation tab. Two boxes mounted at once no longer race for one page, and an untargeted hand-off behaves exactly as it did before.+sayspickingwhile a pick is armed (a page covered in a highlight with no way out is the failure mode this avoids).Not changed
browser.rs, the picker, or the native surface.pick_element's 180s timeout and the isolated-world overlay are untouched.Browser.handoff.*andFolder.*;src/i18n/messages.test.tsstays at 22/22 with all ten locales in parity. Two new entries appear in the shortcut settings because the shortcut ids are new (ShortcutSettings.actions.open_browser_tab,.focus_address_bar).Verification
./node_modules/.bin/tsc --noEmit— clean.use-browser-surface.test.ts(6),browser-address-focus.test.ts(4),composer-browser-menu.test.tsx, plus additions tofile-workspace-tab-bar.test.tsx(a strip with no tabs keeps its+and opens a browser tab from it),search-command-dialog.test.tsx(an address becomes a page, a word does not, and the group hides when the browser cannot run),message-input.test.tsxandpersonal-agent/composer.test.tsx(a hand-off lands in the box it names and not in the other).src/components/browser,src/components/chat/composer,src/components/personal-agent,src/components/layout,src/components/files,src/hooks— 2,538 passing, 265 failing.upstream/mainfails on this branch. Measured by running that exact set twice — once on this branch, once in a cleanupstream/mainworktree sharing the samenode_modules— and diffing the failing test names: 250 failures onmain, 250 on this branch, the same 250 (the extra 53 passes are the new tests below). The failures are this machine's environment:window.localStorageisundefinedunder vitest's jsdom on Node 26, which breaks any suite that touches storage, and it is not behaviour this PR changes.bc6142453:workspace-chrome-controller.test.tsxmocks the workspace contexts wholesale, so the three optional reads the browser surface makes threw "No export is defined on the mock" and took all sixteen ⌘W tests with it. The suite now mocks them as absent (a page has nowhere to go in those tests) and is 16/16.372669a48— a typed address that does resolve was listed next to "No results found." The ⌘K dialog now hides the empty state while the address row is showing, and the test asserts its absence.Checked on a running binary, in the page
A locally built
--no-bundlebinary (frontend embedded,grep -c -a '/_next/static' codeg.exe→ 672), driven over CDP:+, both "New tab" routes reachablemod+shift+bEnter an addressmod+LactiveElement.placeholder === "Enter an address", text selected)example.com, Enterhttps://example.com/Open browser tablocalhost:3000/example.comBrowser tabrow forhttp://localhost:3000//https://example.com/, no "No results found."+in the chat composer+in the assistant composerexample.comthere loads Example Domain in it; its toolbar has Back/Forward/Reload, the agent-access badge,Send to chat(the hand-off), device and overflow menusmod+shift+bon the assistant pagemod+LthereElement picking itself is armed from that submenu and needs a click inside the live page; the delivery path is covered by
composer-browser-menu.test.tsxand the assistant composer's hand-off test rather than asserted through CDP.CI
Final state on
a88dcf886:Frontend (lint + vitest + build)pass (16m23s — eslint, the whole vitest suite andnext build), and every Rust job on ubuntu-22.04 and windows-latest pass (cli,server,desktop).Two red marks on the way there were mine and are fixed:
prettier/prettiererrors in the new files (commitb7892d535) and runs that were cancelled mid-job. The only remaining non-green check isRust desktop on macos-latest, whose job conclusion iscancelledafter 54m51s with no uploaded log (BlobNotFound) — the identical job fails the same way on #1430, and no Rust file is touched by this branch.Reaching the browser without a shortcut
Using the first build for a day made one thing obvious: opening a page was
three steps in —
+, a submenu whose trigger reads like a noun ("Browser tab"),then "Open browser tab". People looked for the browser and found neither the
noun nor the depth.
"Open browser tab" is a top-level row in the composer's
+menu now — sameplace in the chat and the assistant composer, one click — drawn only where a
page would actually go somewhere (
placement !== null), so it can never be thesilent no-op that a wrong placement used to be. The submenu keeps what acts on a
page that is already open: pick an element, send a screenshot, send the console
errors.