When categories set as home page, sidebar jumps down and "all categories" is highlighted

AI-generated summary

tobiaseigen reported a UX issue where the sidebar automatically jumps to and highlights “All Categories” when categories are set as the home page, obscuring the top menu links. This inconsistent behavior—occurring on full refreshes but not always during navigation—confuses new users who need to see crucial top-menu links. Tobiaseigen suggested the sidebar should remain stationary unless manually scrolled by the user.

Adam_Root identified this as a side effect of the sidebar automatically scrolling the active link into view. While suggesting a theme component as a temporary workaround, they recommended fixing it in Discourse itself to prevent automatic scroll position changes on the homepage. They noted the discrepancy between refresh and navigation states might relate to how scroll position is restored.

awesomerobot confirmed the issue is unintentional and announced that a fix is in progress. The update will exempt the sidebar from scrolling down when users land on the homepage, ensuring the top navigation remains visible without interfering with the active category highlight.

I’d like categories to be the default home page view on one of my sites, but when I set it that way the sidebar navigation tends to automatically jump down to “all categories” and highlighting it, obscuring the top part of the menu.

I am able to replicate this here:

  1. set categories to be your home page in your user preferences
  2. refresh the page when at meta.discourse.org
  3. see it jump down

I notice there are some cases when it does not jump down, which makes it even more confusing. For example, go to meta.discourse.org and see it jumps down. Scroll up now and select the logo or HOME and it does not scroll down. Sometimes when I click around on the site and go back home the sidebar remains correct, sometimes it does not.

The desired behavior, I think, is to not move the sidebar automatically in anyway but leave that to the user to do. Not sure though! But when someone logs in for the first time and is still finding their way around I want them to see and become acquainted with the entire sidebar including the top part which has crucial links on it.

1 Like

Hi @tobiaseigen

This looks like the sidebar is automatically scrolling to bring the active “All Categories” link into view when the page loads.

One possible workaround would be a small theme component customization that keeps the sidebar at the top on initial page load, while still allowing the active category to remain highlighted.

However, I think the better long-term solution would be to handle this in Discourse itself, so the sidebar doesn’t automatically change its scroll position when navigating to the homepage.

Since the behavior seems different between a full page refresh and normal navigation, it may be related to how the sidebar restores its scroll position. That would be worth checking before applying a custom fix.

2 Likes

Yes, this is an unintentional side effect of keeping the active sidebar link scrolled into view. I’ve got an update on the way that will exempt scrolling the sidebar down on the homepage:

https://github.com/discourse/discourse/pull/46297

1 Like