Select tag, change category, tag still selected

AI-generated summary

A bug has been reported in the Discourse tagging system, where changing categories does not reset the tag filter. GSeven first encountered the issue and wondered if it was a bug or intended behavior. Both GSeven and neil agree that the tag filter should reset when changing categories, especially since tags can be category-specific.

GSeven further explained the issue, noting that the URL becomes stuck in .com/tags/c/ mode until the user navigates back to the homepage. GSeven suggested that even changing sub-categories should reset the tag filter.

neil acknowledged the issue and promised to address it, despite initial hesitation due to the complexity of the underlying Ember.js router code. However, neil later reported that the fix was surprisingly simple and involved removing the offending code.

I’ve been getting lots of amazing help from @cpradio today, and i came across an issue with tags.

I’m unsure if it is a bug or working as intended, so i’m going to post this here to get a bit of discourse team feedback on it.

When i select a category, then a subcategory, then a tag, everything filters properly. However, if i change category from the category selector, the tag is still present in the new category results.

the url changes like this:

select category: .com/c/soccer
select subcategory: .com/c/soccer/mancity
select tag: .com/tags/c/soccer/mancity/sergioaguero
select a different category: .com/tags/c/swimming/sergioaguero

i was wondering if the tag selection should reset on entering a new category?, like it does if you go ‘home’ and select a new category.

3개의 좋아요

Not sure what people want to happen when they change the category filter while the tag filter is set. I tend to agree with you that the tag filter should reset.

There are other issues, like this one, that may be related to this bug.

2개의 좋아요

I think the nail in the coffin to support that is the fact that you can have category specific tags, so when changing to another category, the prior selected tag might not be valid anymore. Which brings up a really good reason to reset it on that condition.

5개의 좋아요

Yes Neil, changing categories with a tag set, means you are stuck in .com/tags/c/ mode, no matter how many times you change category or change tags or even with tags: none, until you go home and begin again.

Changing category should, i think, reset the url to .com/c/

3개의 좋아요

Does the Discourse team this will get changed in the future?

I would go as far to say that even if you change sub-category,
the tag filter should reset.

Yes, sorry that I keep dropping this one down my todo list. The ugly ember.js router code I wrote scares me every time I look at it. Will try to get this one done.

3개의 좋아요

absolutely no problem at all, just making sure i can plan ahead knowing something will happen eventually.

good luck mate

:fonzie:

jk, easiest bug fix ever! Removing the ugly router code that implements that behaviour was the solution.

9개의 좋아요