Merge pull request #1958 from stablyai/computer-use-note
This commit is contained in:
@@ -30,9 +30,14 @@ export const BROWSER_PANE_SEARCH_ENTRIES = [
|
||||
type BrowserPaneProps = {
|
||||
settings: GlobalSettings
|
||||
updateSettings: (updates: Partial<GlobalSettings>) => 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 (
|
||||
<div className="space-y-6">
|
||||
{showBrowserUse ? <BrowserUseSetup onConfigureMoreBrowsers={scrollToSessionCookies} /> : null}
|
||||
{showBrowserUse ? (
|
||||
<BrowserUseSetup
|
||||
onConfigureMoreBrowsers={scrollToSessionCookies}
|
||||
onOpenComputerUse={onOpenComputerUse}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{showHomePage ? (
|
||||
<SearchableSetting
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Import, Loader2 } from 'lucide-react'
|
||||
import { Import, Loader2, MousePointerClick } from 'lucide-react'
|
||||
import { toast } from 'sonner'
|
||||
import type { CliInstallStatus } from '../../../../shared/cli-install-types'
|
||||
import { ORCA_CLI_SKILL_INSTALL_COMMAND } from '@/lib/agent-feature-install-commands'
|
||||
@@ -31,10 +31,12 @@ import { BrowserUseSkillStep } from './BrowserUseSkillStep'
|
||||
|
||||
type BrowserUseSetupProps = {
|
||||
onConfigureMoreBrowsers?: () => 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({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{onOpenComputerUse ? (
|
||||
<div className="rounded-xl border border-border/60 bg-card/50 p-4">
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-start">
|
||||
<div className="min-w-0 flex-1 space-y-1">
|
||||
<p className="text-sm font-medium">Use an existing browser session</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
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.
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={onOpenComputerUse}
|
||||
className="shrink-0 gap-1.5 self-start"
|
||||
>
|
||||
<MousePointerClick className="size-3.5" />
|
||||
Open Computer Use
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{showStep1 ? (
|
||||
<SearchableSetting
|
||||
title="Enable Orca CLI"
|
||||
|
||||
@@ -240,6 +240,7 @@ function Settings(): React.JSX.Element {
|
||||
Array.from(new Set([DEFAULT_APP_FONT_FAMILY, ...getFallbackTerminalFonts()]))
|
||||
)
|
||||
const [activeSectionId, setActiveSectionId] = useState('general')
|
||||
const [pendingNavRequestTick, setPendingNavRequestTick] = useState(0)
|
||||
// Why: the hidden-experimental group is an unlock — Shift-clicking the
|
||||
// Experimental sidebar entry reveals it for the remainder of the session.
|
||||
// Not persisted on purpose: it's a power-user affordance we don't want to
|
||||
@@ -628,7 +629,13 @@ function Settings(): React.JSX.Element {
|
||||
if (!visibleIds.has(activeSectionId) && visibleNavSections.length > 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 (
|
||||
<div className="flex flex-1 items-center justify-center text-muted-foreground">
|
||||
@@ -866,7 +885,11 @@ function Settings(): React.JSX.Element {
|
||||
description="Home page, link routing, and session cookies."
|
||||
searchEntries={BROWSER_PANE_SEARCH_ENTRIES}
|
||||
>
|
||||
<BrowserPane settings={settings} updateSettings={updateSettings} />
|
||||
<BrowserPane
|
||||
settings={settings}
|
||||
updateSettings={updateSettings}
|
||||
onOpenComputerUse={openComputerUseFromBrowser}
|
||||
/>
|
||||
</SettingsSection>
|
||||
|
||||
<SettingsSection
|
||||
|
||||
@@ -33,7 +33,14 @@ export const BROWSER_USE_PANE_SEARCH_ENTRIES: SettingsSearchEntry[] = [
|
||||
'auth',
|
||||
'chrome',
|
||||
'edge',
|
||||
'arc'
|
||||
'arc',
|
||||
'computer use',
|
||||
'system browser',
|
||||
'existing session',
|
||||
'authenticated browser',
|
||||
'chrome profile',
|
||||
'edge profile',
|
||||
'arc profile'
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user