Skip to content

Scroll up when collapsing labels#31755

Merged
bl-nero merged 1 commit intomasterfrom
bl-nero/scroll-into-view
Sep 13, 2023
Merged

Scroll up when collapsing labels#31755
bl-nero merged 1 commit intomasterfrom
bl-nero/scroll-into-view

Conversation

@bl-nero
Copy link
Copy Markdown
Contributor

@bl-nero bl-nero commented Sep 12, 2023

This is an UX improvement to keep the user focused on the card they're viewing when they scroll down a large list of labels.

Demo: https://www.loom.com/share/f37b52fa0c054419aad336df6d142fe8

This is an UX improvement to keep the user focused on the card they're viewing
when they scroll down a large list of labels.
@bl-nero bl-nero requested a review from avatus September 12, 2023 14:41
@bl-nero bl-nero requested review from rosstimothy and removed request for ibeckermayer and ravicious September 12, 2023 14:42
@bl-nero
Copy link
Copy Markdown
Contributor Author

bl-nero commented Sep 12, 2023

Context: this was one part of @rosstimothy 's feedback that I had at the back of my head, and it was bugging me for a while. I'm not sure if this addresses the concern, so I'm awaiting your judgement here. :)

Copy link
Copy Markdown
Contributor

@avatus avatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as intended after testing. I like it!

Comment on lines +152 to +156
// If the user expanded the labels and then scrolled down enough to hide the
// top of the card, we scroll back up and collapse the labels with a small
// delay to keep the user from losing focus on the card that they were
// looking at. The delay is picked by hand, since there's no (easy) way to
// know when the animation ends.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came to the PR here looking for "why is there a delay for this card closing?" because it was jarring to me, but after reading this comment, I agree with the approach. Thanks for changing my mind

@bl-nero bl-nero added this pull request to the merge queue Sep 13, 2023
Merged via the queue into master with commit 93d7ae7 Sep 13, 2023
@bl-nero bl-nero deleted the bl-nero/scroll-into-view branch September 13, 2023 09:31
avatus pushed a commit that referenced this pull request Sep 15, 2023
This is an UX improvement to keep the user focused on the card they're viewing
when they scroll down a large list of labels.
github-merge-queue Bot pushed a commit that referenced this pull request Sep 16, 2023
* Ad a storybook for the Unified Resources screen (#31213)

* Add a mock service worker Storybook add-on

* Add a Resources story

* Add the license

* Lint fix

* Scroll up when collapsing labels (#31755)

This is an UX improvement to keep the user focused on the card they're viewing
when they scroll down a large list of labels.

* Only show copy button on hover (#31920)

---------

Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants