There are so many topics posted in my community in one particular category.
Sometimes people find it annoying and want to remove it from the home page.
However, even these users are not completely uninterested in those categories, nor do they want to use mute to block them completely.
So I came up with two approaches.
1: Place a checkbox on the top page to select whether or not to display a particular category.
2: Instead of muting that category, display the number of New Topics in the muted category on the home page. Users can immediately see the category by clicking on that particular category tab added to the navigation bar.
As a matter of fact, I could display the number of New Topics in 2, but I found out right after the completion of the component that I could not get the number of New Topics in the muted categoryā¦ I forgot to check the muted categoryā¦
So I am considering approach 1 next, but I donāt know how the top page query works or how to hide certain categoriesā¦
Or even a solution for approach 2 (how to get the number of New Topics in the Muted category) would be fine.
The css was a blind spot, but I just tried a few things and it doesnāt seem to work very well.
I am not a native English speaker, so I guess I didnāt explain it well enough.
In the 1, the notification must be set below Normal and certain categories must be hidden.
In CSS, I can get the category class and hide it, but it seems to erase Watching and Tracking as wellā¦ I will try to find a way to give a class based on each topicās notification settings.
Also, I did a little research and it seems that the ability to remove categories from the top was a heavily debated feature about 2 years ago and has been removed and replaced with mute.
I think those who were against replacing it entirely with a mute were right. Mute is a nice feature. But the gap between normal and mute is too large and mute leaves the category far behind.
Something in between would have been nice to have another notification setting.
At any rate, it seems that by default, the display of all notification settings is suppressed.
This is still functional (although in hindsight, CSS is not bad too), but I will try to perfect it and see if it is possible to hide only normal and mute notification settings.
Since itās a plugin, there seems to be room for improvement, so Iāve regained a little motivation. Thank you very much.
One more idea - limit this category for particular group only and give users an option to join it when they need it.
Or to be joined by default and stop group participation when they donāt wont to see it anymore.
I looked into the plugin a bit and it doesnāt look easyā¦ I looked inside result = Topic::ActiveRecord and it doesnāt look like it contains any data related to notifications.
Furthermore, I wonder if it is possible to get the information for individual topics from here and get the notification_level.
Iāve created plugins that also involve some Ruby, but Iāve relied mostly on Javascript, so I donāt know much about Ruby.
Maybeā¦ Iād like to foreach the contents of the āresultā to get detailed information about each topic, and record the topic IDs of only those topics whose notification_level is āTrackingā or āWatchingā and store them in the list, and add to the where clause āOR I imagine it would work well if you use topics.topic_id IN (#{topic_ids.join(ā,ā)ā. I know itās not very pretty code, and Iām not familiar with Ruby, so Iām not sure if it would workā¦
Iāll go find a way to call Topic by ID from Ruby.
I donāt understand everything at all properly, but somehow it worked.
In case anyone else wants to do the same thing, Iāll leave it here.
Line 17 of plugin.rb of the plugin that JammyDodger taught me.
result.where("topics.category_id NOT IN (#{category_ids.join(",")})")
to the
result.where("topics.category_id NOT IN (#{category_ids.join(",")}) OR tu.notification_level IN (2,3)")
The āTrackingā and āWatchingā topics remain on the top page, but the āNomarlā topic is hidden from the top page.
It took a while because I did not understand ActiveRecord properly, but if I had communicated the problem properly, it might have been an easy problem for you.
Iām not 100% sure Iām following this, but if you ādefault muteā a category from the default categories muted admin setting, it sounds like that already does a similar thing? The topics wonāt appear in the Latest list, but are all visible if you go to the category page. And if a user interacts with one so it becomes tracking or watching, then those ones do show up in their topic lists.
I created a component to get this topic count, but realized that Mute does not get NewTopics count because muted topic is not counted in NewTopics.
I created a component to get this topic count, but I noticed that Mute does not get NewTopics, so I could not get the number of new topics.
That is why I was looking for a way to prevent it from showing up on the top page with the notification setting Nomarl.
This may be a special situation. For a given category, there are an undesirable number of unread topics on the home page, while defaulting to Mute makes it difficult to notice new topics and drives users away from the category excessively. We didnāt want to do that because a large number of topics on the top page means a very thriving category.
Perhaps this is a problem that should have been solved by educating the users, but we wanted to do what we could anyway, and we are glad that we managed to meet the requirements.