From a709908ed935bda3c8395e614a5818f7df9f258a Mon Sep 17 00:00:00 2001 From: maebeale Date: Thu, 25 Jun 2026 21:32:07 -0400 Subject: [PATCH 1/2] Show workshop sector filter labels in their stored casing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sector filter dropdown ran every label through .humanize, which flattened intentionally-cased sector names ("LGBTQIA+" → "Lgbtqia+", "Child Abuse/Neglect" → "Child abuse/neglect"). Render the label as stored so the dropdown matches the canonical name shown in the Sectors admin. Windows audience labels ("Adult"/"Children"/"Combined") are unaffected since they're already sentence case. Co-Authored-By: Claude Opus 4.8 --- app/views/workshops/_dropdown_filter.html.erb | 4 +++- spec/requests/workshops_spec.rb | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/views/workshops/_dropdown_filter.html.erb b/app/views/workshops/_dropdown_filter.html.erb index fa4fe75ff8..a6685dd8f1 100644 --- a/app/views/workshops/_dropdown_filter.html.erb +++ b/app/views/workshops/_dropdown_filter.html.erb @@ -40,8 +40,10 @@ params.dig(param_name, item.id.to_s).to_s == item.id.to_s, id: "#{param_name}_#{item.id}", class: "category-checkbox" %> + <%# Render the label as stored — sector names carry intentional casing + (e.g. "LGBTQIA+", "Child Abuse/Neglect") that .humanize would flatten. %> <%= label_tag "#{param_name}_#{item.id}", - item.public_send(label_method).humanize, + item.public_send(label_method), class: "text-sm text-gray-700" %> <% end %> diff --git a/spec/requests/workshops_spec.rb b/spec/requests/workshops_spec.rb index 655a429b1f..ad94252c32 100644 --- a/spec/requests/workshops_spec.rb +++ b/spec/requests/workshops_spec.rb @@ -40,6 +40,21 @@ end end + # --- SECTOR FILTER LABELS -------------------------------------------------- + describe "sector filter dropdown labels" do + let(:admin) { create(:user, :admin) } + let!(:sector) { create(:sector, :published, name: "LGBTQIA+") } + + before { sign_in admin } + + it "renders sector names with their canonical casing, not sentence case" do + get workshops_url + + expect(response.body).to include("LGBTQIA+") + expect(response.body).not_to include("Lgbtqia+") + end + end + # --- DESTROY --------------------------------------------------------------- describe "DELETE /destroy" do let(:user) { create(:user) } From 4350b502487fbbe71afda031568569c227aaab63 Mon Sep 17 00:00:00 2001 From: maebeale Date: Thu, 25 Jun 2026 21:36:17 -0400 Subject: [PATCH 2/2] Stop titleizing the sector name in the story shares header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same casing-distortion class as the workshops filter: .titleize flattened canonical sector names ("LGBTQIA+" → "Lgbtqia+", "Self-Care/Personal Growth" → "Self Care/Personal Growth") in the story-shares sector index header. Render the already-parsed @sector_names_all as-is instead. Co-Authored-By: Claude Opus 4.8 --- app/views/story_shares/_sector_index.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/story_shares/_sector_index.html.erb b/app/views/story_shares/_sector_index.html.erb index fb5741bc2b..ac50eb4c9f 100644 --- a/app/views/story_shares/_sector_index.html.erb +++ b/app/views/story_shares/_sector_index.html.erb @@ -3,7 +3,9 @@

- <%= params[:sector_names_all].to_s.titleize %> + <%# Sector names carry intentional casing ("LGBTQIA+", "Self-Care/Personal + Growth"); render them as stored rather than running .titleize. %> + <%= @sector_names_all.to_sentence %>

<% if @stories_by_sector.first.second.any? %>