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

Allow user to hide right sidebar on any width. #29342

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

amanagr
Copy link
Member

@amanagr amanagr commented Mar 19, 2024

@alya
Copy link
Contributor

alya commented Mar 19, 2024

Nice! I think we should adjust the tooltip to:

  • Show user list [W]
  • Hide user list <- No keyboard shortcut, since W doesn't work to hide it again.

@alya
Copy link
Contributor

alya commented Mar 19, 2024

I also noticed a bug, where the user list opens in the wrong place.

  1. Make your window wide.
  2. Close the user list.
  3. Press W to open it.

Screenshot 2024-03-19 at 2 48 20 PM

@timabbott
Copy link
Sponsor Member

I merged the prep commits, which all look like pretty safe refactors, as #29358, so this should be quite compact now.

@alya
Copy link
Contributor

alya commented Mar 19, 2024

That's all the feedback I've got -- looks good to me otherwise!

@amanagr
Copy link
Member Author

amanagr commented Mar 20, 2024

Fixed both the issues @alya mentioned. Thanks!

@alya
Copy link
Contributor

alya commented Mar 20, 2024

Not a blocker for merging this, but ideally the left/right arrow keys would work for navigating between this button and the help menu.

@alya
Copy link
Contributor

alya commented Mar 20, 2024

Looks good to me other than that, now! I tested with "Use full width on wide screens" turned on/off.

@alya alya added the integration review Added by maintainers when a PR may be ready for integration. label Mar 20, 2024
@timabbott
Copy link
Sponsor Member

timabbott commented Mar 22, 2024

The code basically lgtm. A few notes:

  • I notice that when toggling it on/off, there's a bit of a positional flicker for the moment where the "Invite users" option is at the top; probably it's worth figuring out how to avoid that.
  • It feels a bit weird that the visual appearance of the toggle widget is different when the sidebar is hidden vs. not. (Underline in wide screens, but that's missing in narrow ones). Let's have underline when it is open always.
  • It feels like a bit of a void when collapsed; I wonder if anyone might be confused as to how to get it back. but probably that's a thing Vlad can debate once we have this test-deployed.
  • I managed to get a state where the right sidebar was misplaced while fiddling with fluid layout widget; but I can't reproduce right now.

I think I'll try to test-deploy on chat.zulip.org anyway, but might be you get to these revisions before me.

@amanagr
Copy link
Member Author

amanagr commented Mar 26, 2024

I notice that when toggling it on/off, there's a bit of a positional flicker for the moment where the "Invite users" option is at the top; probably it's worth figuring out how to avoid that.

This is happening since the rendering for the user list is more complex. If we toggle visibility instead of display, this doesn't happen. I think we can come back to it if more folks notice this since the solution would be to add transition on visibility / opacity.

This syncs the behaviour of userlist-toggle button to always show an
underline when sidebar is visible.
@amanagr
Copy link
Member Author

amanagr commented Mar 26, 2024

It feels a bit weird that the visual appearance of the toggle widget is different when the sidebar is hidden vs. not. (Underline in wide screens, but that's missing in narrow ones). Let's have underline when it is open always.

Added a commit for it.

@amanagr
Copy link
Member Author

amanagr commented Mar 26, 2024

I managed to get a state where the right sidebar was misplaced while fiddling with fluid layout widget; but I can't reproduce right now.

I am not able to reproduce, do you recall what it looked like?

@timabbott
Copy link
Sponsor Member

I am not able to reproduce, do you recall what it looked like?

Yeah, the sidebar was all the way to the right. I think we can probably hope someone can reproduce on chat.zulip.org; maybe let's post it in #issues and crowdsource a reproduction recipe after merging.

@timabbott timabbott merged commit 9515dd4 into zulip:main Mar 26, 2024
8 checks passed
@timabbott
Copy link
Sponsor Member

OK, I think we can merge this and fix forward from here, thanks @amanagr!

I think the flicker is probably distracting enough that it's worth some effort to fix. But I'm not sure I like the idea of moving to visibility, since that might entail the browser doing more background rendering work? Note sure. The ideas had would be to just do a requestAnimationFrame around the transition, or hiding/showing the "Invite users" first -- not sure if that could prevent it.

@alya
Copy link
Contributor

alya commented Mar 26, 2024

Cool! I filed #29465 as a follow-up for keyboard nav.

@amanagr amanagr deleted the hide_sidebars_followup branch March 26, 2024 18:53
@amanagr
Copy link
Member Author

amanagr commented Mar 27, 2024

Yeah, the sidebar was all the way to the right. I think we can probably hope someone can reproduce on chat.zulip.org; maybe let's post it in #issues and crowdsource a reproduction recipe after merging.

Yeah, I had updated this PR with a fix for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration review Added by maintainers when a PR may be ready for integration. size: XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants