Add sidebar upload progress toast and optional finish title#8308
Add sidebar upload progress toast and optional finish title#8308Light2Dark merged 4 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
I also noticed a small UX edge case: if a drop includes both accepted and rejected files, users may see a rejection toast without a clear confirmation that the accepted files were uploaded successfully. Would you like me to address this in a small follow-up PR by showing a combined summary message (e.g. “Uploaded N files, skipped M files”)? |
Oh, yeah that looks like we missed something. A follow-up would be great, thank you for this! |
…eam#8308) ## Summary This PR adds upload progress feedback for file uploads from the editor sidebar. issue(marimo-team#8120). ## Description of Changes 1. Extended `withLoadingToast` (`frontend/src/utils/download.ts`) with an optional `finishTitle` argument. 2. Updated sidebar file upload flow (`frontend/src/components/editor/file-tree/upload.tsx`) to reuse `withLoadingToast`. 3. Wired upload progress updates by file count (`progress.addTotal(...)` + `progress.increment(1)`). 4. Added tests in `frontend/src/utils/__tests__/download.test.tsx` for: - showing a finish toast when `finishTitle` is provided - not showing a finish toast when the operation fails ## Behavior - During upload: a loading toast with progress bar is shown. - On success: loading toast dismisses, then a completion toast is shown. - On failure: loading toast dismisses and existing error handling remains unchanged. ## Validation - `pnpm --filter @marimo-team/frontend test src/utils/__tests__/download.test.tsx --run` - `pnpm turbo --filter @marimo-team/frontend typecheck` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary
This PR adds upload progress feedback for file uploads from the editor sidebar. issue(#8120).
Description of Changes
withLoadingToast(frontend/src/utils/download.ts) with an optionalfinishTitleargument.frontend/src/components/editor/file-tree/upload.tsx) to reusewithLoadingToast.progress.addTotal(...)+progress.increment(1)).frontend/src/utils/__tests__/download.test.tsxfor:finishTitleis providedBehavior
Validation
pnpm --filter @marimo-team/frontend test src/utils/__tests__/download.test.tsx --runpnpm turbo --filter @marimo-team/frontend typecheck