From 1d9f8d88fd720907e85539be37e940242358bfb0 Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Wed, 30 Sep 2026 20:32:52 -0400 Subject: [PATCH 1/8] AO3-7611 Update Wrangling Tools page heading --- config/locales/views/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml index a9556d4bee9..f5c868b9e56 100644 --- a/config/locales/views/en.yml +++ b/config/locales/views/en.yml @@ -3122,7 +3122,7 @@ en: tw_wranglers_slack: "#tw-wranglers" wrangle_to_guidelines_html: Wrangle tags in accordance with the %{wrangling_guidelines_link}. wrangling_guidelines: wrangling guidelines - page_heading: Tag Wrangling + page_heading: Wrangling Tools wrangler_dashboard: characters_by_fandom: Characters by fandom (%{count}) fandoms_by_media: Fandoms by media (%{count}) From 34864e1d815621bdafe1b76b3733fc0bf698f9db Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Thu, 1 Oct 2026 01:39:04 +0000 Subject: [PATCH 2/8] AO3-7611 Set Wrangling Tools page title --- app/controllers/tag_wranglings_controller.rb | 40 ++++++++++---------- config/locales/controllers/en.yml | 1 + 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/app/controllers/tag_wranglings_controller.rb b/app/controllers/tag_wranglings_controller.rb index db971163f16..4e32d9308f8 100644 --- a/app/controllers/tag_wranglings_controller.rb +++ b/app/controllers/tag_wranglings_controller.rb @@ -9,6 +9,7 @@ class TagWranglingsController < ApplicationController def index @counts = tag_counts_per_category authorize :wrangling, :read_access? if logged_in_as_admin? + @page_subtitle = t(".wrangling_tools_page_subtitle") return if params[:show].blank? raise "Redshirt: Attempted to constantize invalid class initialize tag_wranglings_controller_index #{params[:show].classify}" unless Tag::USER_DEFINED.include?(params[:show].classify) @@ -38,16 +39,18 @@ def index def wrangle authorize :wrangling, :full_access? if logged_in_as_admin? - params[:page] = '1' if params[:page].blank? - params[:sort_column] = 'name' if !valid_sort_column(params[:sort_column], 'tag') - params[:sort_direction] = 'ASC' if !valid_sort_direction(params[:sort_direction]) - options = {show: params[:show], page: params[:page], sort_column: params[:sort_column], sort_direction: params[:sort_direction]} + params[:page] = "1" if params[:page].blank? + params[:sort_column] = "name" unless valid_sort_column(params[:sort_column], "tag") + params[:sort_direction] = "ASC" unless valid_sort_direction(params[:sort_direction]) + options = { show: params[:show], page: params[:page], sort_column: params[:sort_column], sort_direction: params[:sort_direction] } - error_messages, notice_messages = [], [] + error_messages = [] + notice_messages = [] # make tags canonical if allowed if params[:canonicals].present? && params[:canonicals].is_a?(Array) - saved_canonicals, not_saved_canonicals = [], [] + saved_canonicals = [] + not_saved_canonicals = [] tags = Tag.where(id: params[:canonicals]) tags.each do |tag_to_canonicalize| @@ -58,20 +61,21 @@ def wrangle end end - error_messages << ts('The following tags couldn\'t be made canonical: %{tags_not_saved}', tags_not_saved: not_saved_canonicals.collect(&:name).join(', ')) unless not_saved_canonicals.empty? - notice_messages << ts('The following tags were successfully made canonical: %{tags_saved}', tags_saved: saved_canonicals.collect(&:name).join(', ')) unless saved_canonicals.empty? + error_messages << ts("The following tags couldn't be made canonical: %{tags_not_saved}", tags_not_saved: not_saved_canonicals.collect(&:name).join(", ")) unless not_saved_canonicals.empty? + notice_messages << ts("The following tags were successfully made canonical: %{tags_saved}", tags_saved: saved_canonicals.collect(&:name).join(", ")) unless saved_canonicals.empty? end - if params[:media] && !params[:selected_tags].blank? + if params[:media] && params[:selected_tags].present? options.merge!(media: params[:media]) @media = Media.find_by_name(params[:media]) @fandoms = Fandom.find(params[:selected_tags]) @fandoms.each { |fandom| fandom.add_association(@media) } elsif params[:fandom_string].blank? && params[:selected_tags].is_a?(Array) && !params[:selected_tags].empty? - error_messages << ts('There were no Fandom tags!') + error_messages << ts("There were no Fandom tags!") elsif params[:fandom_string].present? && params[:selected_tags].is_a?(Array) && !params[:selected_tags].empty? - canonical_fandoms, noncanonical_fandom_names = [], [] - fandom_names = params[:fandom_string].split(',').map(&:squish) + canonical_fandoms = [] + noncanonical_fandom_names = [] + fandom_names = params[:fandom_string].split(",").map(&:squish) fandom_names.each do |fandom_name| if (fandom = Fandom.find_by_name(fandom_name)).try(:canonical?) @@ -91,17 +95,15 @@ def wrangle end canonical_fandom_names = canonical_fandoms.collect(&:name) - options.merge!(fandom_string: canonical_fandom_names.join(',')) - notice_messages << ts('The following tags were successfully wrangled to %{canonical_fandoms}: %{tags_saved}', canonical_fandoms: canonical_fandom_names.join(', '), tags_saved: saved_to_fandoms.collect(&:name).join(', ')) unless saved_to_fandoms.empty? + options.merge!(fandom_string: canonical_fandom_names.join(",")) + notice_messages << ts("The following tags were successfully wrangled to %{canonical_fandoms}: %{tags_saved}", canonical_fandoms: canonical_fandom_names.join(", "), tags_saved: saved_to_fandoms.collect(&:name).join(", ")) unless saved_to_fandoms.empty? end - if noncanonical_fandom_names.present? - error_messages << ts('The following names are not canonical fandoms: %{noncanonical_fandom_names}.', noncanonical_fandom_names: noncanonical_fandom_names.join(', ')) - end + error_messages << ts("The following names are not canonical fandoms: %{noncanonical_fandom_names}.", noncanonical_fandom_names: noncanonical_fandom_names.join(", ")) if noncanonical_fandom_names.present? end - flash[:notice] = notice_messages.join('
').html_safe unless notice_messages.empty? - flash[:error] = error_messages.join('
').html_safe unless error_messages.empty? + flash[:notice] = notice_messages.join("
").html_safe unless notice_messages.empty? + flash[:error] = error_messages.join("
").html_safe unless error_messages.empty? redirect_to tag_wranglings_path(options) end diff --git a/config/locales/controllers/en.yml b/config/locales/controllers/en.yml index a82b7329b55..d66cad26877 100644 --- a/config/locales/controllers/en.yml +++ b/config/locales/controllers/en.yml @@ -394,6 +394,7 @@ en: tag_wranglings: index: page_subtitle: fandoms + wrangling_tools_page_subtitle: Wrangling Tools tags: index: collection_page_title: "%{collection_title} - Tags" From 237430ad077ae16e14abeea1ac39c9fdfc711af8 Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Thu, 1 Oct 2026 01:43:38 +0000 Subject: [PATCH 3/8] AO3-7611 Revert unrelated formatting changes --- app/controllers/tag_wranglings_controller.rb | 39 ++++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/app/controllers/tag_wranglings_controller.rb b/app/controllers/tag_wranglings_controller.rb index 4e32d9308f8..88c4bb8bd2a 100644 --- a/app/controllers/tag_wranglings_controller.rb +++ b/app/controllers/tag_wranglings_controller.rb @@ -39,18 +39,16 @@ def index def wrangle authorize :wrangling, :full_access? if logged_in_as_admin? - params[:page] = "1" if params[:page].blank? - params[:sort_column] = "name" unless valid_sort_column(params[:sort_column], "tag") - params[:sort_direction] = "ASC" unless valid_sort_direction(params[:sort_direction]) - options = { show: params[:show], page: params[:page], sort_column: params[:sort_column], sort_direction: params[:sort_direction] } + params[:page] = '1' if params[:page].blank? + params[:sort_column] = 'name' if !valid_sort_column(params[:sort_column], 'tag') + params[:sort_direction] = 'ASC' if !valid_sort_direction(params[:sort_direction]) + options = {show: params[:show], page: params[:page], sort_column: params[:sort_column], sort_direction: params[:sort_direction]} - error_messages = [] - notice_messages = [] + error_messages, notice_messages = [], [] # make tags canonical if allowed if params[:canonicals].present? && params[:canonicals].is_a?(Array) - saved_canonicals = [] - not_saved_canonicals = [] + saved_canonicals, not_saved_canonicals = [], [] tags = Tag.where(id: params[:canonicals]) tags.each do |tag_to_canonicalize| @@ -61,21 +59,20 @@ def wrangle end end - error_messages << ts("The following tags couldn't be made canonical: %{tags_not_saved}", tags_not_saved: not_saved_canonicals.collect(&:name).join(", ")) unless not_saved_canonicals.empty? - notice_messages << ts("The following tags were successfully made canonical: %{tags_saved}", tags_saved: saved_canonicals.collect(&:name).join(", ")) unless saved_canonicals.empty? + error_messages << ts('The following tags couldn\'t be made canonical: %{tags_not_saved}', tags_not_saved: not_saved_canonicals.collect(&:name).join(', ')) unless not_saved_canonicals.empty? + notice_messages << ts('The following tags were successfully made canonical: %{tags_saved}', tags_saved: saved_canonicals.collect(&:name).join(', ')) unless saved_canonicals.empty? end - if params[:media] && params[:selected_tags].present? + if params[:media] && !params[:selected_tags].blank? options.merge!(media: params[:media]) @media = Media.find_by_name(params[:media]) @fandoms = Fandom.find(params[:selected_tags]) @fandoms.each { |fandom| fandom.add_association(@media) } elsif params[:fandom_string].blank? && params[:selected_tags].is_a?(Array) && !params[:selected_tags].empty? - error_messages << ts("There were no Fandom tags!") + error_messages << ts('There were no Fandom tags!') elsif params[:fandom_string].present? && params[:selected_tags].is_a?(Array) && !params[:selected_tags].empty? - canonical_fandoms = [] - noncanonical_fandom_names = [] - fandom_names = params[:fandom_string].split(",").map(&:squish) + canonical_fandoms, noncanonical_fandom_names = [], [] + fandom_names = params[:fandom_string].split(',').map(&:squish) fandom_names.each do |fandom_name| if (fandom = Fandom.find_by_name(fandom_name)).try(:canonical?) @@ -95,15 +92,17 @@ def wrangle end canonical_fandom_names = canonical_fandoms.collect(&:name) - options.merge!(fandom_string: canonical_fandom_names.join(",")) - notice_messages << ts("The following tags were successfully wrangled to %{canonical_fandoms}: %{tags_saved}", canonical_fandoms: canonical_fandom_names.join(", "), tags_saved: saved_to_fandoms.collect(&:name).join(", ")) unless saved_to_fandoms.empty? + options.merge!(fandom_string: canonical_fandom_names.join(',')) + notice_messages << ts('The following tags were successfully wrangled to %{canonical_fandoms}: %{tags_saved}', canonical_fandoms: canonical_fandom_names.join(', '), tags_saved: saved_to_fandoms.collect(&:name).join(', ')) unless saved_to_fandoms.empty? end - error_messages << ts("The following names are not canonical fandoms: %{noncanonical_fandom_names}.", noncanonical_fandom_names: noncanonical_fandom_names.join(", ")) if noncanonical_fandom_names.present? + if noncanonical_fandom_names.present? + error_messages << ts('The following names are not canonical fandoms: %{noncanonical_fandom_names}.', noncanonical_fandom_names: noncanonical_fandom_names.join(', ')) + end end - flash[:notice] = notice_messages.join("
").html_safe unless notice_messages.empty? - flash[:error] = error_messages.join("
").html_safe unless error_messages.empty? + flash[:notice] = notice_messages.join('
').html_safe unless notice_messages.empty? + flash[:error] = error_messages.join('
').html_safe unless error_messages.empty? redirect_to tag_wranglings_path(options) end From af00df958a7bde9d4d5b00edbbc5ae8c9d5806ae Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Thu, 1 Oct 2026 02:38:10 +0000 Subject: [PATCH 4/8] AO3-7611 Add test for Wrangling Tools page title and heading --- features/tags_and_wrangling/tag_wrangling_more.feature | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/features/tags_and_wrangling/tag_wrangling_more.feature b/features/tags_and_wrangling/tag_wrangling_more.feature index b19cfcc48fe..819a37f0515 100644 --- a/features/tags_and_wrangling/tag_wrangling_more.feature +++ b/features/tags_and_wrangling/tag_wrangling_more.feature @@ -417,3 +417,11 @@ Feature: Tag wrangling: assigning wranglers, using the filters on the Wranglers And I should see "1" within "td[title='unwrangled characters']" And I should see "Freeforms by fandom (0)" And I should see "Characters by fandom (1)" + + Scenario: browser page title and page heading appears as "Wrangling Tools" in Wrangling Tools page + Given I am logged in as a tag wrangler + When I go to the wrangling tools page + Then I should see "Wrangling Tools" within "h2.heading" + And I should not see "Tag Wrangling" within "h2.heading" + And I should see the page title "Wrangling Tools" + And the page title should not include "Tag Wranglings" \ No newline at end of file From e29b139c5da9133dcd9dd6620770ff799fa431cc Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Thu, 1 Oct 2026 17:42:45 +0000 Subject: [PATCH 5/8] AO3-7611 Re-trigger CI From aa500df66664316975464d6e807a005ff344ebd1 Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Mon, 19 Oct 2026 15:20:28 -0400 Subject: [PATCH 6/8] Update page subtitle translations in tag controller --- app/controllers/tag_wranglings_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/tag_wranglings_controller.rb b/app/controllers/tag_wranglings_controller.rb index 88c4bb8bd2a..4394a91e4db 100644 --- a/app/controllers/tag_wranglings_controller.rb +++ b/app/controllers/tag_wranglings_controller.rb @@ -9,7 +9,7 @@ class TagWranglingsController < ApplicationController def index @counts = tag_counts_per_category authorize :wrangling, :read_access? if logged_in_as_admin? - @page_subtitle = t(".wrangling_tools_page_subtitle") + @page_subtitle = t(".page_title.wrangling_tools") return if params[:show].blank? raise "Redshirt: Attempted to constantize invalid class initialize tag_wranglings_controller_index #{params[:show].classify}" unless Tag::USER_DEFINED.include?(params[:show].classify) @@ -19,7 +19,7 @@ def index if params[:show] == "fandoms" @media_names = Media.by_name.pluck(:name) - @page_subtitle = t(".page_subtitle") + @page_subtitle = t(".page_title.fandoms") end type = params[:show].singularize.capitalize From ae60b61bcd118428030179238ba1c443ffabc077 Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Mon, 19 Oct 2026 15:31:16 -0400 Subject: [PATCH 7/8] Refactor subtitles to structured titles in en.yml Updated page subtitles to use structured titles for fandoms and wrangling tools. --- config/locales/controllers/en.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/locales/controllers/en.yml b/config/locales/controllers/en.yml index d66cad26877..9a0ec5e8c01 100644 --- a/config/locales/controllers/en.yml +++ b/config/locales/controllers/en.yml @@ -393,8 +393,9 @@ en: other: Could not assign fandoms %{fandom_list}. Non-canonical fandoms cannot be assigned. tag_wranglings: index: - page_subtitle: fandoms - wrangling_tools_page_subtitle: Wrangling Tools + page_title: + fandoms: Fandoms + wrangling_tools: Wrangling Tools tags: index: collection_page_title: "%{collection_title} - Tags" From c836fa9f7ab8dbaa8b7be3bc74e72586134886b7 Mon Sep 17 00:00:00 2001 From: MAYONIE123 Date: Mon, 19 Oct 2026 15:33:23 -0400 Subject: [PATCH 8/8] Update wrangling tools page title assertions Removed assertions about 'Tag Wrangling' from the scenario. --- features/tags_and_wrangling/tag_wrangling_more.feature | 2 -- 1 file changed, 2 deletions(-) diff --git a/features/tags_and_wrangling/tag_wrangling_more.feature b/features/tags_and_wrangling/tag_wrangling_more.feature index 819a37f0515..402336a8bf7 100644 --- a/features/tags_and_wrangling/tag_wrangling_more.feature +++ b/features/tags_and_wrangling/tag_wrangling_more.feature @@ -422,6 +422,4 @@ Feature: Tag wrangling: assigning wranglers, using the filters on the Wranglers Given I am logged in as a tag wrangler When I go to the wrangling tools page Then I should see "Wrangling Tools" within "h2.heading" - And I should not see "Tag Wrangling" within "h2.heading" And I should see the page title "Wrangling Tools" - And the page title should not include "Tag Wranglings" \ No newline at end of file