Skip to content

Make Scrollbar collapse when not hovered#1771

Open
RagibHasin wants to merge 4 commits intolinebender:mainfrom
RagibHasin:doomscrolling
Open

Make Scrollbar collapse when not hovered#1771
RagibHasin wants to merge 4 commits intolinebender:mainfrom
RagibHasin:doomscrolling

Conversation

@RagibHasin
Copy link
Copy Markdown
Contributor

No description provided.

@RagibHasin RagibHasin marked this pull request as ready for review April 26, 2026 11:41
@RagibHasin RagibHasin requested a review from PoignardAzur April 26, 2026 11:49
@RagibHasin RagibHasin force-pushed the doomscrolling branch 2 times, most recently from d43da5b to 21d985b Compare April 27, 2026 17:03
@xStrom
Copy link
Copy Markdown
Member

xStrom commented Apr 28, 2026

The scrollbar should also not collapse when there is a scroll in progress without hover, i.e. grab_anchor.is_some(). That would match Firefox behavior as well.

Copy link
Copy Markdown
Contributor

@PoignardAzur PoignardAzur left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I'm not convinced it looks better, but the code change is idiomatic, and you're clearly more motivated to improve this code than me.

LGTM.

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 don't like how many screenshots are changed here. These screenshots in particular are pretty heavy. Could we make hovered scrollbars the default in tests instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general, having a collapsable scrollbar is a style choice. So having it be an optional configuration of the widget makes sense. So if we want to reduce the screenshot churn, one option would be to make it configurable right now and then we can have it not be collapsable in those tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We should migrate ScrollBar to use property system. Right now it does not do so at all. We can then have AutoCollapsible property that can be false by default.

What do you guys think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it can be a property, yes. I would also be fine with it being a simple bool on the struct just to get it working, if that is easier.

Copy link
Copy Markdown
Contributor

@PoignardAzur PoignardAzur left a comment

Choose a reason for hiding this comment

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

Forgot about the "user is grabbing the bar" case. That needs to be fixed before we can merge this.

Comment thread masonry/src/widgets/scroll_bar.rs Outdated
Comment thread masonry/src/widgets/scroll_bar.rs Outdated
@RagibHasin
Copy link
Copy Markdown
Contributor Author

As we are concerned about screenshot churn and repo size bloat, #1773 also touches some of these screenshots (specifically of Portal widget).
If that behavior is desired then it would be better to merge these two PRs for better management of screenshot churn.

@RagibHasin
Copy link
Copy Markdown
Contributor Author

Can we have a decision here, so that we can make progress?
@xStrom @PoignardAzur

@xStrom
Copy link
Copy Markdown
Member

xStrom commented May 7, 2026

I don't think it needs to be merged with #1773 because of the screenshot churn. Once that is rebased I would assume zero screenshot changes in that one, because you can just do screenshots with autohide disabled.

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