Skip to content

Make the search sidebar stick to the top - #3968

Open
thatbudakguy wants to merge 1 commit into
mainfrom
sticky-facets
Open

thatbudakguy wants to merge 1 commit into
mainfrom
sticky-facets

Conversation

@thatbudakguy

Copy link
Copy Markdown
Member

This lets you interact with the facets more easily when you have
a long page of results. Has no effect on smaller screens or when
the facets are put away.

@thatbudakguy

Copy link
Copy Markdown
Member Author
Screen.Recording.2026-11-23.at.10.26.29.mov

@jrochkind

Copy link
Copy Markdown
Member

What happens if the sidebar is too long to fit on screen? I've had really annoying behavior on a lot of sites that try to stick sidebar in that cases.

@maxkadel

Copy link
Copy Markdown
Contributor

@sandbergja - I remember that the sticky elements were an issue for a few different accessibility tools, am I remembering right? Was there a good way to mitigate it? I do like the idea of avoiding super long scrolls.

This lets you interact with the facets more easily when you have
a long page of results. Has no effect on smaller screens or when
the facets are put away.

When the facet sidebar has enough facets expanded that it's
taller than the page, it becomes scrollable on its own. This
doesn't affect the search result scrolling.
@thatbudakguy

Copy link
Copy Markdown
Member Author

When the facet sidebar gets too long, it becomes independently scrollable. Here's a video:

Screen.Recording.2026-11-23.at.11.30.34.mov

@jrochkind

Copy link
Copy Markdown
Member

Intersting, thanks.

It looks to me like the sidebar is capped shorter than the viewport, to become scrollable? That seems weird to me?

Screenshot 2026-11-23 at 2 40 23 PM

Not as bad as some behavior I've seen for this case with people trying to make sidebars fixed -- the worst is when you ahve to scroll all the way to the bottom of main content in order to get bottom of sidebar!

But I'm not sure i love it or think it's succesful?

Curious if there are any sizes of screen where the gap between sidebar scrolling area bottom and viewport bottom becomes even more annoying. Not sure what's going on, haven't debugged, just watching video.

If I'm in the minority and most stakeholders love this (or there's user-testing to suggest it as succesful UI?), I suppose I can always just disable it in CSS. Perhaps make it easy to disable in CSS with a variable or documentation or something?

@thatbudakguy

Copy link
Copy Markdown
Member Author

Not sure what you mean – in that picture the total height of the sidebar is taller than the viewport, which is why it's scrollable. The bottom of the sidebar's scrollable area is just above the bottom of the viewport.

If the sidebar was allowed to take the full viewport height without scrolling, it would be too tall: it would extend past the bottom of the viewport, because the header pushes it down about 120px already, so it would extend 120px past the bottom of the viewport.

@jrochkind

jrochkind commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Hm, I sor tof see wha tyou mean... I am getting very confused, maybe just demonstrating how I find find this sort of thing confusing -- when sidebar is higher than viewport. It is not confusing when sidebar is not.

But... what determines the actual scrollable height of the sidebar then? At what point does it scroll? it's locked ot the top of screen, and scrolling, but it's bottom is NOT at bottom of screen... what determines where it's bottom is then?

If the sidebar is not as tall as viewport, it isn't an issue, it's always as tall as it actually is, and alwyas entirely on screen, which is the point of this PR right?

But when the sidebar is taller than viewport... are you saying it can then be scrolled to be only partially in the viewport itself, but then also independently scrollable itself?

This is very confusing to talk about, which is why I tried to draw a picture, but that was maybe confusing too. Or maybe I'm just confused. At any rate, I think I find this UI confusing? (in cases where sidebar is taller than viewport; when not, I find it straightforward and nice).

@thatbudakguy

Copy link
Copy Markdown
Member Author

I think running the PR locally (and perhaps looking at the changed CSS) might give you the clarity you need here. It's hard to talk about!

@maxkadel

Copy link
Copy Markdown
Contributor

I want to start by thanking you for spending time on default Blacklight look and feel! I think it hasn't been a focus for awhile, and having it be nicer out of the box is always nice.

That being said, I think I might be with @jrochkind on this one - I'm not sure this is a generally desired change, so perhaps we should either make it configurable and default to having it off, or maybe you could share more info on why it's generally desirable?

@thatbudakguy

Copy link
Copy Markdown
Member Author

That's fair! I think it's desirable because, in its default state, blacklight has pages of results that run far past where the facet area is. When you scroll down to view those results, you stop being able to access the facet area unless you scroll back up again.

I originally worked on this for geoblacklight, because there you have a facet (the bounding box facet) that is important enough that you nearly always want it on screen, even when it doesn't have a value active. @jcoyne suggested upstreaming that work using the capability to modify the sidebar's @classes, which was recently added to core. If it doesn't make sense in core, I'm OK with that.

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