From 4c475a1ce116e19f845bd35f692097915627123b Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Fri, 15 May 2026 12:06:06 -0700 Subject: [PATCH 1/2] Add Computer Use promo to Browser settings References docs/browser-computer-use-promo.md. --- docs/browser-computer-use-promo.md | 64 +++++++++++++++++++ .../src/components/settings/BrowserPane.tsx | 14 +++- .../components/settings/BrowserUsePane.tsx | 31 ++++++++- .../src/components/settings/Settings.tsx | 27 +++++++- .../components/settings/browser-use-search.ts | 9 ++- 5 files changed, 138 insertions(+), 7 deletions(-) create mode 100644 docs/browser-computer-use-promo.md diff --git a/docs/browser-computer-use-promo.md b/docs/browser-computer-use-promo.md new file mode 100644 index 000000000..3d735efbc --- /dev/null +++ b/docs/browser-computer-use-promo.md @@ -0,0 +1,64 @@ +# Browser Computer Use Promo + +## Problem +Browser Use setup is in **Browser** settings, while **Computer Use** is a separate section. Users are not told that Computer Use can control already-authenticated desktop apps (including system browsers), which can be lower-friction than cookie import for some tasks. + +## Current constraints (code-verified) +- `BrowserUseSetup` currently accepts only `onConfigureMoreBrowsers?: () => void` (`BrowserUsePane.tsx`). +- `BrowserPane` is desktop-only because the entire Browser section is gated by `showDesktopOnlySettings` in `Settings.tsx`. +- Browser Use toggle and “skill installed” are persisted in `localStorage` keys (`BROWSER_USE_ENABLED_STORAGE_KEY`, `BROWSER_USE_SKILL_INSTALLED_STORAGE_KEY`), but each window keeps its own React state copy after initial read (no `storage` event sync). +- Computer Use section id is `computer-use` (`SettingsSection id`). +- Settings search filters section mounting; filtered sections are absent from the DOM. +- Canonical jump behavior already exists in `Settings.tsx` via `pendingNavSectionRef`, `pendingScrollTargetRef`, `scrollSectionIntoView`, and `flashSectionHighlight`. +- `ComputerUsePane` always renders the skill install block; macOS permission controls render only when platform resolves to macOS. + +## Goal +Add a compact promo inside expanded Browser Use that links to Computer Use and uses the existing Settings pending-nav jump path. + +## Non-goals +- No Computer Use controls duplicated inside Browser. +- No Browser Use step semantics changes. +- No Computer Use backend/API changes. + +## Implementation +1. Add `onOpenComputerUse?: () => void` to `BrowserUseSetupProps`. +2. Thread that prop through `BrowserPaneProps` and pass it from `BrowserPane` to `BrowserUseSetup`. +3. In `Settings.tsx`, pass `onOpenComputerUse` into `BrowserPane` that: +- sets `pendingNavSectionRef.current = 'computer-use'` +- sets `pendingScrollTargetRef.current = 'computer-use'` +- clears search only if non-empty (`setSettingsSearchQuery('')`) so the section can mount +4. Rely on existing `visibleNavSections` effect to execute scroll + flash and clear pending refs. +5. Render promo only when Browser Use is enabled/expanded and callback exists. +6. Place promo at top of expanded Browser Use card, before Step 1. +7. Style with existing tokens/primitives only (`rounded-xl border border-border/60 bg-card/50`, existing `Button` variants, `MousePointerClick` icon). + +Do not implement ad-hoc local scroll logic in `BrowserUsePane` for this jump; keep section navigation centralized in `Settings.tsx`. + +## Copy constraints +- State capability, not guarantee: Computer Use can control local apps and may use existing logged-in sessions where applicable. +- State prerequisites: Computer Use skill install is required; macOS permissions are additionally required on macOS. +- Position as an alternative path, not a replacement for Browser Use cookie import. + +## Edge cases to handle +- Active search currently filters out `computer-use`. +- Repeated CTA clicks before prior pending jump resolves (last click should remain idempotent). +- Browser Use collapsed/disabled (no promo). +- Multi-window state drift: localStorage-backed Browser Use UI state is not live-synced across open windows. +- Non-mac platforms: CTA remains valid (skill flow still exists even without mac permission rows). +- Web client: Browser section is absent, so promo path is unreachable by design. + +## Search indexing +Update `BROWSER_USE_PANE_SEARCH_ENTRIES` to add intent terms for this promo while keeping existing terms: +- `computer use` +- `system browser` +- `existing session` +- `authenticated browser` +- `chrome profile` +- `edge profile` +- `arc profile` + +## Acceptance criteria +- Expanded Browser Use shows promo + CTA. +- CTA lands on `computer-use`, flashes section highlight, and works when search filters are active. +- No Browser Use step behavior changes. +- No duplicated Computer Use controls in Browser. diff --git a/src/renderer/src/components/settings/BrowserPane.tsx b/src/renderer/src/components/settings/BrowserPane.tsx index 2d7d9ef7b..adb191680 100644 --- a/src/renderer/src/components/settings/BrowserPane.tsx +++ b/src/renderer/src/components/settings/BrowserPane.tsx @@ -30,9 +30,14 @@ export const BROWSER_PANE_SEARCH_ENTRIES = [ type BrowserPaneProps = { settings: GlobalSettings updateSettings: (updates: Partial) => void + onOpenComputerUse?: () => void } -export function BrowserPane({ settings, updateSettings }: BrowserPaneProps): React.JSX.Element { +export function BrowserPane({ + settings, + updateSettings, + onOpenComputerUse +}: BrowserPaneProps): React.JSX.Element { const searchQuery = useAppStore((s) => s.settingsSearchQuery) const browserDefaultUrl = useAppStore((s) => s.browserDefaultUrl) const setBrowserDefaultUrl = useAppStore((s) => s.setBrowserDefaultUrl) @@ -87,7 +92,12 @@ export function BrowserPane({ settings, updateSettings }: BrowserPaneProps): Rea return (
- {showBrowserUse ? : null} + {showBrowserUse ? ( + + ) : null} {showHomePage ? ( void + onOpenComputerUse?: () => void } export function BrowserUseSetup({ - onConfigureMoreBrowsers + onConfigureMoreBrowsers, + onOpenComputerUse }: BrowserUseSetupProps = {}): React.JSX.Element { const searchQuery = useAppStore((s) => s.settingsSearchQuery) const browserSessionProfiles = useAppStore((s) => s.browserSessionProfiles) @@ -222,6 +224,31 @@ export function BrowserUseSetup({
+ {onOpenComputerUse ? ( +
+
+
+

Use an existing browser session

+

+ If cookie import is not the right fit, Computer Use can control local apps and may + use existing logged-in browser sessions where applicable. Install the Computer Use + skill; macOS also requires privacy permissions. +

+
+ +
+
+ ) : null} + {showStep1 ? ( 0) { setActiveSectionId(getFallbackVisibleSection(visibleNavSections)?.id ?? activeSectionId) } - }, [activeSectionId, setSettingsSearchQuery, settingsSearchQuery, visibleNavSections]) + }, [ + activeSectionId, + pendingNavRequestTick, + setSettingsSearchQuery, + settingsSearchQuery, + visibleNavSections + ]) useEffect(() => { const container = contentScrollRef.current @@ -720,6 +727,18 @@ function Settings(): React.JSX.Element { [] ) + const openComputerUseFromBrowser = useCallback(() => { + pendingNavSectionRef.current = 'computer-use' + pendingScrollTargetRef.current = 'computer-use' + if (settingsSearchQuery !== '') { + setSettingsSearchQuery('') + return + } + // Why: the pending section refs do not schedule a render by themselves. + // When search is already clear, this reruns the centralized jump effect. + setPendingNavRequestTick((tick) => tick + 1) + }, [setSettingsSearchQuery, settingsSearchQuery]) + if (!settings) { return (
@@ -866,7 +885,11 @@ function Settings(): React.JSX.Element { description="Home page, link routing, and session cookies." searchEntries={BROWSER_PANE_SEARCH_ENTRIES} > - + Date: Fri, 15 May 2026 12:55:57 -0700 Subject: [PATCH 2/2] Remove browser promo design doc --- docs/browser-computer-use-promo.md | 64 ------------------------------ 1 file changed, 64 deletions(-) delete mode 100644 docs/browser-computer-use-promo.md diff --git a/docs/browser-computer-use-promo.md b/docs/browser-computer-use-promo.md deleted file mode 100644 index 3d735efbc..000000000 --- a/docs/browser-computer-use-promo.md +++ /dev/null @@ -1,64 +0,0 @@ -# Browser Computer Use Promo - -## Problem -Browser Use setup is in **Browser** settings, while **Computer Use** is a separate section. Users are not told that Computer Use can control already-authenticated desktop apps (including system browsers), which can be lower-friction than cookie import for some tasks. - -## Current constraints (code-verified) -- `BrowserUseSetup` currently accepts only `onConfigureMoreBrowsers?: () => void` (`BrowserUsePane.tsx`). -- `BrowserPane` is desktop-only because the entire Browser section is gated by `showDesktopOnlySettings` in `Settings.tsx`. -- Browser Use toggle and “skill installed” are persisted in `localStorage` keys (`BROWSER_USE_ENABLED_STORAGE_KEY`, `BROWSER_USE_SKILL_INSTALLED_STORAGE_KEY`), but each window keeps its own React state copy after initial read (no `storage` event sync). -- Computer Use section id is `computer-use` (`SettingsSection id`). -- Settings search filters section mounting; filtered sections are absent from the DOM. -- Canonical jump behavior already exists in `Settings.tsx` via `pendingNavSectionRef`, `pendingScrollTargetRef`, `scrollSectionIntoView`, and `flashSectionHighlight`. -- `ComputerUsePane` always renders the skill install block; macOS permission controls render only when platform resolves to macOS. - -## Goal -Add a compact promo inside expanded Browser Use that links to Computer Use and uses the existing Settings pending-nav jump path. - -## Non-goals -- No Computer Use controls duplicated inside Browser. -- No Browser Use step semantics changes. -- No Computer Use backend/API changes. - -## Implementation -1. Add `onOpenComputerUse?: () => void` to `BrowserUseSetupProps`. -2. Thread that prop through `BrowserPaneProps` and pass it from `BrowserPane` to `BrowserUseSetup`. -3. In `Settings.tsx`, pass `onOpenComputerUse` into `BrowserPane` that: -- sets `pendingNavSectionRef.current = 'computer-use'` -- sets `pendingScrollTargetRef.current = 'computer-use'` -- clears search only if non-empty (`setSettingsSearchQuery('')`) so the section can mount -4. Rely on existing `visibleNavSections` effect to execute scroll + flash and clear pending refs. -5. Render promo only when Browser Use is enabled/expanded and callback exists. -6. Place promo at top of expanded Browser Use card, before Step 1. -7. Style with existing tokens/primitives only (`rounded-xl border border-border/60 bg-card/50`, existing `Button` variants, `MousePointerClick` icon). - -Do not implement ad-hoc local scroll logic in `BrowserUsePane` for this jump; keep section navigation centralized in `Settings.tsx`. - -## Copy constraints -- State capability, not guarantee: Computer Use can control local apps and may use existing logged-in sessions where applicable. -- State prerequisites: Computer Use skill install is required; macOS permissions are additionally required on macOS. -- Position as an alternative path, not a replacement for Browser Use cookie import. - -## Edge cases to handle -- Active search currently filters out `computer-use`. -- Repeated CTA clicks before prior pending jump resolves (last click should remain idempotent). -- Browser Use collapsed/disabled (no promo). -- Multi-window state drift: localStorage-backed Browser Use UI state is not live-synced across open windows. -- Non-mac platforms: CTA remains valid (skill flow still exists even without mac permission rows). -- Web client: Browser section is absent, so promo path is unreachable by design. - -## Search indexing -Update `BROWSER_USE_PANE_SEARCH_ENTRIES` to add intent terms for this promo while keeping existing terms: -- `computer use` -- `system browser` -- `existing session` -- `authenticated browser` -- `chrome profile` -- `edge profile` -- `arc profile` - -## Acceptance criteria -- Expanded Browser Use shows promo + CTA. -- CTA lands on `computer-use`, flashes section highlight, and works when search filters are active. -- No Browser Use step behavior changes. -- No duplicated Computer Use controls in Browser.