Skip to content

Add sector descriptions and refresh the canonical sector list#1703

Merged
maebeale merged 1 commit into
mainfrom
maebeale/sector-descriptions
Jun 17, 2026
Merged

Add sector descriptions and refresh the canonical sector list#1703
maebeale merged 1 commit into
mainfrom
maebeale/sector-descriptions

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

What is the goal of this PR and why is this important?

  • Service areas (sectors) need a short clarification beyond their name, just like categories already have, so respondents understand options on the public registration form.
  • The canonical sector list was also out of date and needed to match the current set of service-area tags.

How did you approach the change?

  • Added a description column to Sector (migration + admin form, show, and index, mirroring the category pattern) and surfaced it on the public registration form: as subtext under each checkbox in the additional service-areas list, and folded into a Name (description) label in the single primary service-area dropdown (which can't show subtext).
  • Refreshed SECTOR_TYPES to the current tags, moved the parenthetical clarifications into seeded descriptions, and made seeding unpublish sectors no longer on the list (preserving historical taggings) while keeping the Other catch-all published.

UI Testing Checklist

  • Sector admin: create/edit shows and saves the Description field; show and index display it.
  • Public registration form, additional service areas (checkboxes): descriptions render as subtext.
  • Public registration form, primary service area (dropdown): options render as Name (description).

Anything else to add?

  • Two apparent typos in the supplied list were corrected: tag Systems/Policy Change (was "Sytems") and the Climate/Environmental description environmental trauma (was "envirnomental"). Flagging in case either was intentional.

Sectors gain an optional description so a service area can carry a short
clarification, the way categories already do. On the public registration form
the description shows as subtext under each checkbox in the additional
service-areas list, and is folded into a "Name (description)" label in the
single primary service-area dropdown, which can't show subtext.

The canonical SECTOR_TYPES list is refreshed to the current service-area tags,
with the parenthetical clarifications moved into seeded descriptions. Sectors no
longer on the list are unpublished rather than destroyed, preserving historical
taggings; the "Other" catch-all stays published.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread db/seeds.rb
# taggings rather than destroying them. SECTOR_TYPES already includes the "Other"
# catch-all, so it stays published.
canonical_names = Sector::SECTOR_TYPES.map(&:downcase)
Sector.reject { |sector| canonical_names.include?(sector.name.downcase) }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Sectors dropped from the canonical list are unpublished here, not destroyed, so historical taggings survive. Other stays published because it's the free-text catch-all for additional service areas, not a selectable tag.

<% dropdown_options.each do |option_label, option_value| %>
<option value="<%= option_value %>" <%= "selected" if value == option_value %>><%= option_label %></option>
<%# A dropdown can't show subtext, so an option's description is folded into
the label as "Name (description)". %>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: A dropdown can't show subtext, so a sector/category description is folded into the label as "Name (description)" here; the checkbox/radio renderers instead show it as gray subtext under the option.

@maebeale maebeale merged commit 28a125c into main Jun 17, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/sector-descriptions branch June 17, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant