mirror of https://github.com/kortix-ai/suna.git
Merge pull request #533 from escapade-mckv/browser-state-fix
chore(dev): browser state fix
This commit is contained in:
commit
40e206efb4
|
@ -185,11 +185,11 @@ export function BrowserToolView({
|
||||||
|
|
||||||
if (screenshotUrl) {
|
if (screenshotUrl) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center w-full h-full min-h-[600px] relative" style={{ minHeight: '600px' }}>
|
<div className="flex items-center justify-center w-full h-full min-h-[600px] relative p-4" style={{ minHeight: '600px' }}>
|
||||||
{imageLoading && (
|
{imageLoading && (
|
||||||
<ImageLoader />
|
<ImageLoader />
|
||||||
)}
|
)}
|
||||||
{!imageLoading && !imageError && (
|
<Card className={`p-0 overflow-hidden shadow-lg border ${imageLoading ? 'hidden' : 'block'}`}>
|
||||||
<img
|
<img
|
||||||
src={screenshotUrl}
|
src={screenshotUrl}
|
||||||
alt="Browser Screenshot"
|
alt="Browser Screenshot"
|
||||||
|
@ -197,7 +197,7 @@ export function BrowserToolView({
|
||||||
onLoad={handleImageLoad}
|
onLoad={handleImageLoad}
|
||||||
onError={handleImageError}
|
onError={handleImageError}
|
||||||
/>
|
/>
|
||||||
)}
|
</Card>
|
||||||
{imageError && !imageLoading && (
|
{imageError && !imageLoading && (
|
||||||
<div className="absolute inset-0 flex items-center justify-center bg-zinc-50 dark:bg-zinc-900">
|
<div className="absolute inset-0 flex items-center justify-center bg-zinc-50 dark:bg-zinc-900">
|
||||||
<div className="text-center text-zinc-500 dark:text-zinc-400">
|
<div className="text-center text-zinc-500 dark:text-zinc-400">
|
||||||
|
@ -210,11 +210,11 @@ export function BrowserToolView({
|
||||||
);
|
);
|
||||||
} else if (screenshotBase64) {
|
} else if (screenshotBase64) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center w-full h-full min-h-[600px] relative" style={{ minHeight: '600px' }}>
|
<div className="flex items-center justify-center w-full h-full min-h-[600px] relative p-4" style={{ minHeight: '600px' }}>
|
||||||
{imageLoading && (
|
{imageLoading && (
|
||||||
<ImageLoader />
|
<ImageLoader />
|
||||||
)}
|
)}
|
||||||
{!imageLoading && !imageError && (
|
<Card className={`overflow-hidden shadow-lg border ${imageLoading ? 'hidden' : 'block'}`}>
|
||||||
<img
|
<img
|
||||||
src={`data:image/jpeg;base64,${screenshotBase64}`}
|
src={`data:image/jpeg;base64,${screenshotBase64}`}
|
||||||
alt="Browser Screenshot"
|
alt="Browser Screenshot"
|
||||||
|
@ -222,7 +222,7 @@ export function BrowserToolView({
|
||||||
onLoad={handleImageLoad}
|
onLoad={handleImageLoad}
|
||||||
onError={handleImageError}
|
onError={handleImageError}
|
||||||
/>
|
/>
|
||||||
)}
|
</Card>
|
||||||
{imageError && !imageLoading && (
|
{imageError && !imageLoading && (
|
||||||
<div className="absolute inset-0 flex items-center justify-center bg-zinc-50 dark:bg-zinc-900">
|
<div className="absolute inset-0 flex items-center justify-center bg-zinc-50 dark:bg-zinc-900">
|
||||||
<div className="text-center text-zinc-500 dark:text-zinc-400">
|
<div className="text-center text-zinc-500 dark:text-zinc-400">
|
||||||
|
@ -280,7 +280,7 @@ export function BrowserToolView({
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
||||||
<CardContent className="p-0 flex-1 overflow-hidden relative" style={{ height: 'calc(100vh - 150px)', minHeight: '600px' }}>
|
<CardContent className="p-0 flex-1 overflow-hidden relative" style={{ height: 'calc(100vh - 150px)', minHeight: '600px' }}>
|
||||||
<div className="flex-1 flex h-full items-stretch bg-black">
|
<div className="flex-1 flex h-full items-stretch bg-white dark:bg-black">
|
||||||
{isLastToolCall ? (
|
{isLastToolCall ? (
|
||||||
isRunning && vncIframe ? (
|
isRunning && vncIframe ? (
|
||||||
<div className="flex flex-col items-center justify-center w-full h-full min-h-[600px]" style={{ minHeight: '600px' }}>
|
<div className="flex flex-col items-center justify-center w-full h-full min-h-[600px]" style={{ minHeight: '600px' }}>
|
||||||
|
@ -328,12 +328,12 @@ export function BrowserToolView({
|
||||||
)
|
)
|
||||||
) :
|
) :
|
||||||
(screenshotUrl || screenshotBase64) ? (
|
(screenshotUrl || screenshotBase64) ? (
|
||||||
<div className="flex items-center justify-center w-full h-full overflow-auto relative">
|
<div className="flex items-center justify-center w-full h-full overflow-auto relative p-4">
|
||||||
{imageLoading && (
|
{imageLoading && (
|
||||||
<ImageLoader />
|
<ImageLoader />
|
||||||
)}
|
)}
|
||||||
{!imageLoading && !imageError && (
|
<Card className={`p-0 overflow-hidden shadow-lg border ${imageLoading ? 'hidden' : 'block'}`}>
|
||||||
screenshotUrl ? (
|
{screenshotUrl ? (
|
||||||
<img
|
<img
|
||||||
src={screenshotUrl}
|
src={screenshotUrl}
|
||||||
alt="Browser Screenshot"
|
alt="Browser Screenshot"
|
||||||
|
@ -349,8 +349,8 @@ export function BrowserToolView({
|
||||||
onLoad={handleImageLoad}
|
onLoad={handleImageLoad}
|
||||||
onError={handleImageError}
|
onError={handleImageError}
|
||||||
/>
|
/>
|
||||||
)
|
)}
|
||||||
)}
|
</Card>
|
||||||
{imageError && !imageLoading && (
|
{imageError && !imageLoading && (
|
||||||
<div className="absolute inset-0 flex items-center justify-center bg-zinc-50 dark:bg-zinc-900">
|
<div className="absolute inset-0 flex items-center justify-center bg-zinc-50 dark:bg-zinc-900">
|
||||||
<div className="text-center text-zinc-500 dark:text-zinc-400">
|
<div className="text-center text-zinc-500 dark:text-zinc-400">
|
||||||
|
|
Loading…
Reference in New Issue