Collapse alert groups when initially viewing ui#1876
Conversation
39bcfd5 to
03f1b63
Compare
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
03f1b63 to
b4fb8a2
Compare
|
As far as I understand this would only allow to expand one group. Can we allow expanding multiple groups? Can we also have a button to expand all groups? If there is a single group, can we always expand it? If we add a button to expand all groups, can we keep this preference in the localStorage like the username? |
We definitely can. I thought about this but did the simple thing first. Also, since we only allow a single alert's annotation information to be open at a time, I thought I could do that as well. I'm guessing, for implementation, we would store a List of
We definitely could. I'm wondering how often it would be used. But, if there are users/alertmanager installations running that have relatively few alerts/alert groups, maybe it would make sense to provide this. Maybe you could give some suggestions on how to show this, and where to place it (I have very little UX skill..)
+1
Makes sense |
|
@stuartnelson3 let’s chat about this on Monday More ideas: |
|
Thanks for the PR and the discussion. Dynamically autoexpanding if a group has very few alerts and/or there are very few groups altogether would be awesome (cf. how GitHub renders notifications https://github.com/notifications , they even have partial expansion there, perhaps that would be interesting here as well, to see an example alert"). Would be great to see a number next to unexpanded groups ("44 alerts") or partially expanded groups ("41 more alerts, see more...") |
|
My plans for this PR:
|
|
And of course, this PR doesn't have to solve everything. It's already a great start. |
We can simplify the view flow by parsing the list of alerts for custom grouping as soon as they are returned to the update function. Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
Can't think of a reason to hide the alerts if there's only a single group. Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
0686e62 to
e8d1840
Compare
|
@w0rm could you help a bit with the styling? in particular, the alert count seems to be on the "baseline" and should probably be bumped up higher, and the "expand all" button doesn't quite seem to be lined up correctly. |
| production: true, | ||
| defaultCreator: localStorage.getItem('defaultCreator') | ||
| defaultCreator: localStorage.getItem('defaultCreator'), | ||
| groupExpandAll: JSON.parse(localStorage.getItem('groupExpandAll')) |
There was a problem hiding this comment.
After a lot of anger and confusion, I did some reading and figured out that booleans cannot be stored into local storage. Is this an ok way to get the boolean back out? Not sure if there's a convention around it.
| ( Loading, groupBar ) | ||
|
|
||
| Failure e -> | ||
| ( Failure e, groupBar ) |
There was a problem hiding this comment.
This is sorting the alerts into alert groups immediately when they're returned from the API. I wasn't sure how to have a pattern match Initial, Loading, and Failure e, because they're technically of type ApiData GettableAlerts. If there's a way to compact this, that would be awesome.
dea2dbe to
c933585
Compare
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
c933585 to
0f1df58
Compare
|
@stuartnelson3 I adjusted the styling: |


helps with frontend rendering, and (in my opinion) makes it more usable. clicking the
+expands the group, much like showing/hiding annotations for individual alerts.requested in #911