Skip to content
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

combine "show-all" and "hide-all" buttons #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kuldp18
Copy link

@kuldp18 kuldp18 commented Feb 19, 2024

I think a toggle button is better than having two separate buttons. The toggle button changes states based on if the boxes are visible or not.

@mut-ex
Copy link
Owner

mut-ex commented Feb 20, 2024

I found several issues with this.

  1. Firstly it isn't functionally the same; with this there is no way to instantly show/hide all the boxes.
  2. If I start with all boxes visible, the button says "HIDE ALL" but if I individually hide every box; the button still says "HIDE ALL".
  3. Similarly if I start with all boxes hidden, the button says "SHOW AL" but if I individually make every box visible it still says "SHOW ALL"
  4. It is confusing for the user to see some of the boxes visible and a button saying "HIDE ALL"; but upon clicking that button instead of all the boxes being hidden (like you'd expect from what the button says); it hides the ones that were visible and instead shows the ones that were hidden.

I think if points 2 and 3 were fixed this could possibly be a useful additional feature.

@kuldp18
Copy link
Author

kuldp18 commented Feb 20, 2024

I found several issues with this.

  1. Firstly it isn't functionally the same; with this there is no way to instantly show/hide all the boxes.
  2. If I start with all boxes visible, the button says "HIDE ALL" but if I individually hide every box; the button still says "HIDE ALL".
  3. Similarly if I start with all boxes hidden, the button says "SHOW AL" but if I individually make every box visible it still says "SHOW ALL"
  4. It is confusing for the user to see some of the boxes visible and a button saying "HIDE ALL"; but upon clicking that button instead of all the boxes being hidden (like you'd expect from what the button says); it hides the ones that were visible and instead shows the ones that were hidden.

I think if points 2 and 3 were fixed this could possibly be a useful additional feature.

Biggest issue is managing state and rendering the correct state. I will try to work on the bugs. Can I implement some hacky state management to tackle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants