From f65d0b841f41a030020b07944db1b192cdc02306 Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 8 Sep 2026 09:57:46 -0500 Subject: [PATCH] fix(ui): keep cached file inspector expanded at a stable size Co-Authored-By: Paperclip --- ui/src/components/CachedTaskFilesButton.tsx | 12 ++++++------ ui/src/components/WorkFolderBrowser.tsx | 15 ++++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/src/components/CachedTaskFilesButton.tsx b/ui/src/components/CachedTaskFilesButton.tsx index e79db1e8ab..fb32edcb72 100644 --- a/ui/src/components/CachedTaskFilesButton.tsx +++ b/ui/src/components/CachedTaskFilesButton.tsx @@ -17,26 +17,26 @@ export function CachedTaskFilesButton({ issue, currentUserId }: { issue: TaskCon - - + + Cached task files Saved copies for this task’s current context, not the live sandbox filesystem. Changes are saved every three minutes and when a run ends, so these copies may be behind. Repository checkpoints are not browsable here. - - + + {folders.map(({ scope, label }) => {label})} {folders.map(({ scope, label, ownerId }) => ( - +

Cached copy of $HOME/{scope}/ · Preview and download only

{!ownerId ? (

No {label.toLowerCase()} is bound to this task. This folder is empty and unbound.

) : scope === "user" && ownerId !== currentUserId ? (

These cached files are private to the responsible user.

) : ( - + )}
))} diff --git a/ui/src/components/WorkFolderBrowser.tsx b/ui/src/components/WorkFolderBrowser.tsx index 29dc7e0d3d..5b0d278bdc 100644 --- a/ui/src/components/WorkFolderBrowser.tsx +++ b/ui/src/components/WorkFolderBrowser.tsx @@ -8,6 +8,7 @@ import { FileContentViewer } from "@/components/FileViewerSheet"; import { Button } from "@/components/ui/button"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"; import { Input } from "@/components/ui/input"; +import { cn } from "@/lib/utils"; import { Label } from "@/components/ui/label"; function tree(files: WorkFile[]) { @@ -29,7 +30,7 @@ function tree(files: WorkFile[]) { sort(root.children); return root.children; } -export function WorkFolderBrowser({ owner, exampleFiles, readOnly = false }: { owner: WorkFolderOwner; exampleFiles?: WorkFile[]; readOnly?: boolean }) { +export function WorkFolderBrowser({ owner, exampleFiles, readOnly = false, fillHeight = false }: { owner: WorkFolderOwner; exampleFiles?: WorkFile[]; readOnly?: boolean; fillHeight?: boolean }) { const queryClient = useQueryClient(); const [trash, setTrash] = useState(false); const [selectedPath, setSelectedPath] = useState(null); @@ -66,8 +67,8 @@ export function WorkFolderBrowser({ owner, exampleFiles, readOnly = false }: { o const lastOperation = filesQuery.data?.lastOperationAt; const saveFailed = Boolean(failed) || mutation.isError; const disabled = mutation.isPending || Boolean(exampleFiles); - return
-
+ return
+
{!readOnly && <> { const chosen = Array.from(event.currentTarget.files ?? []); event.currentTarget.value = ""; @@ -86,15 +87,15 @@ export function WorkFolderBrowser({ owner, exampleFiles, readOnly = false }: { o {[filesQuery.error, syncQuery.error, mutation.error].filter(Boolean).map((error, index) =>

{(error as Error).message}

)} {failed &&

{failed.error}

}

{announcement}

- {trash ?
{files.length === 0 ?

Trash is empty.

: files.map((file) =>
+ {trash ?
{files.length === 0 ?

Trash is empty.

: files.map((file) =>
{file.path}{!readOnly && <> Permanently delete {file.path}? This deleted copy and its deleted children will no longer be recoverable. Cancel mutation.mutate({ type: "purge", fileId: file.id })}>Permanently delete } -
)}
:
-
)}
:
+
{ setSelectedPath(filePath); setExpanded((before) => { const next = new Set(before); if (next.has(filePath)) next.delete(filePath); else next.add(filePath); return next; }); }} onSelectFile={setSelectedPath} loading={!exampleFiles && filesQuery.isLoading} empty={{ title: "No files yet", description: readOnly ? "No cached files have been saved for this scope." : "Upload files here, or create them during a sandbox run." }} ariaLabel={`${owner.scope} files`} />
@@ -102,7 +103,7 @@ export function WorkFolderBrowser({ owner, exampleFiles, readOnly = false }: { o {selected.kind === "file" && !exampleFiles && } {!readOnly && }
} {preview.isLoading ?

Loading preview…

: preview.error ?

{preview.error.message}

: preview.data ? -
:

Select a file to preview it.

} +
:

Select a file to preview it.

}
}
;