feat: track upload progress in attachment preview components#3060
feat: track upload progress in attachment preview components#3060
Conversation
1c15431 to
6c93b9b
Compare
src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadProgressIndicator.tsx
Outdated
Show resolved
Hide resolved
6c93b9b to
50c8b11
Compare
src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
Outdated
Show resolved
Hide resolved
src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
Outdated
Show resolved
Hide resolved
e3e0a90 to
db938aa
Compare
src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadProgressIndicator.tsx
Outdated
Show resolved
Hide resolved
src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadProgressIndicator.tsx
Outdated
Show resolved
Hide resolved
src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadProgressIndicator.tsx
Outdated
Show resolved
Hide resolved
src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
Outdated
Show resolved
Hide resolved
src/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.tsx
Show resolved
Hide resolved
Co-authored-by: MartinCupela <32706194+MartinCupela@users.noreply.github.com>
e400abb to
77ba34c
Compare
…ressIndicator overridable
|
Size Change: +1.74 kB (+0.29%) Total Size: 608 kB 📦 View Changed
ℹ️ View Unchanged
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3060 +/- ##
==========================================
+ Coverage 80.45% 80.52% +0.06%
==========================================
Files 411 415 +4
Lines 11901 11948 +47
Branches 3835 3858 +23
==========================================
+ Hits 9575 9621 +46
- Misses 2326 2327 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.tsx
Outdated
Show resolved
Hide resolved
| fullBytes !== undefined | ||
| ) { | ||
| return ( | ||
| <span |
There was a problem hiding this comment.
Can this be extracted into a React component as we have FileSizeIndicator?
There was a problem hiding this comment.
I could simplify it using FileSizeIndicator: 388416d
src/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.tsx
Show resolved
Hide resolved
src/context/ComponentContext.tsx
Outdated
| /** Custom UI component to render while the `MessageList` is loading new messages, defaults to and accepts same props as: [LoadingIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingIndicator.tsx) */ | ||
| LoadingIndicator?: React.ComponentType<LoadingIndicatorProps>; | ||
| /** Custom UI component for determinate progress (0–100), defaults to and accepts same props as: [CircularProgressIndicator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/CircularProgressIndicator.tsx) */ | ||
| CircularProgressIndicator?: React.ComponentType<CircularProgressIndicatorProps>; |
There was a problem hiding this comment.
Could we just call it ProgressIndicator? Circular is a specific implementation of ProgressIndicator. The point of component context is as follows:
<WithComponents overrides={{ProgressIndicator: CircularProgressindicator}}>There was a problem hiding this comment.
What is the difference btw CircularProgressIndicator and UploadProgressIndicator?
There was a problem hiding this comment.
UploadProgressIndicator is a higher-level component with fallback to LoadingIndicator if progress is not provided: https://github.com/GetStream/stream-chat-react/blob/file-upload-on-progress/src/components/Loading/UploadProgressIndicator.tsx#L22
…dicator from ComponentContext
🎯 Goal
https://linear.app/stream/issue/REACT-925/upload-progress-tracking
Depends on: https://github.com/GetStream/stream-chat-js/pull/1708/changes#diff-61c3f170c2f20982af303989006c8317adf3006784ed2b37513e1c50487353d0
Docs PR: https://github.com/GetStream/docs-content/pull/1161
🛠 Implementation details
CircularProgressIndicator-> displays a circular progress indicator to track progress from 0 - 100%UploadProgressIndicator-> if upload progress is available, it displaysCircularProgressIndicator, otherwise theLoadingIndicator. When is upload progress not available?UploadedSizeIndicator: displays: 5 MB / 24 MBAttachmentUploadedSizeIndicator:🎨 UI Changes
Implementing this design: https://www.figma.com/design/Us73erK1xFNcB5EH3hyq6Y/Chat-SDK-Design-System?node-id=3517-102932&t=fizGA6SsyGt3g08F-0