From a85a8c8c001605b52d71c2c2d26ed0922e861cec Mon Sep 17 00:00:00 2001 From: Atai Barkai Date: Sun, 8 Nov 2026 03:26:49 -0800 Subject: [PATCH 01/42] Draw both browsers as a real browser window The person's browser and a Bot's browser now look like a desktop browser rather than four stacked bars around a white box: - Tabs sit on the window's frame colour, and the tab that shows opens into the toolbar. Close buttons appear on the active and hovered tab. - The address is a pill with a lock for secure pages. - On the Browser page, Record moves to the end of the toolbar, the page sits flush under it, narration status becomes a slim status bar, and an empty tab shows the OpenBot orb and a search field instead of a blank page. - A Bot's full-size view opens over a frosted backdrop rather than black, with its page flush under the bar, and the preview card names the Bot and the site on a frame above the picture, with a dot while it is live. Behaviour, roles and names are unchanged; the existing browser and computer tests pass as they were. Co-Authored-By: Claude Opus 5.5 --- app/src/components/browser/browser-bar.tsx | 57 +++++- app/src/components/browser/browser-screen.tsx | 174 ++++++++++++------ app/src/components/browser/narration.tsx | 9 +- app/src/components/browser/recording.tsx | 5 +- app/src/components/computer/bot-browser.tsx | 5 +- app/src/components/computer/computer-view.tsx | 64 +++++-- 6 files changed, 228 insertions(+), 86 deletions(-) diff --git a/app/src/components/browser/browser-bar.tsx b/app/src/components/browser/browser-bar.tsx index 17f1f98fbf..1275e63249 100644 --- a/app/src/components/browser/browser-bar.tsx +++ b/app/src/components/browser/browser-bar.tsx @@ -3,6 +3,7 @@ import { IconArrowLeft, IconArrowRight, IconEraser, + IconLock, IconPlus, IconReload, IconWorld, @@ -104,6 +105,7 @@ export function TabStrip({ onActivate, onClose, onNew, + start, }: { /** From `useId`, shared with the `TabPanel` the tabs control. */ ids: string; @@ -116,6 +118,8 @@ export function TabStrip({ closed?: (answer: { tabs: BrowserTab[] }) => void, ) => void; onNew: () => void; + /** Drawn at the start of the strip, before the tabs: the page's sidebar toggle, where the browser fills the page. */ + start?: ReactNode; }) { const buttons = useRef(new Map()); const selected = tabs.find((tab) => tab.active) ?? tabs[0]; @@ -163,11 +167,21 @@ export function TabStrip({ event.preventDefault(); act(); }; + /* + * Drawn as a desktop browser's tabs: the strip is the window's frame colour, and the tab that shows is the page's own + * colour, open at the bottom into the toolbar beneath it, so the two read as one sheet the tab sits on. The others are + * quieter until hovered. + */ return ( -
+
+ {start ? ( +
+ {start} +
+ ) : null}
{tabs.map((tab, index) => { @@ -176,15 +190,21 @@ export function TabStrip({
+
) : null} - + {/* A pill in the window's frame colour, as a desktop browser's address bar is, lit like a field while typed in. */} + - - + + {address.startsWith("https://") ? ( + diff --git a/app/src/components/browser/browser-screen.tsx b/app/src/components/browser/browser-screen.tsx index 0d07b1316e..76a91ea6ce 100644 --- a/app/src/components/browser/browser-screen.tsx +++ b/app/src/components/browser/browser-screen.tsx @@ -1,13 +1,20 @@ import type { BrowserApiState } from "@openbot/shared/openbot-browser"; -import { IconBrowser } from "@tabler/icons-react"; +import { IconSearch } from "@tabler/icons-react"; import { useMutation } from "@tanstack/react-query"; import { type RefObject, useId, useRef, useState } from "react"; import { LiveScreen, type LiveScreenHandle, } from "@/components/computer/live-screen"; +import { OpenBotLogo } from "@/components/edition/openbot-logo"; import { SidebarToggle } from "@/components/layout/sidebar-toggle"; import { Button } from "@/components/ui/button"; +import { + InputGroup, + InputGroupAddon, + InputGroupInput, +} from "@/components/ui/input-group"; +import { addressFrom } from "@/lib/browser/address"; import { browserTabsMutationOptions, clearBrowserMutationOptions, @@ -88,44 +95,27 @@ export function ScreenBrowser({ { error: recording.error, at: recording.failedAt }, ]); + const go = (url: string) => { + navigate.mutate({ url }); + // Away to the page, as Chrome's address bar does: the next keys are for the page that opens. + screen.current?.focus(); + }; + + /* + * Laid out as a desktop browser's window, top to bottom: the tabs on the window's frame, the toolbar (back, forward, + * reload, the address, and Record at its end, where a browser keeps its own actions), what a recording or a request + * just did, the page, and a status bar that says whether narration is heard. The page's name is for screen readers: + * the sidebar already says where you are, and a browser's window has no title row of its own. + */ return ( -
-
-
- -
- - { - narration.setOn(on); - choice.choose(on); - }} - /> - -
- +
+

Browser

- {recording.stopped ? : null} - {failure ? ( -

- {failure.message} -

- ) : null} tabs.mutate({ action: "new" }, { onSuccess: newTab.opened }) } + start={} /> - { - navigate.mutate({ url }); - // Away to the page, as Chrome's address bar does: the next keys are for the page that opens. - screen.current?.focus(); - }} - onMove={(action) => navigate.mutate({ action })} - // Open or closed, or not answering (often why it is cleared), its data is there to wipe. A recording that is - // starting or stopping is let finish first; one that is running is ended by the clear itself. - clear={{ - disabled: recording.starting || recording.stopping, - ask: clearing.ask, - }} - /> +
+ navigate.mutate({ action })} + // Open or closed, or not answering (often why it is cleared), its data is there to wipe. A recording that is + // starting or stopping is let finish first; one that is running is ended by the clear itself. + clear={{ + disabled: recording.starting || recording.stopping, + ask: clearing.ask, + }} + /> +
+ + { + narration.setOn(on); + choice.choose(on); + }} + /> + +
+
+ {recording.stopped ? ( + + ) : null} + {failure ? ( +

+ {failure.message} +

+ ) : null}
+
); } @@ -184,16 +204,22 @@ export function ScreenBrowser({ * units rather than a measured width, so it fits both ways as the window or the sidebar changes. */ function Screen({ + blank, computerId, notAnswering, + onGo, open, reopen, reopening, screen, }: { + /** The tab that shows is empty: the page offers somewhere to go rather than a white rectangle. */ + blank: boolean; computerId: string; /** Why there is nothing to show: the browser is there and not answering (`BrowserApiState.problem`). */ notAnswering?: string; + /** Where the start page sends what is typed into it, as the address bar does. */ + onGo: (url: string) => void; open: boolean; reopen: () => void; reopening: boolean; @@ -201,13 +227,14 @@ function Screen({ }) { const [problem, setProblem] = useState(null); const [retryKey, setRetryKey] = useState(0); + // The page sits flush under the toolbar, at the browser's own shape, as wide as the window allows. return (
+ ) : blank ? ( + ) : null}
); } + +/** + * What an empty tab shows: the OpenBot orb and one field to search or go to a site, as a browser's new tab page does, + * over the empty page the browser itself would draw white. It goes where the address bar would. + */ +function StartPage({ onGo }: { onGo: (url: string) => void }) { + const [typed, setTyped] = useState(""); + return ( +
+ +
{ + event.preventDefault(); + const url = addressFrom(typed); + if (!url) return; + setTyped(""); + onGo(url); + }} + > + + setTyped(event.target.value)} + placeholder="Search or type an address" + spellCheck={false} + value={typed} + /> + + + + +
+
+ ); +} diff --git a/app/src/components/browser/narration.tsx b/app/src/components/browser/narration.tsx index c23214c7c0..d62daa309b 100644 --- a/app/src/components/browser/narration.tsx +++ b/app/src/components/browser/narration.tsx @@ -11,6 +11,7 @@ import { } from "@/components/ui/item"; import { Switch } from "@/components/ui/switch"; import type { NarrationProblem } from "@/lib/browser/narration"; +import { cn } from "@/lib/utils"; import type { NarrationChoice } from "./narration-choice"; import type { NarrationControls } from "./use-narration"; @@ -175,15 +176,21 @@ export function NarrationSwitch({ export function NarrationNotice({ narration, language, + className, }: { narration: NarrationControls; language: string; + /** Where it is drawn as the browser window's status bar rather than a row under its bar. */ + className?: string; }) { const sentence = narrationNoticeSentence(narration, language); if (!sentence) return null; return (

{sentence} diff --git a/app/src/components/browser/recording.tsx b/app/src/components/browser/recording.tsx index 1b035c425a..ed30edf2ca 100644 --- a/app/src/components/browser/recording.tsx +++ b/app/src/components/browser/recording.tsx @@ -531,7 +531,10 @@ export function RecordingBar({ /> {children} diff --git a/app/src/components/computer/bot-browser.tsx b/app/src/components/computer/bot-browser.tsx index 234faea759..80c4140abd 100644 --- a/app/src/components/computer/bot-browser.tsx +++ b/app/src/components/computer/bot-browser.tsx @@ -353,7 +353,10 @@ function RecordPanel({

Record a task

Do the task in the Bot's browser while you have control. Only what you - do is recorded, and it goes to your own Learning space.{" "} + do is recorded, and it goes to your own Learning space. +

+ {/* What the Recorder keeps, said before Record, quieter than what to do. */} +

{RECORDER_COLLECTS_SHORT}

diff --git a/app/src/components/computer/computer-view.tsx b/app/src/components/computer/computer-view.tsx index e2ffd2d99b..ce422c91e3 100644 --- a/app/src/components/computer/computer-view.tsx +++ b/app/src/components/computer/computer-view.tsx @@ -244,8 +244,9 @@ function BrowserWindow({ // Clipped rather than hidden: a hidden overflow would let this shrink below the screen's own floor.
+ {/* The page flush under the bar, as in the person's own browser (browser-screen.tsx). */}
{children} @@ -677,9 +678,43 @@ export function ComputerView({ /> ) : null; + /** Where the browser in the picture is, by host: the page drawn now, or the page a finished turn left it on. */ + const pageUrl = showScreen + ? drawn?.url + : settled + ? knownPage?.url + : undefined; + const pageHost = pageUrl ? hostOf(pageUrl) : ""; + return ( <> -
+
+ {/* + The card read as a window: whose browser it is and where it is, on the frame above the page, with a dot + while the picture is of the browser as it is now rather than of a turn that is over. + */} + {name || pageHost ? ( +
+ {name ? ( + + + {name} + + ) : null} + + {pageHost} + + {showScreen && !settled ? ( +
+ ) : null} {/* Inline preview remains in transcript; click opens a readable full-size view. */}