0.37.7: surface folder-upload diagnostics (find why it does nothing)
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 — <path>: <reason>").
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
415ebb733a
commit
5c46e40866
+1
-1
@@ -1,3 +1,3 @@
|
||||
"""Single source of truth for the StackPilot release version."""
|
||||
|
||||
APP_VERSION = "0.37.6"
|
||||
APP_VERSION = "0.37.7"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "stackpilot-frontend",
|
||||
"private": true,
|
||||
"version": "0.37.6",
|
||||
"version": "0.37.7",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -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);
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user