From c6f437608c58ed60f1346889bbdb7b8d09dc6b5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:37:16 +0000 Subject: [PATCH 1/3] Initial plan From 248cbaf8f0941e30db118921b52cffc82eafaeb7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:40:08 +0000 Subject: [PATCH 2/3] Fix .3mf file upload to use Library API instead of Archives API Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com> --- frontend/src/pages/FileManagerPage.tsx | 47 ++------------------------ 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/frontend/src/pages/FileManagerPage.tsx b/frontend/src/pages/FileManagerPage.tsx index 69d06af2c..0ae31de0a 100644 --- a/frontend/src/pages/FileManagerPage.tsx +++ b/frontend/src/pages/FileManagerPage.tsx @@ -431,7 +431,6 @@ interface UploadFile { isZip?: boolean; is3mf?: boolean; extractedCount?: number; - archiveId?: number; } function UploadModal({ folderId, onClose, onUploadComplete, t }: UploadModalProps) { @@ -489,49 +488,9 @@ function UploadModal({ folderId, onClose, onUploadComplete, t }: UploadModalProp setIsUploading(true); - // Handle .3mf files with bulk upload API (advanced extraction) - const threemfFiles = files.filter((f) => f.is3mf && f.status === 'pending'); - if (threemfFiles.length > 0) { - try { - // Mark files as uploading - setFiles((prev) => - prev.map((f) => (f.is3mf && f.status === 'pending' ? { ...f, status: 'uploading' } : f)) - ); - - // Use the archives bulk upload API for .3mf files (extracts printer model) - const result = await api.uploadArchivesBulk(threemfFiles.map((f) => f.file)); - - // Update file statuses based on result - setFiles((prev) => - prev.map((f) => { - if (!f.is3mf || f.status !== 'uploading') return f; - - const success = result.results.find((r) => r.filename === f.file.name); - const error = result.errors.find((e) => e.filename === f.file.name); - - if (success) { - return { ...f, status: 'success', archiveId: success.id }; - } - if (error) { - return { ...f, status: 'error', error: error.error }; - } - return f; - }) - ); - } catch (err) { - setFiles((prev) => - prev.map((f) => - f.is3mf && f.status === 'uploading' - ? { ...f, status: 'error', error: err instanceof Error ? err.message : 'Upload failed' } - : f - ) - ); - } - } - - // Handle other files (ZIP and regular files) with library upload + // Handle all files with library upload (ZIP and regular files including .3mf) for (let i = 0; i < files.length; i++) { - if (files[i].status !== 'pending' || files[i].is3mf) continue; + if (files[i].status !== 'pending') continue; setFiles((prev) => prev.map((f, idx) => (idx === i ? { ...f, status: 'uploading' } : f)) @@ -554,7 +513,7 @@ function UploadModal({ folderId, onClose, onUploadComplete, t }: UploadModalProp ) ); } else { - // Regular file upload (STL, etc.) + // Regular file upload (STL, .3mf, etc.) - .3mf files automatically get metadata extracted await api.uploadLibraryFile(files[i].file, folderId, generateStlThumbnails); setFiles((prev) => prev.map((f, idx) => (idx === i ? { ...f, status: 'success' } : f)) From 4f542511898aef9e2b06611cb647200cfab8035e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:42:05 +0000 Subject: [PATCH 3/3] Add printer model display to file cards for .3mf files Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com> --- backend/app/api/routes/library.py | 3 +++ backend/app/schemas/library.py | 1 + frontend/src/api/client.ts | 1 + frontend/src/pages/FileManagerPage.tsx | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/backend/app/api/routes/library.py b/backend/app/api/routes/library.py index 62334e8c1..efd71a6fd 100644 --- a/backend/app/api/routes/library.py +++ b/backend/app/api/routes/library.py @@ -664,10 +664,12 @@ async def list_files( print_name = None print_time = None filament_grams = None + sliced_for_model = None if f.file_metadata: print_name = f.file_metadata.get("print_name") print_time = f.file_metadata.get("print_time_seconds") filament_grams = f.file_metadata.get("filament_used_grams") + sliced_for_model = f.file_metadata.get("sliced_for_model") file_list.append( FileListResponse( @@ -685,6 +687,7 @@ async def list_files( print_name=print_name, print_time_seconds=print_time, filament_used_grams=filament_grams, + sliced_for_model=sliced_for_model, ) ) diff --git a/backend/app/schemas/library.py b/backend/app/schemas/library.py index 2fb886f91..2b854a061 100644 --- a/backend/app/schemas/library.py +++ b/backend/app/schemas/library.py @@ -154,6 +154,7 @@ class FileListResponse(BaseModel): print_name: str | None = None print_time_seconds: int | None = None filament_used_grams: float | None = None + sliced_for_model: str | None = None class Config: from_attributes = True diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index aeeb2218f..d3a60aa27 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -3820,6 +3820,7 @@ export interface LibraryFileListItem { print_name: string | null; print_time_seconds: number | null; filament_used_grams: number | null; + sliced_for_model: string | null; } export interface LibraryFileUpdate { diff --git a/frontend/src/pages/FileManagerPage.tsx b/frontend/src/pages/FileManagerPage.tsx index 0ae31de0a..cef80d2e5 100644 --- a/frontend/src/pages/FileManagerPage.tsx +++ b/frontend/src/pages/FileManagerPage.tsx @@ -962,6 +962,12 @@ function FileCard({ file, isSelected, isMobile, onSelect, onDelete, onDownload, )} + {file.sliced_for_model && ( +