-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Global: Notification Alert Revamp #2555
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
Conversation
@zcolah are we really going with stacking snack bars? Just making sure you are aware that strictly goes against the material design guidelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
@@ -33,10 +48,49 @@ export default connect((state) => { | |||
setDrawerOpen(false); | |||
}); | |||
|
|||
const alertDetails = (kind) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be converted into a map and moved outside of the component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is now moved outside of a component
"& .MuiAlert-icon, .MuiAlert-message, .MuiAlert-action ": { | ||
color: "#fff", | ||
}, | ||
"& .MuiAlert-action": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes should be done at the theme level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do these changes one off for this component for now? Just thinking if this will affect on other part of website that are using Alert Component..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the expected process unless Zosh specifically asks otherwise
severity, | ||
icon, | ||
bgColor, | ||
}); | ||
// On every render set timeout to hide notices | ||
const token = setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this still needed/how does this interact with the autoHideDuration={8000} prop passed to the snackBarProvider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It interacts in SnackbarProvider by passing this custom component prop
Components={{ custom: CustomNotification }}
With the use of these props I can get their value in CustomNotification Component which needs those values to display the data in a snackbar and by using the enqueSnackbar it connects to the Provider. Hope that answers the questions.
@agalin920 You are correct that Material UI guidelines state that the "snackbar" should appear one at a time. They also do state they should be at the bottom center. However showing one toast at a time can lead to a scenario where a user does not immediately see an error message since the previous snackbar is still being shown. Hence we have instead decided to take the approach the Github Primer system is taking: https://primer.style/components/toast Also you can see this discussion thread created to discuss this change: https://zesty-io.slack.com/archives/C03TKNN7XRN/p1704812236712669 |
maxWidth: "516px", | ||
whiteSpace: props.severity === "success" ? "nowrap" : "normal", | ||
overflow: "hidden", | ||
textOverflow: "ellipsis", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typography has a noWrap prop that does this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done using noWrap prop on typography
Note: This project cannot deploy until we improve the microcopy for the alerts. So please mark this as blocked. |
I would NOT want this to be in the same body of work just fyi. I also don't see how this blocks this current ticket. |
I disagree with us taking the approach of a completely different design system that we have not been abiding to. If you have specific product needs for it thats fine but I don't expect the justification to be in another design system |
1. The sequence of the projects that were planned were are as follows:
a. We get an inventory (Google Sheet) of all the existing notifications
from the dev in charge
b. We update the notification messages in the system (done by me once part
a is done)
c. After which we would update the UI.
2. We made a team decision to ship this sequence of projects together as a
rollup and expected the sequence to be followed. That being said doing part
C first is still fine but we need to wait on the decisions.
3. Our design system is primarily based on Material UI. However we have
taken inspiration for a variety of different design systems in the past as
well when designing components. For example, our title bars, app sidebars,
tabs, text inputs, amongst others have been heavily influenced from other
design systems due to visual or usability needs.
When designing the notification system we looked at a variety of different
systems and methods of communicating notifications. We analyzed multiple
design systems and UIs as well for it.
And we also made a discussion post to receive feedback on the same in
product. Only after our due diligence and a hand off review did we place
this ticket in the Design Ready pile of the roadmap.
…On Wed, Feb 28, 2024, 11:13 PM Andres Galindo ***@***.***> wrote:
@zcolah <https://github.com/zcolah> are we really going with stacking
snack bars? Just making sure you are aware that strictly goes against the
material design guidelines.
@agalin920 <https://github.com/agalin920> You are correct that Material
UI guidelines state that the "snackbar" should appear one at a time. They
also do state they should be at the bottom center. However showing one
toast at a time can lead to a scenario where a user does not immediately
see an error message since the previous snackbar is still being shown.
Hence we have instead decided to take the approach the Github Primer
system is taking: https://primer.style/components/toast
Also you can see this discussion thread created to discuss this change:
https://zesty-io.slack.com/archives/C03TKNN7XRN/p1704812236712669
I disagree with us taking the approach of a completely different design
system that we have not been abiding to
—
Reply to this email directly, view it on GitHub
<#2555 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFMT477PMML2MXT27E6RHBTYV5UFJAVCNFSM6AAAAABDLKOK42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRZGUYTKNJVHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
What is the status of this coming into Beta? |
@@ -76,6 +76,7 @@ | |||
"lodash": "^4.17.20", | |||
"moment-timezone": "^0.5.33", | |||
"monaco-editor": "^0.25.2", | |||
"notistack": "^3.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much file size does this add to our bundle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
24.3 kB minified, 8.4kb minified + gzipped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove all the commented code?
}) | ||
); | ||
} | ||
} else { | ||
props.dispatch( | ||
notify({ | ||
kind: "warn", | ||
message: `API failed to return data ${res.status}`, | ||
message: `API failed to return data.Try Again.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after period
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done fixing.
}) | ||
); | ||
} | ||
} else { | ||
props.dispatch( | ||
notify({ | ||
kind: "warn", | ||
message: `API failed to return response when searching for ${parentZUID}`, | ||
heading: `"Cannot Save: [${props.metaTitle}]`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this message hold the metaTitle in brackets but others don't. Shouldn't we be consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad on that one, i didn't see that it has [ ]. I removed that now also
"& .MuiAlert-icon, .MuiAlert-message, .MuiAlert-action ": { | ||
color: "#fff", | ||
}, | ||
"& .MuiAlert-action": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the expected process unless Zosh specifically asks otherwise
}, | ||
padding: "8px 12px", | ||
borderRadius: "8px", | ||
bgcolor: props.bgColor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bgColor should be applied by the severity not custom applied. Is there a reason we are doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed now also the bgColor i moved it in the theme level. but the reason why i use a bgcolor because the background that variant filled, severity success and other severities are not using the colors that i wanted.
pl: 2, | ||
mr: 0, | ||
}, | ||
padding: "8px 12px", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned lots of custom css on this. We should move this all to the theme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the styling now in theme for your review also @agalin920
zesty-io/material#99
Thank you
key={i} | ||
className={cx(styles.Notification, styles.bodyText)} | ||
> | ||
<p className={styles.Message}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to convert the elements in this component to MUI components instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I update this to MUI Components it will update also the designs cause its using old design. If that won't be an issue I can proceed to update it?
- remove [ ] characters in between of text - remove setting bgColor, it will now depend on severity base on the theme change
useSnackbar, | ||
} from "notistack"; | ||
|
||
const alertDetails = (kind) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A static object seems like a better solution for this use case
const alertDetails = {
'warn': {
icon: ...
severity: ...
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agalin920 done updating to it to static object
message = "Please Add Display Name"; | ||
heading = "Cannot Create Model"; | ||
// @ts-ignore | ||
} else if (error?.data?.error.includes("name is already in use")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of this. Would prefer BE messaging changes. But approving
@agalin920 for your review regarding the fix on test suite. thank you |
Will close #2176 Resolved issues: - [x] new revamp design of notifcation - [x] stacking of notification (note the order of the notification is the bottom is always the latest) there's no currently functionality that will reverse that order in notistack - [x] top center positioning of notification - [x] there's a secondary type notification if the other properties will be available   [screencast-8-aaeffee09b-7w6v22.manager.dev.zesty.io_8080-2024.02.16-10_04_07.webm](https://github.com/zesty-io/manager-ui/assets/44116036/68ce2563-a155-4749-bc03-fcaa93a8331d) --------- Co-authored-by: Stuart Runyan <[email protected]>
Will close #2176
Resolved issues:
screencast-8-aaeffee09b-7w6v22.manager.dev.zesty.io_8080-2024.02.16-10_04_07.webm