Skip to content

Theme event dashboard cards and count only allocated scholarships#1578

Merged
maebeale merged 5 commits into
mainfrom
maebeale/scholarship-totals-dashboard
Jun 7, 2026
Merged

Theme event dashboard cards and count only allocated scholarships#1578
maebeale merged 5 commits into
mainfrom
maebeale/scholarship-totals-dashboard

Conversation

@maebeale
Copy link
Copy Markdown
Collaborator

@maebeale maebeale commented Jun 6, 2026

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

  • The event dashboard's grand total double-counted scholarships. Outstanding scholarships (tasks not yet complete) aren't applied to allocations, so their registrants' cost still sits in outstanding registration fees — adding their dollars again pushed the grand total above the event's full-price total.
  • Card colors were hardcoded per card, drifting from the shared palette.
  • Several money figures were ambiguous (was a number cash-collected or did it include amounts still owed?).

How did you approach the change?

  • Grand total now sums allocated scholarships only (allocated_scholarship_cents), so it reconciles to total_cents (the full-price value of active registrations). This uses the awarded amount of scholarships whose tasks are complete, matching the "Completed & allocated" figure shown on the card — superseding the raw applied-allocation sum from Exclude unapplied scholarships from the event grand total #1580 with the more meaningful figure.
  • The scholarship card shows the full amount "potentially awarded" with the "awarded" (allocated) portion called out separately, so awarded-but-pending dollars stay visible.
  • Registration fees and cont ed headlines gained an "including due" caveat so the figures aren't misread as cash-collected.
  • Routed every dashboard card's border/text/background color through DomainTheme (added payments, scholarships, continuing_education, event_dashboard, addresses mappings) so the palette lives in one place; extended the Tailwind safelist with the hover border/text variants the helpers generate.
  • Headcount-card icons (Registrants, Organizations, Sectors, States) sized to text-xs to match the money-card header icons.
  • Updated EventDashboard specs to cover the allocated-only grand total and the still-full "potentially awarded" amount.

UI Testing Checklist

  • Paid event dashboard: grand total equals registration fees + allocated scholarships + cont ed fees, and matches the full-price total
  • Scholarship card shows "potentially awarded" total plus the "awarded" (allocated) amount
  • Registration fees and cont ed headlines show the "including due" caveat
  • All card colors render correctly (no missing Tailwind classes)
  • Headcount-card icons match the size of the money-card icons

Anything else to add?

Rebased onto main after #1580 (which fixed the same grand-total bug); this branch keeps that fix but switches it to allocated_scholarship_cents and layers the theming + label clarifications on top.

Copilot AI review requested due to automatic review settings June 6, 2026 21:44
Comment thread app/services/event_dashboard.rb Outdated
# above the full-price total_cents.
def grand_total_cents
registration_subtotal_cents + scholarship_total_cents + cont_ed_total_cents
registration_subtotal_cents + completed_scholarship_cents + cont_ed_total_cents
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: Grand total counts completed scholarships only. Incomplete ones aren't applied to allocations, so their share is already captured as outstanding registration fees — including scholarship_total_cents here would double-count and push the total above total_cents.

@maebeale maebeale marked this pull request as ready for review June 6, 2026 21:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the event dashboard’s money equation so the grand total reflects only scholarship dollars that are actually applied (completed), while centralizing dashboard card theming through DomainTheme to prevent palette drift.

Changes:

  • Update EventDashboard#grand_total_cents to sum completed scholarship dollars (avoids double-counting pending scholarship awards).
  • Refactor event dashboard card styling to use DomainTheme (borders/backgrounds/text) and align headcount icon sizing.
  • Expand EventDashboard specs to cover completed-only grand total while still reporting the full scholarship award total.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/services/event_dashboard_spec.rb Updates expectations to use completed_scholarship_cents for grand total and adds coverage for the “full awarded vs completed” split.
lib/domain_theme.rb Adds theme keys used by the event dashboard cards so colors come from the shared palette.
app/views/events/dashboard.html.erb Switches hardcoded Tailwind color classes to DomainTheme helpers; updates scholarship display to show total awarded plus completed (“issued”) amount.
app/services/event_dashboard.rb Changes grand total computation to include only completed scholarships; adds completed/outstanding scholarship helper methods.
app/frontend/stylesheets/application.tailwind.css Expands Tailwind inline source patterns to include hover: variants for dynamically generated border/text theme classes.

Comment thread app/views/events/dashboard.html.erb Outdated
Comment thread app/views/events/dashboard.html.erb Outdated
Comment on lines +127 to +129
<span class="text-2xl sm:text-3xl font-bold <%= DomainTheme.text_class_for(:scholarships, intensity: 700) %> tabular-nums"><%= number_to_currency(@dashboard.scholarship_total_cents / 100.0) %></span>
<span class="text-xs text-gray-500">potentially issued</span>
</p>
Comment thread app/views/events/dashboard.html.erb Outdated
Comment on lines +131 to +133
<p class="text-xs text-gray-500 mt-0.5">
<span class="font-semibold <%= DomainTheme.text_class_for(:scholarships, intensity: 700) %> tabular-nums"><%= number_to_currency(@dashboard.completed_scholarship_cents / 100.0) %></span> issued
</p>
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: Done — the label now reads "awarded" (sentence case) instead of "issued". The card shows the full "$X potentially awarded" with the allocated "$X awarded" portion below.

Comment thread spec/services/event_dashboard_spec.rb Outdated
Comment on lines +229 to +230
it "still reports the full scholarship amount issued, including incomplete" do
expect(dashboard.scholarship_total_cents).to eq(20_000)
Wire every dashboard money/headcount card color through DomainTheme instead
of hard-coded Tailwind utilities, so the dashboard stays in step with the
app-wide palette. Adds the missing keys (payments, scholarships,
continuing_education, event_dashboard, addresses) and extends the Tailwind
safelist with the hover border/text variants the helpers now generate.

Clarify the scholarship card: the headline is the full amount "potentially
awarded", with the allocated portion ("awarded", tasks complete) surfaced
separately since only that flows into the grand total. Registration fees and
cont ed headlines gain an "including due" caveat so the figures aren't read as
cash-collected.

Grand total counts allocated_scholarship_cents (renamed from
completed_scholarship_cents) rather than #1580's raw applied-allocation sum:
the awarded amount of allocated scholarships is the meaningful figure and
matches the "Completed & allocated" amount the dashboard shows, keeping the
equation internally consistent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/scholarship-totals-dashboard branch from 8403d72 to 508bb33 Compare June 6, 2026 22:29
@maebeale maebeale changed the title Theme event dashboard cards and count only completed scholarships Theme event dashboard cards and count only allocated scholarships Jun 6, 2026
maebeale and others added 2 commits June 6, 2026 20:03
- Collapse each money card (Registration fees / Scholarships / Continuing
  education fees) into a chevron-expandable details: it shows just the total
  by default and expands to Paid/Due (or Completed & allocated / Incomplete &
  unallocated) sub-rows, which in turn expand to per-registrant lists with
  per-person amounts.
- Add a Collected / Due / Monies cash summary beside the grand total
  (collected + due = monies; scholarships are excluded since they're awarded,
  not collected).
- Clarify scholarship copy ("including unallocated"; "Completed & allocated" /
  "Incomplete & unallocated") and rename "Cont ed fees" to "Continuing
  education fees".
- Registrant names now jump to the manage list filtered to that one person,
  with a name + organization tooltip, instead of the profile page.
- "<n> inactive" links to the matching manage list with a jump icon.
- Wrap the addend cards on smaller screens.

Backed by EventDashboard methods (collected/due/monies_made_cents,
inactive_registrant_ids, organization_names_by_registrant, and the per-recipient
/ per-registrant breakdown maps) with specs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- New db/seeds/dev/scholarships.rb seeds scholarships across the paid dev
  events, mixing completed (allocation funded) and pending ($0 allocation) so
  the dashboard shows allocated vs unallocated scholarship dollars. Only funds
  registrations with no allocations yet, so a full or partial award fits within
  the event cost (the allocation validation rejects over-allocation).
- Wire db:seed:scholarships into dev.rake (run order after payments, plus a
  standalone task).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale and others added 2 commits June 6, 2026 20:07
Make AWBW Facilitator Training a $1,500 event with a 15-registrant cohort so
the scholarship seeds have room to award 10 full/partial scholarships across
allocation-free registrations. Keep cost in sync on re-seed (find_or_create_by!
only sets it on create), and top up generated cohort registrants idempotently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The dashboard now labels the card "Continuing education fees" (was "Cont ed
fees"); update the request-spec assertion to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maebeale maebeale merged commit 47e3a1e into main Jun 7, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/scholarship-totals-dashboard branch June 7, 2026 00:51
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.

2 participants