fix(agent-browser): restore bounded presentation lifecycle
This commit is contained in:
@@ -3,6 +3,8 @@ import { createPortal } from 'react-dom';
|
||||
import {
|
||||
LoaderCircle,
|
||||
Pencil,
|
||||
PanelRightClose,
|
||||
PanelRightOpen,
|
||||
RotateCcw,
|
||||
Square,
|
||||
} from 'lucide-react';
|
||||
@@ -55,12 +57,18 @@ export function CodingConversationHeader({
|
||||
onRename,
|
||||
onAbort,
|
||||
onRecover,
|
||||
browserOpen = false,
|
||||
browserAvailable = false,
|
||||
onToggleBrowser,
|
||||
}: {
|
||||
conversation: CodingConversationMetadata | null;
|
||||
snapshot: ConversationSnapshot | null;
|
||||
onRename(title: string): Promise<void>;
|
||||
onAbort(): Promise<void>;
|
||||
onRecover(): Promise<void>;
|
||||
browserOpen?: boolean;
|
||||
browserAvailable?: boolean;
|
||||
onToggleBrowser?(): void;
|
||||
}) {
|
||||
const sidebarCollapsed = useSettingsStore((state) => state.sidebarCollapsed);
|
||||
const [busyAction, setBusyAction] = useState<string | null>(null);
|
||||
@@ -121,6 +129,23 @@ export function CodingConversationHeader({
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{onToggleBrowser ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
className={iconButtonClass}
|
||||
disabled={!browserAvailable}
|
||||
aria-label={browserOpen ? '关闭开发浏览器' : '打开开发浏览器'}
|
||||
aria-pressed={browserOpen}
|
||||
title={browserOpen ? '关闭开发浏览器' : '打开开发浏览器'}
|
||||
onClick={onToggleBrowser}
|
||||
>
|
||||
{browserOpen
|
||||
? <PanelRightClose className="h-4 w-4" aria-hidden="true" />
|
||||
: <PanelRightOpen className="h-4 w-4" aria-hidden="true" />}
|
||||
</Button>
|
||||
) : null}
|
||||
|
||||
{running && runStatus !== 'aborting' && (
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user