Skip to content

Restyle & Refactor Flash Messaging#374

Open
mbwatson wants to merge 5 commits into
mainfrom
enhancement/error-messaging
Open

Restyle & Refactor Flash Messaging#374
mbwatson wants to merge 5 commits into
mainfrom
enhancement/error-messaging

Conversation

@mbwatson

@mbwatson mbwatson commented Apr 16, 2026

Copy link
Copy Markdown
Member

Summary

Restyles and refactors the flash message (snackbar notification) system to improve UX, styling, and maintainability.

Changes

  • FlashMessage component — Reworked styling: messages now use bordered, light-tinted backgrounds (color-mix) instead of fully solid fills, with dark text for better readability. Added a dedicated WarningIcon for warning-type messages. Auto-hide duration is now type-aware (success/info auto-dismiss; warning/error persist until manually closed), supporting reading longer error messaging. Layout updated to span the content area instead of being small and centered.

  • FlashMessageContext — Replaced useState-based queue with useCallback-driven addFlashMessage/removeFlashMessage functions. Each message now receives a unique id for stable removal. Added a useFlashMessaging custom hook with a guard for usage outside the provider.

  • FlashMessageContainer — Now receives messages and onClose as props, rendering the list internally instead of accepting children. Supports a disableAutoHide prop for debugging.

  • DropZone — Minor formatting fix: newline after the "Error uploading file:" header for cleaner multi-line error display.


these screenshots show the busiest error message returned from the API, before and after this PR:

before
Screenshot 2026-04-20 at 09-39-32 TIC CTMD

after
image

@mbwatson
mbwatson requested a review from davidborland April 20, 2026 12:34

@davidborland davidborland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks much nicer IMO. A couple of questions:

  1. Does the error display have a max height? Is it scrollable? Just wondering if there might be a situation where there are enough errors that some might get cut off, either due to max heigh on the error display, or a screen with a low y resolution.

  2. Is the error message cut and pastable? I presume so, but wanted to double check.

@mbwatson

Copy link
Copy Markdown
Member Author
  1. at this point, no scrolling and no max height, but these are good ideas.
  2. yes the errors can be copied with the normal manual method, but a copy button would be a nice touch--especially for the error messages.

i'd be happy to implement these ideas.

@davidborland

Copy link
Copy Markdown
Contributor

I think (1) is the most important, as I believe the primary problem the client was having was not being able to see all of the errors. I would consider (2) a nice to have, but not as crucial.

@joshua-seals
joshua-seals requested a review from davidborland May 4, 2026 13:18
@davidborland

Copy link
Copy Markdown
Contributor

@mbwatson Can you upload a screenshot with the changes?

@mbwatson

mbwatson commented May 4, 2026

Copy link
Copy Markdown
Member Author

@davidborland yep, here's one! you'll see i've opted to tuck them off to the right side. on a large screen size, when the tray fills up with notifications, the overflow scroll was not too user friendly when these were full-width. however, it does flip to full-width on a smaller screen size. the higher contrast text and color changes are what you saw previously.

image

@davidborland

Copy link
Copy Markdown
Contributor

This looks the same as the previous "after" screenshot to me. Is there a difference between them? Could you show an example of what it looks like with the scroll?

@mbwatson

mbwatson commented May 5, 2026

Copy link
Copy Markdown
Member Author

yeah i replaced the "after" image in the original description with the new "after" image. you can step through the edited version to see the original.

you can see the scrolling container in this recording:

Screencast.from.2026-05-05.07-44-22.webm

@davidborland

Copy link
Copy Markdown
Contributor

Ah, okay. I was thinking the individual error message components would be scrollable, but the container that holds the error messages is scrollable? That probably make sense if the issue is multiple error messages stacking, as opposed to a single error message that has too many lines such that it gets cut off.

@davidborland davidborland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants