Skip to content

Summarize number form questions on the results page - #2477

Merged
maebeale merged 1 commit into
mainfrom
maebeale/form-results-numeric-stats
Sep 1, 2026
Merged

Summarize number form questions on the results page#2477
maebeale merged 1 commit into
mainfrom
maebeale/form-results-numeric-stats

Conversation

@maebeale

@maebeale maebeale commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 one new aggregator report kind + a stat card; contained, well-tested

The form results page now rolls up number-typed questions into average / total / responses, instead of listing every raw figure as free text. So a count question like "individuals served" reads as a report (e.g. "average 54, total 20,287 across 379 responses").

What / why

  • New :number report kind in FormResponseAggregator for number_integer / number_decimal fields — before, both fell through to the free-text branch and rendered as raw-number lists.
  • Computes average, total (sum), min–max range, and answered count; drops blank/non-numeric stray values.
  • New forms/_numeric_card stat card showing Average / Total / Responses (+ range).

Notes for reviewer

  • No new field type or migration — this is purely the results rendering catching up to numeric answers.
  • Decimals are preserved for number_decimal fields; integer/whole-number fields display without decimals.

Anything else to add?

Follow-up once the slider type (#2462) merges: a small change wires sliders into this same numeric rollup and adds percentage framing (average with a % + a 0–100 fill bar). Keeping that out of here so this PR stands alone on main.

@maebeale
maebeale changed the base branch from maebeale/annual-evaluation-form-seed to main September 1, 2026 15:01
@maebeale maebeale changed the title Summarize numeric form questions on the results page Summarize number form questions on the results page Sep 1, 2026
@maebeale
maebeale force-pushed the maebeale/form-results-numeric-stats branch from 0c8601e to 5ac4379 Compare September 1, 2026 15:02
@maebeale
maebeale marked this pull request as ready for review September 1, 2026 15:03
Number-typed fields fell through to the free-text branch, so the results page
listed every raw figure instead of rolling them up. Aggregate them into
average / total / responses so a count question like "individuals served"
reads as a report.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/form-results-numeric-stats branch from 5ac4379 to 7056727 Compare September 1, 2026 16:43
@maebeale
maebeale merged commit a1553aa into main Sep 1, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/form-results-numeric-stats branch September 1, 2026 17:06
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