fix(webui): restore session-scoped file previews
This commit is contained in:
1 parent
1457904e8d
commit
af5acabb33
15 files changed
+564
-70
No files matched your search
@@ -455,7 +455,7 @@ export async function fetchFilePreview(
|
||||
return request<FilePreviewPayload>(
|
||||
`${base}/api/sessions/${encodeURIComponent(key)}/file-preview?${query}`,
|
||||
token,
|
||||
undefined,
|
||||
{ cache: "no-store" },
|
||||
API_READ_TIMEOUT_MS,
|
||||
);
|
||||
}
|
||||
@@ -472,7 +472,7 @@ export async function fetchFilePreviewAvailability(
|
||||
const payload = await request<{ available?: boolean }>(
|
||||
`${base}/api/sessions/${encodeURIComponent(key)}/file-preview?${query}`,
|
||||
token,
|
||||
undefined,
|
||||
{ cache: "no-store" },
|
||||
API_READ_TIMEOUT_MS,
|
||||
);
|
||||
return payload.available !== false;
|
||||
|
||||
@@ -1607,16 +1607,18 @@ export interface WebuiThreadTraceDetailPayload {
|
||||
events: ThreadProjectionEvent[];
|
||||
}
|
||||
|
||||
export interface FilePreviewPayload {
|
||||
interface FilePreviewMetadata {
|
||||
path: string;
|
||||
display_path: string;
|
||||
project_path: string;
|
||||
language: string;
|
||||
content: string;
|
||||
size: number;
|
||||
truncated: boolean;
|
||||
}
|
||||
|
||||
export type FilePreviewPayload = FilePreviewMetadata & (
|
||||
| { kind?: "text"; language: string; content: string; truncated: boolean }
|
||||
| { kind: "image"; mime_type: string; data_url: string }
|
||||
);
|
||||
|
||||
export type Outbound =
|
||||
| { type: "new_chat"; workspace_scope?: WorkspaceScopePayload }
|
||||
| { type: "new_temporary_chat" }
|
||||
|
||||
Reference in new issue
Block a user