Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion components/task-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import {
X,
ExternalLink,
Plus,
Maximize,
Minimize,
} from 'lucide-react'
import { cn } from '@/lib/utils'
import { useState, useEffect, useRef, useCallback } from 'react'
Expand Down Expand Up @@ -204,6 +206,7 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
const [showPreviewPane, setShowPreviewPane] = useState(() => getShowPreviewPane())
const [showChatPane, setShowChatPane] = useState(() => getShowChatPane())
const [previewKey, setPreviewKey] = useState(0)
const [isPreviewFullscreen, setIsPreviewFullscreen] = useState(false)
const [isRestartingDevServer, setIsRestartingDevServer] = useState(false)
const [isStoppingSandbox, setIsStoppingSandbox] = useState(false)
const [isStartingSandbox, setIsStartingSandbox] = useState(false)
Expand Down Expand Up @@ -1860,7 +1863,7 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps

{/* Preview */}
{showPreviewPane && (
<div className="flex-1 min-h-0 min-w-0">
<div className={cn('flex-1 min-h-0 min-w-0', isPreviewFullscreen && 'fixed inset-0 z-50 bg-background')}>
<div className="bg-card rounded-md border overflow-hidden h-full flex flex-col">
{/* Preview Toolbar */}
<div className="flex items-center gap-2 px-3 py-2 border-b bg-muted/50 flex-shrink-0 min-h-[40px]">
Expand Down Expand Up @@ -1894,6 +1897,19 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
>
<RefreshCw className="h-3.5 w-3.5" />
</Button>
<Button
variant="ghost"
size="sm"
onClick={() => setIsPreviewFullscreen(!isPreviewFullscreen)}
className="h-6 w-6 p-0 flex-shrink-0"
title={isPreviewFullscreen ? 'Exit Fullscreen' : 'Fullscreen'}
>
{isPreviewFullscreen ? (
<Minimize className="h-3.5 w-3.5" />
) : (
<Maximize className="h-3.5 w-3.5" />
)}
</Button>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
Expand Down
Loading