You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error messages queue up instead of overwriting each other.
Closing an error message reveals the next message.
Repeats within 1s are ignored. A repeated success is ignored while the same one is still showing or waiting
Blank messages are ignored.
Errors close when you change pages.
Successes and errors are in their own queueus. Successes show on the top of the screen, errors at the bottom. (see referenced click up link for a screen cap of this)
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
A notification arriving during an exit transition can prematurely replace the closing message, and the tests do not verify that replacement success notifications receive a full fresh auto-hide timeout.
The reason will be displayed to describe this comment to others. Learn more.
hey @ako3131 code looks good and is an improvement from what we have, but I think there are still things to polish/improve that we can do in this same effort. Let me know if you want to discuss
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The snackbar queue still drops batched notifications, prematurely dismisses queued successes, and allows waiting successes to delay newly arriving errors.
The reason will be displayed to describe this comment to others. Learn more.
@ako3131 Not a defect of this PR. The single-slot overwrite lives in the reducer (src/utils/reducers.js:52-53) and predates this change; the previous setMsgData(snackbarMessage) had the same limit. It only drops a message when two SET_SNACKBAR_MESSAGE dispatches land in the same React batch. Verified against this branch on React 17.0.2 and 16.14.0: two synchronous dispatches outside a batch (the request-callback path used by snackbarErrorHandler / snackbarSuccessHandler) both display; only a pair wrapped in unstable_batchedUpdates loses the first. Buffering at the Redux boundary changes the reducer contract that consumers also implement (summit-admin has its own base-reducer), so it belongs in a separate change. Leaving this open for the author to decide; I'd track it as a follow-up rather than fix it here.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unresolved queue handling can drop notifications during batched Redux dispatches or page transitions and leave old-page errors visible after navigation.
A destination page that calls errorMessage from a mount effect can lose its notification here. Child effects run before this ancestor's page-change effect, so the new error is appended behind the current message and then removed by this filter, even though it belongs to the destination page. Please associate messages with their originating page and remove only errors from the page being left, or prune the queue synchronously in the navigation handler before destination effects run.
Navigation leaves unopened errors pinned to the destination page
If errorMessage(...) and navigation occur in the same batched event while the snackbar is closed, this render has an error in current but still has open === false. The opening effect above schedules setOpen(true), while this guard skips closing it, leaving the old-page error pinned on the destination page. Handle unopened error heads during navigation too, rather than relying only on open, and cover enqueueing plus changePage in a single act.
Grouping/stacking: in the thread Rocío proposed grouping errors into one snackbar ("3 errors · View details", with Copy copying all of them in order), or stacking as a fallback. This
PR uses a plain queue instead, so with 3 errors the user has to close them one by one, and the waiting ones are dropped on navigation without ever being seen. Was that an intentional call
for this iteration? If so, can we confirm with Rocío that it's OK, or plan grouping as a follow-up?
The copy feature is on feature/copyable-error-messages, which branches off main, not off this branch. Since errors only stay on screen so users have time to copy them, the two branches
depend on each other, and they touch the same files (SnackbarNotification, its tests, constants.js). Should the copy branch be rebased onto this one, so they get reviewed and merged in
order and we don't have to resolve conflicts later?
The reason will be displayed to describe this comment to others. Learn more.
@ako3131 there is an issue here, if user doesn't close the error message and success messages start to stack up, then 15min later the user closes the error message (or navigates away) , a 15min old success message appears which would be very confusing. But at the same time there are many cases where we dispatch a success message and then navigate to a grid, so in that scenario we do want to show the success message.
I think we need to have one queue per message type, or at least one for errors and one for the rest, since the rest autohide and will eventually cleanup the queue by itself, and the errors will not. That means an error and a success could be on screen at the same time, so they'd need to stack instead of overlapping at the top center.
Another solution could be having an EXPIRATION_TIME for messages, so we avoid showing too old messages that can get confusing.
Happy to discuss or if you find a better solution go for it.
The reason will be displayed to describe this comment to others. Learn more.
Rocío suggested ignoring click-away for all types, not only errors. Should we drop the !isSuccess here so successes don't close on an accidental click either?
@ako3131 thanks for the updates, nice work! Everything from my inline comments is in: the separate queues for errors and successes (success on top, error at the bottom), the longer
success timeout, and ignoring click-away for every type.
Two things are still open:
Grouping errors. Rocío's last suggestion in the thread was:
One snackbar that shows the latest error plus a count: "3 errors · View details"
"Copy details" copies every error in the group, in order and with timestamps, so support sees the full sequence
Success/info keep auto-hiding and don't affect the error group
Navigating away still clears the group (accepted trade-off, since the user can copy everything before leaving)
If grouping is too much for this iteration, stacking as a fallback
The success/info part and the clear-on-navigation part already work with the separate queues 👍. But errors are still a plain queue, which is the case she wanted to avoid. Errors pile up
behind the one on screen, the user closes them one at a time, and on navigation the waiting ones are dropped without ever being shown or copied. Can we go with grouping here, or at least
stacking for now and grouping as a follow-up ticket?
Copy feature branch. Feature/copyable error messages #383 still targets main and is 24 commits behind this branch. Both touch SnackbarNotification, its tests and constants.js, and "Copy details" for a whole group
needs both pieces together. Can we rebase feature/copyable-error-messages onto this branch so they get reviewed and merged in order?
Also, minor and maybe a follow-up: Copilot's point about batched Redux dispatches is still valid. baseState.snackbarMessage holds only one value, so dispatching an error and then a
success in the same handler loses the error before it reaches the queue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref: https://app.clickup.com/t/9014802374/86bcghcxq
What changed
Follow-ups