Repository navigation
💄(frontend) update upload loader and error ui - #2784
Conversation
|
Size Change: 0 B Total Size: 4.07 MB 📦 View Changed
|
Ovgodd
left a comment
There was a problem hiding this comment.
just little things in term of ux/a11y
| editor.replaceBlocks( | ||
| [blockId], | ||
| [ |
There was a problem hiding this comment.
I tried a failed upload and the empty block is replaced by the warning, which is what we want. I tried replacing an existing image and the warning replaced the image. Is that what we want?
I tested a failed upload with the keyboard. When the warning shows up, the focus is lost (goes on body) and nothing is announced. On main the file panel stayed open.
I would suggest : After writing the warning, focus the editor on that block, and announce the message with announce() from @react-aria/live-announcer.
There was a problem hiding this comment.
I changed to a toast actually, to fit with what was made for the filesize:
I made a dedicated commit for the accessibility.
| type: 'uploadLoader', | ||
| props: { | ||
| information: t( | ||
| 'A problem occurred while uploading the file, please try again.', |
There was a problem hiding this comment.
Before, the banner showed the message sent by the API (errorAttachment.cause): a bad file type, a file too large or an access denied. Now every error is this sentence. Should we keep the API message when there is one, and use this text only when there isn't?
There was a problem hiding this comment.
Yes you're right, we manage it now:
b662513 to
c37df72
Compare
We updated the UI of the upload loader to match the new mockup.
We updated the UI to provide a clearer indication when an unexpected upload error occurs. Before the error was displayed on the top of the editor, making it less noticeable to the user, now we display the error directly within the upload block, making it more visible to the user and more user-friendly.
The loader used Card, adding an unnamed region per upload, and neither the analysis start nor the antivirus warning was announced. Use Box again, announce both through announce(), hide the decorative warning icon and keep upload error toasts 10s so the cause can be read.
20724bb to
e9cde2a
Compare
Purpose
Align the file upload UI with the new mockup: a restyled loader, and unexpected upload errors shown where the user is looking.
Proposal
uploadLoaderblock (neutral card, full width, tertiary text) and rename "Analyzing file..." to "Analyzing the file".uploadLoaderwarning block ("A problem occurred while uploading the file, please try again.") inuseUploadFile, instead of the error banner above the editor.TextErrors) fromBlockNoteEditor.Demo