Skip to content

Add scholarships statistics report + shared filters - #2053

Merged
maebeale merged 9 commits into
mainfrom
maebeale/shareable-report-partial
Aug 6, 2026
Merged

Add scholarships statistics report + shared filters#2053
maebeale merged 9 commits into
mainfrom
maebeale/shareable-report-partial

Conversation

@maebeale

@maebeale maebeale commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 5 Inspect 🔬 new scholarship statistics report + service, app-wide funded/unfunded rule change (affects revenue), all-time headline change across all three reports, shared report filters incl. funder remote-select across two pages, migration, and Stimulus

Goal

Add a Scholarships statistics report (sibling to Revenue and Participation) and thread scholarship reporting/filters through the existing /scholarships index.

What it does

  • /events/scholarships (admin, linked from the statistics hub): one card, one row per facilitator training. When several years are in scope they become per-year subheader/subtotal rows ending in an all-time total; selecting All time titles the card "All facilitator trainings". Columns: Registrants attended and funded/unfunded/total for # of awards and $. A ?view= toggle swaps the separate #/$ columns for combined count-over-dollars cells. Fuchsia-branded.
  • Drill-in: the per-training Registrants attended number opens that training's registrants (attended filter) in the same tab; the roster eyebrow returns to the exact report row — scrolled to and highlighted — with the report's filters/toggle restored (registrants-style, via EventsHelper paths).
  • Funded/unfunded, app-wide: unfunded = no grant or a grant the org funded itself (AWBW, via Organization.awbw) — applied in EventDashboard + EventRevenueFigures, so revenue agrees.
  • All-time headline: all three reports (scholarships, revenue, participation) now aggregate every year on "All time" instead of pinning the KPI headline to the current year.
  • /scholarships index: gains the shared report filters (time period, training, event search) plus a funder filter (remote-select over people/orgs), a scholarship KPI strip, Status moved left of Training, and whole-row click → edit.
  • Shared _report_filters + funder filter across both pages; one Event search box matches abbreviation or title.
  • Recipients page gains a Statistics link-button (next to Grants) → the scholarships report.
  • Statistics + revenue/participation/scholarships pages widened to match the event manage pages; hub revenue Net card breakdown inlined onto the total row.

Notes for reviewers

  • Revenue figures shift where an AWBW-funded grant backed a scholarship (now org subsidy, not "money in"). Intended.
  • Attended count stays whole-training (attendance isn't funder-specific).
  • Report grouping is calendar year. Prior-year dev seeds added so grouping/all-time have data.
  • .impeccable.md documents the table view-toggle patterns (segmented nav + sliders).

Tests

Report services (funder + AWBW scoping, all-time featured aggregate across all three reports), EventDashboard/EventRevenueFigures funded/unfunded, Organization.awbw, Scholarship scopes, requests (both pages incl. funder/search filters, combined view, hub card), routing, page_bg_class.

Copilot AI lite review requested due to automatic review settings August 2, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

# nil year that sorts last.
def years
@years ||= @events
.group_by { |event| event.start_date&.year }

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: Grouping is by calendar year (matches EventRevenueReport). If a training cycle (Nov → Mar → Jul) should read as one program/school year instead, this is the line to change.

@maebeale
maebeale force-pushed the maebeale/shareable-report-partial branch from cf582f1 to c0c59b1 Compare August 4, 2026 05:55
Copilot AI review requested due to automatic review settings August 4, 2026 05:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Turns the manually-maintained per-training summary spreadsheet into a
reusable partial: scholarship dollars and award counts (funded vs
unfunded) plus trainee counts, one column per facilitator training,
grouped by year. Trainee counts split into "2-Day" (scheduled) vs
"On-Demand" totals via a new event.on_demand flag.

Rendered on the cross-event revenue page and a new standalone,
shareable report page (/events/facilitator_training_report).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 4, 2026 05:56
@maebeale
maebeale force-pushed the maebeale/shareable-report-partial branch from c0c59b1 to 443cef5 Compare August 4, 2026 05:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Makes scholarships a third statistics report alongside revenue and
participation (linked from the hub as a summary card), instead of a
facilitator-training report embedded in the hub:

- Report per facilitator training, grouped by year, with the shared
  time-period + event filters plus an abbreviation substring search.
- Counts scholarship $ and # (awards), funded vs unfunded, and attended
  trainees split Training (scheduled) vs On-demand.
- Funded/unfunded now treats a grant the org donated to itself (AWBW,
  via new Organization.awbw) as unfunded/subsidy — applied app-wide in
  EventDashboard and EventRevenueFigures, so revenue agrees.
- Drops the unused on_demand/scheduled scopes (kept the column + flag).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 4, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale changed the title Add shareable facilitator training report (scholarships + trainees) Add an Events scholarships statistics report Aug 4, 2026
maebeale and others added 2 commits August 4, 2026 11:36
- Brand the scholarships report to the fuchsia domain theme (icon + label
  per section) instead of ad-hoc rose/amber/yellow; wrap long training
  titles to two lines then truncate.
- Scholarships index: move Status left of Training; make the whole
  recipient row navigate to the scholarship edit page (clickable-row
  Stimulus controller), keeping the name link for keyboard access.
- Edit-page header: render the recipient as a profile button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add the same report filters (time period, training, abbreviation) to
  the /scholarships index, plus a new funder filter on both the index and
  the events scholarship report, via a remote-select over people/orgs and
  a shared _report_filters partial.
- Surface the scholarship summary (KPI strip, extracted to a partial) at
  the top of /scholarships.
- Funder scoping runs through the data: Scholarship.from_funder/for_events
  scopes, an EventDashboard scholarship_donor: option, and a funder-aware
  EventScholarshipReport, so both the list and the report reflect it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 4, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale changed the title Add an Events scholarships statistics report Add scholarship statistics report + shared filters Aug 4, 2026
Replace the clickable-row Stimulus controller with a no-JS stretched
link: the row is the positioned ancestor and the recipient link's ::before
covers it, so clicking anywhere follows that one link.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 5, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The clickable-row idiom in _payment_history / link_organization uses
after:absolute after:inset-0; align the scholarship row to it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 5, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The three-stacked-table layout repeated the event columns for every metric,
which was hard to read. Rework into one row per facilitator training so the
figures scan left-to-right, and make the report reshape to the task:

- One card for the whole report; years become subheader/subtotal rows (with an
  all-time total) instead of a separate card each, so "All time" reads as a
  single table. Card title switches to "All facilitator trainings" for all-time.
- A layout toggle (?view=) swaps separate #/$ columns for combined count-over-
  dollars cells, server-driven so the choice is shareable.
- All-time no longer pins the KPI headline to the current year — it aggregates
  every training ("All trainings").
- "Registrants attended" (was "Attended") clarifies it counts all attendees, not
  just recipients; the per-training numbers link into the registrants roster
  (attended filter), with a matching eyebrow back to the report.
- One "Event search" box matches abbreviation OR title (was abbreviation-only).
- Statistics + revenue/participation/scholarships pages widened to match the
  event manage pages.
- Seed prior-year trainings so the year grouping and all-time have real data.
- Document the table view-toggle patterns (segmented nav + sliders) in .impeccable.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 5, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale maebeale changed the title Add scholarship statistics report + shared filters Add scholarships statistics report + shared filters Aug 5, 2026
Follow-ups on the scholarships report:

- The per-training "Registrants attended" numbers now open the registrants
  roster in the same tab (attended filter) and the roster's eyebrow returns to
  the exact report row — scrolled to and highlighted — with the report's
  filters/toggle restored (registrants-style, via new EventsHelper paths).
- Revenue and Participation reports now aggregate every year on "All time"
  ("All events") instead of pinning the KPI headline to the current year,
  matching the scholarships fix.
- Recipients page gains a "Statistics" link-button next to Grants → the
  scholarships report.
- Statistics-hub revenue Net card: inline the fees/scholarships/subsidy
  breakdown on the total row so the card stays three rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 5, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The amount-laden breakdown wrapped onto a third row, making the Net card taller
than its siblings. Replace it with a two-line formula (fees + scholarships,
funded added / unfunded subtracted) that stays within three rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 6, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@maebeale
maebeale marked this pull request as ready for review August 6, 2026 15:55
@maebeale
maebeale merged commit c38f37d into main Aug 6, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/shareable-report-partial branch August 6, 2026 15:55
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