feat: add progress bar support to Upload.Box#404
Conversation
Add optional progress prop to file items in Upload.Box. When provided, renders an animated progress bar below each file row and shows the percentage instead of the Pending badge. Fully backwards compatible.
|
Pink (appwrite/pink)Project ID: Tip Trigger functions via HTTP, SDKs, events, webhooks, or scheduled cron jobs |
🚀 Previews available on pkg.vc!📦
|
Greptile SummaryThis PR adds an optional
Confidence Score: 5/5Safe to merge — all previous P1 findings are resolved and only minor P2 style/stories concerns remain. The three issues flagged in prior review rounds (wrong CSS token, unclamped text, inconsistent error state) are all fixed. The two remaining findings are P2: a minor edge-case around v2/pink-sb/src/stories/upload/Box.stories.svelte — module-level
|
| Filename | Overview |
|---|---|
| v2/pink-sb/src/lib/upload/Box.svelte | Adds optional progress prop with a unified isError check, clamped percentage display, an accessible role="progressbar" element, and correct CSS tokens (--bgcolor-accent / --bgcolor-error). Previous review concerns (token mismatch, unclamped text, inconsistent error detection) are all resolved. Minor edge case: progress: 0 is excluded from the progress UI by > 0. |
| v2/pink-sb/src/stories/upload/Box.stories.svelte | Adds "With Progress" story with uploading, near-complete, completed, and failed states. Module-level let arrays are passed via bind:files, meaning removals in one story can mutate the shared array and affect other stories in the same session. |
Reviews (3): Last reviewed commit: "fix: improve progress bar accessibility,..." | Re-trigger Greptile
- Fix prettier formatting - Use --bgcolor-accent token instead of non-existent --bgcolor-information - Clamp progress percentage text to [0, 100] to match progress bar - Align error state detection between badge and progress bar
- Add ARIA attributes (role, aria-valuenow/min/max, aria-label) to progress bar - Extract clampedProgress and isError as shared @const declarations - Round percentage display to integer - Treat progress: 0 as pending instead of showing 0% - Replace dead button with plain Icon on success state - Remove redundant variant prop from percentage Text

Summary
progress?: numberprop toUpload.Boxfile itemsprogressis providedis-errorstylingprogresspreserves existing behavior