Skip to content

Commit d9d48b9

Browse files
authored
Add fullscreen button in sandbox pane toolbar (#171)
Co-authored-by: Chris Tate <ctate@users.noreply.github.com>
1 parent 1ed125c commit d9d48b9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

components/task-details.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import {
2929
X,
3030
ExternalLink,
3131
Plus,
32+
Maximize,
33+
Minimize,
3234
} from 'lucide-react'
3335
import { cn } from '@/lib/utils'
3436
import { useState, useEffect, useRef, useCallback } from 'react'
@@ -204,6 +206,7 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
204206
const [showPreviewPane, setShowPreviewPane] = useState(() => getShowPreviewPane())
205207
const [showChatPane, setShowChatPane] = useState(() => getShowChatPane())
206208
const [previewKey, setPreviewKey] = useState(0)
209+
const [isPreviewFullscreen, setIsPreviewFullscreen] = useState(false)
207210
const [isRestartingDevServer, setIsRestartingDevServer] = useState(false)
208211
const [isStoppingSandbox, setIsStoppingSandbox] = useState(false)
209212
const [isStartingSandbox, setIsStartingSandbox] = useState(false)
@@ -1860,7 +1863,7 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
18601863

18611864
{/* Preview */}
18621865
{showPreviewPane && (
1863-
<div className="flex-1 min-h-0 min-w-0">
1866+
<div className={cn('flex-1 min-h-0 min-w-0', isPreviewFullscreen && 'fixed inset-0 z-50 bg-background')}>
18641867
<div className="bg-card rounded-md border overflow-hidden h-full flex flex-col">
18651868
{/* Preview Toolbar */}
18661869
<div className="flex items-center gap-2 px-3 py-2 border-b bg-muted/50 flex-shrink-0 min-h-[40px]">
@@ -1894,6 +1897,19 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
18941897
>
18951898
<RefreshCw className="h-3.5 w-3.5" />
18961899
</Button>
1900+
<Button
1901+
variant="ghost"
1902+
size="sm"
1903+
onClick={() => setIsPreviewFullscreen(!isPreviewFullscreen)}
1904+
className="h-6 w-6 p-0 flex-shrink-0"
1905+
title={isPreviewFullscreen ? 'Exit Fullscreen' : 'Fullscreen'}
1906+
>
1907+
{isPreviewFullscreen ? (
1908+
<Minimize className="h-3.5 w-3.5" />
1909+
) : (
1910+
<Maximize className="h-3.5 w-3.5" />
1911+
)}
1912+
</Button>
18971913
<DropdownMenu>
18981914
<DropdownMenuTrigger asChild>
18991915
<Button

0 commit comments

Comments
 (0)