-
Notifications
You must be signed in to change notification settings - Fork 310
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
web: add expand-all and collapse-all buttons #5611
Conversation
This pull request has been linked to Shortcut Story #13280: As user, I see more view options in Table View [Design WIP]. |
100f823
to
f6dd374
Compare
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.
function collapseAll(groupNames: string[]) { | ||
let newState: GroupsState = {} | ||
groupNames.forEach((group) => (newState[group] = { expanded: false })) | ||
setGroups(newState) |
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 is a minor detail / edge case that i'm not sure is worth addressing, but i'll mention it anyways! when disabled resources are hidden, label groups with only disabled resources will be reset to expanded when collapseAll
is invoked.
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.
oh boy it gets more complicated than that!
- if you click "collapse all", and then create new groups, do they default to expanded or collapsed?
- if you remove a collapsed group, click "expand all", and then bring the group back, does it default to expanded or collapsed?
i don't think there's an obvious right answer here...i like how the existing model encourages a default state of "expanded" when there are any open questions.
will leave some comments on this.
oh, i didn't realize that we were planning to add this to the sidebar too! ya, let's do that in a follow-up. |
also - i hope i didn't step on your toes! didn't realize there was a duplicate ticket 😬 |
Old duplicate ticket (ch12977) is largely my fault! I assigned it to myself with the intent of doing it a bit back but ended up never getting to it, so no worries, and glad this made it in regardless! |
This pull request has been linked to Shortcut Story #12977: Nice-to-have: Add expand and collapse groups buttons to both views. |
Hello @landism, @lizzthabet,
Please review the following commits I made in branch nicks/ch13280:
7d6cdc6 (2022-03-21 18:14:18 -0400)
web: add expand-all and collapse-all buttons
Code review reminders, by giving a LGTM you attest that: