Skip to content

Show the primary service area consistently with a starred chip#1698

Merged
maebeale merged 5 commits into
mainfrom
maebeale/scholarship-primary-sector-crown
Jun 16, 2026
Merged

Show the primary service area consistently with a starred chip#1698
maebeale merged 5 commits into
mainfrom
maebeale/scholarship-primary-sector-crown

Conversation

@maebeale

@maebeale maebeale commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

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

  • A person's primary service area — the one they singled out on their registration form — was displayed inconsistently and often indistinguishable from their other sectors.
  • This gives the primary sector one consistent treatment everywhere it appears: a darker-green chip led by a gold star (matching the chip editor, where star = primary) with the standard hover state.

How did you approach the change?

  • Shared chip (sectors/_tagging_label): added an is_primary local (defaults false). When set, the chip renders with a gold star (fa-star) + darker-green fill (bg-lime-200) and a "Primary service area" tooltip. All other callers are unaffected.
  • Scholarship recipients page: sectors render primary-first (sectorable_items_primary_first), with the primary starred — read-only.
  • Person profile: collapsed the two-column "Primary sector / Additional sectors" layout into one primary-first "Sectors" list; primary leads as the starred chip, followed by additional sectors and any free-text "Other" responses.
  • People index/search: shows only the primary sector as the starred chip, keeping the table scannable (the full set lives on the profile).
  • Event staff cards: replaced the plain compact sector badges with the same shared chip — primary first and starred.
  • Seed (record_professional_answers): the first submitted service area becomes each registrant's single primary SectorableItem (demoting any other first), so demo data matches what they selected on the form.

Rebase note

Rebased onto main, which now includes #1700 ("Show 'Other' service-area answers as additional sectors"). That's not a duplicate — it tweaked the old two-column profile layout to move the "Other" chip into the Additional column. Our single combined list already achieves that intent (the "Other" free-text chip renders after all sectors, never under/with the primary), so we kept our layout and realigned #1700's request spec to assert the Other chip renders as a free-text (other) chip rather than keying off the now-removed "Additional sectors" heading. #1700's seed change (excluding_other) is complementary and preserved.

Out of scope (follow-up PRs)

  • Event Background/Dashboard primary-sector charts — left as-is per request.
  • Organization sector views — left as-is per request.

UI Testing Checklist

  • Recipients page: primary shows first as a darker-green starred chip; others light-lime
  • Person profile: single "Sectors" list, primary first and starred, "Other" responses still shown
  • People index: only the primary sector renders, as the starred chip
  • Event staff cards: primary sector first and starred
  • Other sector listings (workshops, logs, taggings) unchanged

Anything else to add?

  • Branch name says "crown" — the marker is a star (star = primary, crown = leader in this codebase); renaming post-creation would close the PR, so it's left as-is.
  • Added view specs for the default and primary (starred) chip.

@maebeale maebeale marked this pull request as ready for review June 16, 2026 21:09
# registration form. Demote any other primary first to keep exactly one (a person
# registered for several events is enriched once per event). Idempotent.
primary_sector = sectors.first
if primary_sector

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: Demoting any other primary before setting this one keeps exactly one primary even when a person is enriched once per event they registered for — otherwise a multi-event registrant could end up with two starred sectors.

<% display_leader ||= false %>

<% bg_color ||= DomainTheme.bg_class_for(:sectors) %>
<% is_primary ||= false %>

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: is_primary defaults to false, so the ~10 existing callers of this partial render unchanged; only the recipients page opts in.

@maebeale maebeale changed the title Highlight recipients' primary service area with a star Show the primary service area consistently with a starred chip Jun 16, 2026
maebeale and others added 4 commits June 16, 2026 17:37
The scholarship recipients page listed every sector identically, so a
recipient's primary service area — the one they singled out on the
registration form — was indistinguishable from the rest. Show it first
with a gold star and a darker-green fill, mirroring the chip editor on
the person edit page (minus the remove control).

Seed the first submitted service area as the person's single primary
SectorableItem so the demo data exercises this state.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The person profile split sectors into "Primary sector" / "Additional
sectors" columns; the people search table listed them flat. Both now
render a single primary-first list reusing the recipients-page chip — the
primary sector leads as a darker-green starred chip — so the primary
reads the same way everywhere it appears.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Listing every sector made the search table noisy. Show just the primary
sector as the darker-green starred chip — the same treatment used on the
profile and recipients page — keeping the index scannable while the full
set stays on the profile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Event staff cards listed sectors as plain compact badges with no primary
distinction. Use the shared tagging_label chip — primary first, starred
and darker — so the staff cards match the recipients page and the rest of
the app.

Also realign the people "Other" response spec with the profile's single
combined Sectors list (the two-column layout is gone): assert the Other
answer renders as a free-text "(other)" chip rather than the starred
primary, instead of keying off the removed "Additional sectors" heading.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/scholarship-primary-sector-crown branch from c17a2f7 to 1b24054 Compare June 16, 2026 21:40
@maebeale

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-06-16 at 5 44 22 PM Screenshot 2026-06-16 at 5 45 15 PM Screenshot 2026-06-16 at 5 46 30 PM

The person profile's sectors block is now a single "Sectors" list instead
of the "Primary sector" / "Additional sectors" columns, so the visibility
spec keyed off the old heading. Point it at the new heading.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale merged commit c09b527 into main Jun 16, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/scholarship-primary-sector-crown branch June 16, 2026 21:54
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