From 5c46e4086650f4a9f967627f62c41937d99cfe39 Mon Sep 17 00:00:00 2001 From: menzelj Date: Sun, 21 Jun 2026 21:30:46 +0000 Subject: [PATCH] 0.37.7: surface folder-upload diagnostics (find why it does nothing) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Folder upload still reported as doing nothing, and without browser access the failure point is invisible. Make every outcome visible on-screen: - onChange: if the folder picker returns 0 files, toast an error; otherwise toast "Starting folder upload: N file(s)…" so it's clear the upload fired (independent of the progress bar rendering). - Per-file failures are no longer swallowed: capture the first error and show it in the result toast ("Uploaded X, Y failed — : "). This pinpoints whether the picker returns nothing, the upload never starts, or the requests fail (and why). Frontend-only; all 3 images pushed 0.37.7. Co-Authored-By: Claude Opus 4.8 --- backend/version.py | 2 +- frontend/package.json | 2 +- frontend/src/pages/Files.tsx | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/version.py b/backend/version.py index 4662395..143041b 100644 --- a/backend/version.py +++ b/backend/version.py @@ -1,3 +1,3 @@ """Single source of truth for the StackPilot release version.""" -APP_VERSION = "0.37.6" +APP_VERSION = "0.37.7" diff --git a/frontend/package.json b/frontend/package.json index 396528b..e75a12d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "stackpilot-frontend", "private": true, - "version": "0.37.6", + "version": "0.37.7", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/pages/Files.tsx b/frontend/src/pages/Files.tsx index 8707cd9..a6fe70c 100644 --- a/frontend/src/pages/Files.tsx +++ b/frontend/src/pages/Files.tsx @@ -189,6 +189,7 @@ export function Files() { let ok = 0; let failed = 0; let doneBytes = 0; // bytes of fully-completed files + let firstError = ""; // surfaced so failures aren't silent // Show the bar immediately — small files may finish before the browser // emits any upload-progress event, so don't wait for the first one. setProgress({ @@ -213,15 +214,16 @@ export function Files() { }); }); ok += 1; - } catch { + } catch (err) { failed += 1; + if (!firstError) firstError = `${rel}: ${apiErrorMessage(err)}`; } doneBytes += f.size; } - return { ok, failed }; + return { ok, failed, firstError }; }, - onSuccess: ({ ok, failed }, files) => { - if (failed) toast.warning(`Uploaded ${ok} file(s), ${failed} failed`); + onSuccess: ({ ok, failed, firstError }, files) => { + if (failed) toast.error(`Uploaded ${ok} file(s), ${failed} failed — ${firstError}`); else toast.success(`Uploaded ${ok} file(s)`); revealIfHidden( ...files.map((f) => (f as File & { webkitRelativePath?: string }).webkitRelativePath || f.name), @@ -368,7 +370,12 @@ export function Files() { multiple onChange={(e) => { const files = Array.from(e.target.files ?? []); - if (files.length) uploadFolder.mutate(files); + if (!files.length) { + toast.error("Folder selection returned no files (nothing to upload)."); + return; + } + toast.info(`Starting folder upload: ${files.length} file(s)…`); + uploadFolder.mutate(files); }} />