From 0c0229ee53e66a597700a478a4dc935473df7762 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Thu, 6 Nov 2025 12:21:38 +1000 Subject: [PATCH 1/3] UX: Rename Favorite Tags/Categories to Most Viewed Tags/Categories This was confusing people last year, most people assumed it meant the tags they used the most / categories they posted in the most. This should clear things up. --- ...orite_categories.rb => most_viewed_categories.rb} | 8 ++++---- .../action/{favorite_tags.rb => most_viewed_tags.rb} | 8 ++++---- app/services/discourse_rewind/fetch_reports.rb | 4 ++-- ...ite-categories.gjs => most-viewed-categories.gjs} | 10 +++++----- .../{favorite-tags.gjs => most-viewed-tags.gjs} | 10 +++++----- assets/javascripts/discourse/components/rewind.gjs | 12 ++++++------ assets/stylesheets/common/_index.scss | 4 ++-- assets/stylesheets/common/favorite-tags.scss | 4 ++-- ...e-categories.scss => most-viewed-categories.scss} | 4 ++-- config/locales/client.en.yml | 12 ++++++------ 10 files changed, 38 insertions(+), 38 deletions(-) rename app/services/discourse_rewind/action/{favorite_categories.rb => most_viewed_categories.rb} (83%) rename app/services/discourse_rewind/action/{favorite_tags.rb => most_viewed_tags.rb} (85%) rename assets/javascripts/discourse/components/reports/{favorite-categories.gjs => most-viewed-categories.gjs} (67%) rename assets/javascripts/discourse/components/reports/{favorite-tags.gjs => most-viewed-tags.gjs} (70%) rename assets/stylesheets/common/{favorite-categories.scss => most-viewed-categories.scss} (82%) diff --git a/app/services/discourse_rewind/action/favorite_categories.rb b/app/services/discourse_rewind/action/most_viewed_categories.rb similarity index 83% rename from app/services/discourse_rewind/action/favorite_categories.rb rename to app/services/discourse_rewind/action/most_viewed_categories.rb index 641ae18..6aa6ebe 100644 --- a/app/services/discourse_rewind/action/favorite_categories.rb +++ b/app/services/discourse_rewind/action/most_viewed_categories.rb @@ -3,7 +3,7 @@ # Topics visited grouped by category module DiscourseRewind module Action - class FavoriteCategories < BaseReport + class MostViewedCategories < BaseReport FakeData = { data: [ { category_id: 1, name: "cats" }, @@ -12,12 +12,12 @@ class FavoriteCategories < BaseReport { category_id: 4, name: "management" }, { category_id: 5, name: "things" }, ], - identifier: "favorite-categories", + identifier: "most-viewed-categories", } def call return FakeData if Rails.env.development? - favorite_categories = + most_viewed_categories = TopicViewItem .joins(:topic) .joins("INNER JOIN categories ON categories.id = topics.category_id") @@ -30,7 +30,7 @@ def call .pluck("categories.id, categories.name") .map { |category_id, name| { category_id: category_id, name: name } } - { data: favorite_categories, identifier: "favorite-categories" } + { data: most_viewed_categories, identifier: "most-viewed-categories" } end end end diff --git a/app/services/discourse_rewind/action/favorite_tags.rb b/app/services/discourse_rewind/action/most_viewed_tags.rb similarity index 85% rename from app/services/discourse_rewind/action/favorite_tags.rb rename to app/services/discourse_rewind/action/most_viewed_tags.rb index 112268d..a11661e 100644 --- a/app/services/discourse_rewind/action/favorite_tags.rb +++ b/app/services/discourse_rewind/action/most_viewed_tags.rb @@ -3,7 +3,7 @@ # Topics visited grouped by tag module DiscourseRewind module Action - class FavoriteTags < BaseReport + class MostViewedTags < BaseReport FakeData = { data: [ { tag_id: 1, name: "cats" }, @@ -12,13 +12,13 @@ class FavoriteTags < BaseReport { tag_id: 4, name: "management" }, { tag_id: 5, name: "things" }, ], - identifier: "favorite-tags", + identifier: "most-viewed-tags", } def call return FakeData if Rails.env.development? - favorite_tags = + most_viewed_tags = TopicViewItem .joins(:topic) .joins("INNER JOIN topic_tags ON topic_tags.topic_id = topics.id") @@ -32,7 +32,7 @@ def call .pluck("tags.id, tags.name") .map { |tag_id, name| { tag_id: tag_id, name: name } } - { data: favorite_tags, identifier: "favorite-tags" } + { data: most_viewed_tags, identifier: "most-viewed-tags" } end end end diff --git a/app/services/discourse_rewind/fetch_reports.rb b/app/services/discourse_rewind/fetch_reports.rb index a685231..ea4f434 100644 --- a/app/services/discourse_rewind/fetch_reports.rb +++ b/app/services/discourse_rewind/fetch_reports.rb @@ -26,8 +26,8 @@ class FetchReports Action::ReadingTime, Action::Reactions, Action::Fbff, - Action::FavoriteTags, - Action::FavoriteCategories, + Action::MostViewedTags, + Action::MostViewedCategories, Action::BestTopics, Action::BestPosts, Action::ActivityCalendar, diff --git a/assets/javascripts/discourse/components/reports/favorite-categories.gjs b/assets/javascripts/discourse/components/reports/most-viewed-categories.gjs similarity index 67% rename from assets/javascripts/discourse/components/reports/favorite-categories.gjs rename to assets/javascripts/discourse/components/reports/most-viewed-categories.gjs index 47bb41f..5d72a85 100644 --- a/assets/javascripts/discourse/components/reports/favorite-categories.gjs +++ b/assets/javascripts/discourse/components/reports/most-viewed-categories.gjs @@ -1,18 +1,18 @@ import { concat } from "@ember/helper"; import { i18n } from "discourse-i18n"; -const FavoriteCategories =