Links to Categories from sidebar inappropriately ignore configured category appearance settings

AI-generated summary

A bug was reported where sidebar links to categories ignored configured appearance settings, forcing users to /l/latest instead of respecting the category’s Default List Filter (e.g., no subcategories). nathank noted the sidebar intelligently routes to /l/unread, /l/new, or /l/latest depending on content, but lacked support for /none when subcategories are hidden. tgxworld confirmed it was a simple fix and submitted a PR [7], which was merged [8]. nathank confirmed the fix preserves behavior for unread/new links, and tgxworld clarified that contextual routing (e.g., routing to unread/new) is no longer used for sidebar category links, ensuring consistent behavior. Stephen raised a question about compatibility with theme components like the kanban board that alter default views, though no answer was provided in this thread. The fix ensures category appearance settings—including filters like no subcategories—are now respected when clicking sidebar links.

I’ve got some categories configured so that the Default List Filter no subcategories, and this works great for most links to the categories.

However, the sidebar sends the user to /c/category-slug/catID/l/latest. This url forces a vanila ‘Latest’ view, which isn’t what I want.

It would make sense to me to instead send the user to /c/category-slug/catID so that Category Appearance configuration is respected.

3 Likes

@tgxworld do you know if this would be a simple change? Or is there some reason we use the current URL that would require a bit more work to untangle?

1 Like

Probably a simple change but I’ll have a poke at it first.

2 Likes

On looking at it in more depth, I see that the sidebar is pretty clever.

  • If there are ‘unread’ displaying in the sidebar, it takes you to /l/unread
  • If there are ‘new’ displaying in the sidebar, it takes you to /l/new
  • If there is nothing displaying in the sidebar, it takes you to /l/latest

What is missing is the /none/ bit in my links when the Default List Filter is no subcategories.

1 Like

I have a PR to fix this

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

4 Likes

@nathank The fix has been merged :slight_smile: Thank you for reporting this :+1:

3 Likes

Thanks Alan!

Does it still respect this stuff when one clicks the sidebar when it displays unread or new?

Yes because we no longer have contextual routing for the sidebar section links where the link may sometimes route to unread/new.

1 Like

How will this interact with things like the kanban board, where the default view can be changed by the theme component?

This topic was automatically closed after 4 days. New replies are no longer allowed.