Skip to content

💄(frontend) update upload loader and error ui - #2784

Merged
AntoLC merged 3 commits into
mainfrom
feat/analyzer-ui
Oct 16, 2026
Merged

AntoLC merged 3 commits into
mainfrom
feat/analyzer-ui

Conversation

@AntoLC

@AntoLC AntoLC commented Oct 6, 2026

Copy link
Copy Markdown
Member

Purpose

Align the file upload UI with the new mockup: a restyled loader, and unexpected upload errors shown where the user is looking.

Proposal

  • Restyle the uploadLoader block (neutral card, full width, tertiary text) and rename "Analyzing file..." to "Analyzing the file".
  • When an upload fails unexpectedly, replace the upload block with an uploadLoader warning block ("A problem occurred while uploading the file, please try again.") in useUploadFile, instead of the error banner above the editor.
  • Remove that banner (TextErrors) from BlockNoteEditor.

Demo

image image

@AntoLC AntoLC self-assigned this Oct 6, 2026
@AntoLC
AntoLC requested a review from Ovgodd October 6, 2026 07:50
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 4.07 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/3ee0c074/_buildManifest.js 0 B -741 B (removed) 🏆
apps/impress/out/_next/static/cd7239b0/_buildManifest.js 741 B +741 B (new file) 🆕

compressed-size-action

@Ovgodd Ovgodd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just little things in term of ux/a11y

Comment on lines +104 to +106
editor.replaceBlocks(
[blockId],
[

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right, we manage it now:

const causes = error instanceof APIError ? error.cause : undefined;
toast(
causes?.length
? `${t('A problem occurred while uploading the file, cause:')} ${causes.join(' ')}`
: t(
'A problem occurred while uploading the file, please try again.',
),
VariantType.ERROR,
{ duration: UPLOAD_ERROR_TOAST_DURATION },
);

@AntoLC AntoLC linked an issue Oct 6, 2026 that may be closed by this pull request
@AntoLC
AntoLC requested a review from Ovgodd October 6, 2026 14:38
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.
@AntoLC
AntoLC merged commit e9cde2a into main Oct 16, 2026
60 of 61 checks passed
@AntoLC
AntoLC deleted the feat/analyzer-ui branch October 16, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New UI for the file analyzer block

2 participants