Skip to content

Show primary/additional age groups as chips on recipients page#1749

Merged
maebeale merged 2 commits into
mainfrom
maebeale/scholarship-agerange-display
Jun 18, 2026
Merged

Show primary/additional age groups as chips on recipients page#1749
maebeale merged 2 commits into
mainfrom
maebeale/scholarship-agerange-display

Conversation

@maebeale

@maebeale maebeale commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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

The scholarship recipients page rendered age ranges as a flat comma-separated string while sectors already showed the primary/additional chip treatment. Now that people carry a primary age-group distinction (categorizable_items.is_primary), the "Ages" strip renders the same starred-chip format so it reads in parallel with "Serves".

How did you approach the change?

recipients.html.erb now renders the shared age_group_tags partial from the person's primary_age_groups/additional_age_groups, falling back to the existing form-answer/profile text only when no age groups are tagged. EventDashboard#scholarship_applicants eager-loads categorizable_items so the chips avoid an N+1. The dev seed (people_profiles.rb) now tags the three demo accounts (Umberto, Amy, Aisha) with one primary age group plus a few additional, so the chips have real data to show — modeling the intended shape of one primary, optionally some additional.

UI Testing Checklist

  • On an event's recipients page, a recipient with tagged age groups shows them as chips (primary starred amber, additional gray), parallel to the sector chips
  • A recipient with no tagged age groups still shows the form-answer / profile text fallback
  • After reseeding dev, Amy/Aisha/Umberto each show a single starred primary age group on their profile and recipient cards

Anything else to add?

Editing connected age categories (including the primary toggle) already exists on the person edit form via shared/_category_checkbox; no change was needed there. Added a request spec asserting the chips render with the primary one starred. Note: the model and edit form currently allow more than one primary age group to be flagged — this PR seeds a single primary but does not enforce a one-primary constraint; happy to add that separately if desired.

@maebeale maebeale marked this pull request as ready for review June 18, 2026 19:00
@maebeale maebeale force-pushed the maebeale/scholarship-agerange-display branch from 9d15ef7 to 8e1f2da Compare June 18, 2026 19:08
maebeale and others added 2 commits June 18, 2026 16:02
The scholarship recipients page still rendered age ranges as a flat
comma-separated string while sectors already showed the primary/additional
chip treatment. Now that people carry a primary age-group distinction
(categorizable_items.is_primary), render the same starred-chip format so the
"Ages" strip reads in parallel with "Serves", falling back to the form
answer / profile text only when no age groups are tagged. Eager-load
categorizable_items on scholarship_applicants so the chips avoid an N+1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The new recipients chips read a person's profile age groups first, but the
three demo accounts (Umberto, Amy, Aisha) carried no age-range taggings, so the
display fell back to plain text for them. Tag each with one primary age group
(plus a few additional) so the starred-chip rendering has real data to show,
modeling the intended shape: one primary, optionally some additional.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/scholarship-agerange-display branch from 8e1f2da to 8faada9 Compare June 18, 2026 20:03
@maebeale maebeale merged commit 30809de into main Jun 18, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/scholarship-agerange-display branch June 18, 2026 20:09
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