Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion components/task-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ export function TaskChat({ taskId, task }: TaskChatProps) {
})

return (
<div ref={scrollContainerRef} className="flex-1 overflow-y-auto pb-4">
<div ref={scrollContainerRef} className="flex-1 overflow-y-auto overflow-x-hidden pb-4">
{hiddenMessagesCount > 0 && (
<div className="text-xs text-center text-muted-foreground opacity-50 mb-4 italic">
{hiddenMessagesCount} older message{hiddenMessagesCount !== 1 ? 's' : ''} hidden
Expand Down
24 changes: 6 additions & 18 deletions components/task-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2025,11 +2025,11 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
{/* Mobile Layout */}
<div className="md:hidden flex flex-col flex-1 min-h-0 relative pb-14">
{/* Content Area */}
<div className="flex-1 overflow-hidden px-3 pt-3">
<div className="flex-1 overflow-hidden">
{activeTab === 'code' ? (
<div className="relative h-full">
{/* Current File Path Bar */}
<div className="mb-2 flex items-center gap-2">
<div className="px-3 pt-3 pb-2 flex items-center gap-2 bg-background border-b">
<Button
variant="ghost"
size="sm"
Expand All @@ -2044,7 +2044,7 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
</div>

{/* Diff Viewer */}
<div className="bg-card rounded-md border overflow-hidden h-[calc(100%-3rem)]">
<div className="bg-card md:rounded-md md:border overflow-hidden h-[calc(100%-41px)]">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div className="bg-card md:rounded-md md:border overflow-hidden h-[calc(100%-41px)]">
<div className="bg-card md:rounded-md md:border overflow-hidden h-[calc(100%-44px)]">

The height calculation for the diff viewer appears to be incorrect. The file path bar is approximately 44px tall (pt-3: 12px + button: 24px + pb-2: 8px), but the diff viewer uses h-[calc(100%-41px)], which would cause it to overflow its container by 3px.

View Details

Analysis

Incorrect height calculation in mobile diff viewer causes 3px overflow

What fails: The diff viewer in TaskDetails mobile layout uses h-[calc(100%-41px)] but the file path bar above it is 44px tall (pt-3: 12px + button h-6: 24px + pb-2: 8px), causing the diff viewer to overflow its container by 3px and clip content with overflow-hidden.

How to reproduce:

  1. Open task details on a mobile viewport (md:hidden)
  2. Navigate to the code tab
  3. Open any file to display the diff viewer
  4. Observe that the bottom 3px of the diff viewer content may be clipped

Result: The diff viewer height calculation is 3px too small, causing content to overflow and be hidden by the overflow-hidden CSS property. When parent container is 1000px:

  • File path bar occupies: 44px
  • Diff viewer should occupy: 1000 - 44 = 956px
  • But it occupies: 1000 - 41 = 959px
  • Overflow: 3px (clipped by overflow-hidden)

Expected: The diff viewer should use h-[calc(100%-44px)] to properly account for the exact height of the file path bar, ensuring all content is visible without clipping.

Reference: This is a layout sizing bug in the mobile code view section of components/task-details.tsx where the calc() expression wasn't adjusted correctly when the layout was refactored.

<div className="overflow-y-auto h-full">
<FileDiffViewer
selectedFile={selectedItemIsFolder ? undefined : selectedFile}
Expand All @@ -2069,12 +2069,12 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
</div>
</div>
) : activeTab === 'chat' ? (
<div className="h-full pb-3">
<div className="h-full px-3 pb-3">
<TaskChat taskId={task.id} task={task} />
</div>
) : activeTab === 'preview' ? (
<div className="h-full pb-3">
<div className="bg-card rounded-md border overflow-hidden h-full flex flex-col">
<div className="h-full">
<div className="bg-card md:rounded-md 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]">
<Monitor className="h-4 w-4 text-muted-foreground flex-shrink-0" />
Expand Down Expand Up @@ -2105,18 +2105,6 @@ export function TaskDetails({ task, maxSandboxDuration = 300 }: TaskDetailsProps
>
<RefreshCw className="h-3.5 w-3.5" />
</Button>
<Button
variant="ghost"
size="sm"
asChild
className="h-6 w-6 p-0 flex-shrink-0"
title="Open in New Tab"
disabled={!task.sandboxUrl}
>
<a href={`/api/tasks/${task.id}/sandbox-proxy`} target="_blank" rel="noopener noreferrer">
<ExternalLink className="h-3.5 w-3.5" />
</a>
</Button>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
Expand Down
Loading