Multiple fixes and ZIP file support in File Manager

Features:
  - ZIP file support in File Manager (Issue #121): Upload ZIP files to
    automatically extract contents with option to preserve folder structure
  - Delete operation loading indicator: Shows progress during folder/file
    deletion operations

Fixed:
  - Print time stats using actual elapsed time instead of slicer estimates
    (Issue #137)
  - Skip objects modal overflow with scrollable list for many objects
    (Issue #134)

Removed:
  - Duplicate badge feature from File Manager (per user request)

Tests:
  - Added ZIP extraction backend tests (5 tests)
  - Added ConfirmModal loading state frontend tests (5 tests)
This commit is contained in:
maziggy
2026-01-23 09:02:25 +01:00
parent ea570a12f5
commit 6225fac398
12 changed files with 614 additions and 109 deletions
+38
View File
@@ -2720,6 +2720,26 @@ export const api = {
}
return response.json();
},
extractZipFile: async (
file: File,
folderId?: number | null,
preserveStructure: boolean = true
): Promise<ZipExtractResponse> => {
const formData = new FormData();
formData.append('file', file);
const params = new URLSearchParams();
if (folderId) params.set('folder_id', String(folderId));
params.set('preserve_structure', String(preserveStructure));
const response = await fetch(`${API_BASE}/library/files/extract-zip?${params}`, {
method: 'POST',
body: formData,
});
if (!response.ok) {
const error = await response.json().catch(() => ({}));
throw new Error(error.detail || `HTTP ${response.status}`);
}
return response.json();
},
updateLibraryFile: (id: number, data: LibraryFileUpdate) =>
request<LibraryFile>(`/library/files/${id}`, {
method: 'PUT',
@@ -3007,6 +3027,24 @@ export interface LibraryStats {
disk_used_bytes: number;
}
export interface ZipExtractResult {
filename: string;
file_id: number;
folder_id: number | null;
}
export interface ZipExtractError {
filename: string;
error: string;
}
export interface ZipExtractResponse {
extracted: number;
folders_created: number;
files: ZipExtractResult[];
errors: ZipExtractError[];
}
// Library Queue types
export interface AddToQueueResult {
file_id: number;