Feat(NotificationDrawer): Add notification demo - #3220
Conversation
|
Preview: https://patternfly-pr-3220.surge.sh A11y report: https://patternfly-pr-3220-coverage.surge.sh
|
jcaianirh
left a comment
There was a problem hiding this comment.
Looks great @christiemolloy !
One question...in openshift, we scroll the entire contents of the notification drawer rather than having an accordion that scrolls each category. Do you think we should add a demo for that use case as well?
In that case the entire category list would scroll vertically, rather than each category scrolling vertically.
|
@jcaianirh from what I know I think having the entire notification drawer scroll when there are groups is an override to what we offer in PatternFly, but ill defer to @mcoker and @mcarrano because that might be a variation that we can offer. @mcarrano @mcoker I wanted to experiment with having two groups open at once to make sure double scrollbars dont appear. Is this expected in the notification drawer, or is it the case that as soon as you expand a group, the other groups close? |
|
@christiemolloy the way this is implemented now matches the design intent. @jcaianirh is there a reason you would not want it to work this way? I would not be in favor of having multiple examples. We should just agree on the way that this works and have a consistent approach. As to the correct accordion behavior, looks like the way it is implemented in React, each group opens independently (https://www.patternfly.org/v4/documentation/react/components/notificationdrawer#groups). I'm fine wit that. Should the demo also include an example of the basic drawer without groups? |
|
@mcarrano that sounds good to me. I'll add that as a second example for the demo |
|
@mcoker @mceledonia interested to hear your thoughts on the scrolling issue. |
|
@christiemolloy after chatting with @jcaianirh @mcoker and @mceledonia , we decided that the default behavior should be as @jcaianirh describes - that each group opens independently and a scroll bar is exposed for the entire contents of the drawer rather than constraining the height of the group as you currently have it. So this demo should then include two versions of the drawer. One with groups and the basic drawer without groups. Thanks! |
|
@mcarrano @jcaianirh @mcoker updated the examples so now there is both variations, and the notification drawer's default behavior has changed |
|
@christiemolloy So, the contents of the notification drawer body are supposed to scroll, but not the header. The header remains in place while the body contents scroll vertically. Thanks for updating the behavior. |
jcaianirh
left a comment
There was a problem hiding this comment.
update vertical scroll only on body
|
Ah thanks for catching that! will update shortly |
|
@jcaianirh do you mind taking a look at it now ? |
jcaianirh
left a comment
There was a problem hiding this comment.
lgtm looks great thanks @christiemolloy
mcarrano
left a comment
There was a problem hiding this comment.
This looks good @christiemolloy . Just one small nit. In the Basic demo, the text says 3 unread but the drawer only has 2 unread notifications in the list. Can you make those consistent to avoid any confusion? I'm also wondering about a couple of other things.
- We currently have a Drawer demo and a Notification Drawer demo. Any reason we need both? THey seem like the same thing.
- @mattnolting is currently working on updating the Notification Badge in the masthead. Will that change just get picked up here? I assume so, but wanted to make sure you are aware. If needed you guys should coordinate.
@mcarrano good point looks the same to me
@mcarrano i would think if this is gets picked up here it would still need modification since the new badge has more info to offer than just a boolean on/off...there are counts and severities needed to populate it with corresponding data. So @christiemolloy this will probably need to be updated when the new badge is delivered. |
|
I understand what you are saying, but it just seems odd to have two versions of the same thing. Maybe we just go ahead and merge this then and we can create something different for the Drawer demo at a later date. Or do we even need a Drawer demo on it's own? Thoughts @mcoker ? I will go ahead and give this one more review and approve. |
mcarrano
left a comment
There was a problem hiding this comment.
Looks great. Thanks @christiemolloy
|
@mcarrano the drawer demo was to create it in context of the page component for the use with notification drawer, but we didn't have the notification drawer built yet. Now that we have the notification drawer demo, I think having the two doesn't seem necessary as they are, since the "drawer" demo is just an empty drawer.
I'm in favor of that. Maybe showing how to use a simple list in a drawer in a page section, or other uses of the drawer. If it makes sense to you, we could go ahead and move this demo the the "drawer" demo page, and just have this as a drawer demo called "notification drawer." |
|
|
||
| // Modified content children | ||
| .pf-c-drawer__body { | ||
| height: 100%; |
There was a problem hiding this comment.
Adding this here disallows multiple __body sections where the last section stretches the remaining height https://github.com/patternfly/patternfly/pull/3220/files#diff-56492175f881007db175cb81ee985735L225. I think it should be
.pf-c-drawer__body:only-child {
height: 100%;
}
| .pf-c-notification-drawer__body { | ||
| flex: 1; | ||
| overflow: auto; | ||
| overflow-y: scroll; |
There was a problem hiding this comment.
| overflow-y: scroll; | |
| overflow-y: auto; |
| {{#> notification-drawer-body}} | ||
| {{> notification-drawer-basic-list}} | ||
| {{/notification-drawer-body}} | ||
| {{/notification-drawer}} No newline at end of file |
There was a problem hiding this comment.
| {{/notification-drawer}} | |
| {{/notification-drawer}} | |
| {{/notification-drawer-group}} | ||
| {{/notification-drawer-group-list}} | ||
| {{/notification-drawer-body}} | ||
| {{/notification-drawer}} No newline at end of file |
There was a problem hiding this comment.
| {{/notification-drawer}} | |
| {{/notification-drawer}} | |
@mcoker I'd rather not do this because the notification drawer is such a simple thing and I think people will look for it under that name in the navigation. Let's leave the drawer demo as is for now (just an empty drawer). I've opened a new issue to design a more robust drawer demo in the future that can include additional features like the horizontal drawer and splitter that are planned. patternfly/patternfly-design#891 |
|
I wanted to get rid of the I've opened a PR on @christiemolloy's branch with some updates that enable dropping Let's continue to discuss a solution to the screen reader text issue. |
fix(notificationdrawer): demo follow ups
|
@christiemolloy noticed a bug in safari where Just changing that to |
| .pf-c-drawer__body:last-of-type { | ||
| flex: 1 0 auto; | ||
| &:last-child { | ||
| flex: 1 1 auto; |
There was a problem hiding this comment.
| flex: 1 1 auto; | |
| flex: 1 1; |
| --pf-c-notification-drawer__group--m-expanded__group-toggle-icon--Rotate: 90deg; | ||
|
|
||
| display: flex; | ||
| flex: 1 1; |
There was a problem hiding this comment.
| flex: 1 1; |
mattnolting
left a comment
There was a problem hiding this comment.
Looks great, nice work!

Closes #3186
Adds the notification drawer demo and includes a fix for the two bugs that were happening when you add the notification drawer inside of the drawer:
height: 100%topf-c-drawer__bodyoverflow: hiddentopf-c-drawer__panel