Skip to content

feat(web): the browser's address bar searches, and agent typing no longer highlights the whole page - #907

Merged
badcuban merged 7 commits into
mainfrom
fix/browser-search-and-selection
Nov 13, 2026
Merged

badcuban merged 7 commits into
mainfrom
fix/browser-search-and-selection

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Two browser panel changes wanted before the next stable.

The address bar searches

Problem. The address bar said "Search or enter URL" but only loaded addresses, so typed words went nowhere or to a made-up host.

Fix. resolveAddressEntry reads an entry the way a browser does. It is an address when it has a scheme, a path, a port, a dotted host, a full IP address or is localhost; anything else is searched. A leading ? forces a search. Agent navigation and link opening are unchanged. Settings > General > Browser search engine picks Google (the default), DuckDuckGo, Bing, Brave Search or Kagi, each shown with its mark, kept on this computer with the browser. The setting is in the app guide catalog, so agents can find and change it when asked.

Choices worth knowing: a lone word such as devbox now searches (devbox/ loads it), and a search adds the search engine's site to the project's allowed sites, as typing its address already did.

Agent typing no longer highlights the whole page

Problem. With browser_type and clear, the app clicked the target and then sent the browser's "select all" to whatever had focus. When the click had not put focus in a text field (a button, a label, a layer over the field, a date picker), that selected every word on the page, typed nothing, and told the agent it had worked.

Fix. Typing first asks the page what would take the text (textReceiverScript.ts, run in the frame that holds the keyboard): a text input, a textarea, rich text, an editor that draws its own text, or nothing. With nothing, no key is sent and the call fails saying nothing was typed. Clearing happens inside the page, in the same step that checks the field still has focus, with the browser's own "select all" on that field only, and is refused once the user has taken the tab over. It goes by the focused element, so a cursor left in a field typed in earlier does not pass for focus. Known gap: an EditContext editor inside a closed shadow root reads as nothing to type into.

Checks

  • vp fmt, vp lint, vp run typecheck; shared, contracts, desktop tests; web and server tests around the change; the full web browser suite.
  • A packaged Mac app driven over CDP: typed words opened Google results, switching the setting sent the next search to DuckDuckGo, an address still loaded; the real click-then-type path refused typing at a button with nothing selected, and replaced and appended in a text input and a rich text box.
  • A scratch Electron window covering about 20 field kinds, closed shadow roots, EditContext and leftover-cursor cases.
  • Not checked: Windows and Linux, and a signed-in agent driving it end to end.

…he whole page

When an agent typed with "replace what is there", the app clicked the
target and then sent the browser's "select all" to whatever had focus.
If the click had not put focus in a text field (a button, a label, a
layer over the field, a date picker), that selected every word on the
page, typed nothing, and told the agent it had worked.

Typing now asks the page what would take the text first
(textReceiverScript.ts): a text input, a textarea, rich text, an editor
that draws its own text, or nothing. With nothing, no key is sent and
the call fails saying nothing was typed. Clearing happens inside the
page, in the same step that checks the field still has focus, and only
on that field. It is judged by the focused element, so a cursor left in
a field typed in earlier does not pass for focus, and it is refused
once the user has taken the tab over.
…ou choose

The address bar said "Search or enter URL" but only loaded addresses, so
typed words went nowhere or to a made-up host. Words are now searched:
an entry is an address when it has a scheme, a path, a port, a dotted
host, a full IP address or is localhost, and a search otherwise. A
leading "?" forces a search. Agent navigation and link opening are
unchanged.

Settings > General > Browser search engine picks Google (the default),
DuckDuckGo, Bing, Brave Search or Kagi, kept on this computer with the
browser.
Each choice under Settings > General > Browser search engine now leads
with the engine's mark: Google's four-color G, and the Simple Icons
glyphs (CC0) for DuckDuckGo, Bing, Brave and Kagi in each brand's color.
The marks live with the label component, not in the app-wide icon file,
so they load with Settings and add nothing to startup.
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 13, 2026 2:37pm UTC

Request Review

…ser panel, not at startup

The first cut put resolveAddressEntry in previewUrl.ts and the search
URLs beside the engine names, and both modules load at startup: link
opening needs previewUrl, and the Settings catalog needs the names.
Only the browser panel reads the address bar, so the rules move to
addressEntry.ts and the names move to the catalog with the other choice
labels, leaving browserSearch.ts with just the URLs.
@badcuban
badcuban added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit e07e82d Nov 13, 2026
24 checks passed
@badcuban
badcuban deleted the fix/browser-search-and-selection branch November 13, 2026 14:50

This branch was previously deployed

1 inactive deployment
Preview — 55de6436 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant