Skip to content

Conversation

@gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Oct 28, 2023

Transition on mobile

Prior to the sidebar refresh in #798, the sidebar was revealed without transition on mobile devices. In #798 we repositioned the sidebar so that it takes up the entire layout on small screens, using the same transition logic.

An artifact of the previous design was that sidebar content could cause layout shift during transition, because it could affect the size of the parent container. To address that, we hid the sidebar contents until the transition finishes.

Layout shift isn't a problem on mobile, so it wasn't necessary to update the styles to hide the content. But this makes the transition inconsistent between mobile and desktop, so this PR now hides the content for all sidebars during transition.

Toggle position on mobile

On mobile or small screens, the sidebar takes up the entire layout container. Depending on the screen size and app layout, this means the sidebar can expand to the entire screen width, taking the toggle with it to the opposite side of the screen.

This PR keeps the toggle on the sidebar's collapsed side on small screens, minimizing mouse or finger travel to open and close the sidebar. This makes use of the dedicated toggle space at the top of the layout container, so it works well for nested sidebars.

Example

You can see both changes in the video below.

Kapture.2023-10-28.at.07.49.41.mp4

@gadenbuie gadenbuie merged commit d0eaa91 into main Oct 30, 2023
@gadenbuie gadenbuie deleted the sidebar/mobile-transition-hide branch October 30, 2023 16:20
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.

3 participants