-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): toasts rework #6415
feat(ui): toasts rework #6415
Conversation
This looks good but it will be really hard to copy the session ID if you have a long queue and they are all failing because it basically flickers through each one as the socket error fires. I played around a bit to see if I could easily to just show the first, or a list but no luck. What do you think would be the best UX? |
.../web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationError.ts
Outdated
Show resolved
Hide resolved
.../web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationError.ts
Outdated
Show resolved
Hide resolved
invokeai/frontend/web/src/features/toast/ToastWithSessionRefDescription.tsx
Show resolved
Hide resolved
1dd14c4
to
bad3ae5
Compare
@maryhipp I've made the suggested changes, and updated the logic for what the toast displays per our discussion |
Small wrapper around chakra's toast system simplifies creating and updating toasts. See comments in toast.ts for details.
This was duplicated like 7 times or so
With the model install logic cleaned up the enum is less useful
If false, when updating a toast, the description is left alone. The count will still tick up.
Only display the session if local. Otherwise, just display the error message.
d702fe6
to
02887aa
Compare
Summary
Add a utility for managing toasts. A single method
toast
is exported. It can be used to both create a new toast or update an existing one, if provided the ID of an existing toast. All chakra toast options are supported, plus one new option:withCount
.withCount
defaults to true, and handles appending a couple to the title of the toast when mutltiples are fired:When updating a toast, the new title, description and other params will immediately override the existing toast.
If set to false, no count is appended. Note that if the id changes each time the toast is fired, that is considered a different toast and it will create a new one instead of updating.
All toasts across the app have been revised to use this utility. There's no more "toast queue" - toasts are fired the same way whether in a component, listener or wherever.
Other changes:
Related Issues / Discussions
QA Instructions
Note: There is some minor jank with how the toasts resize if you update them rapidly. This is a chakra issue - will need to dig into chakra theming to fix it.
Merge Plan
n/a
Checklist