Skip to content

Add a slider (0–100) form-field type, and use it for the evaluation - #2462

Open
maebeale wants to merge 6 commits into
mainfrom
maebeale/annual-evaluation-form-seed
Open

Add a slider (0–100) form-field type, and use it for the evaluation#2462
maebeale wants to merge 6 commits into
mainfrom
maebeale/annual-evaluation-form-seed

Conversation

@maebeale

@maebeale maebeale commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 new answer type + its rendering/validation, slider-aware results rollup, and the seed conversion

Adds a "Slider (0–100)" question type and wires it through the annual evaluation: the survey's percentage questions become drag-to-set sliders, and the results page summarizes them as percentages.

Builds on the merged numeric-results rollup (#2477) and the merged seed (#2479), both now on main.

What / why

  • Slider answer type (:slider, appended to the enum): a range handle with a live value bubble, 0–100, stored as a whole number, with server-side range validation. Renders on the public fill page + admin preview; selectable in the form-builder type dropdown; a slider Stimulus controller keeps the handle and value in sync.
  • Results rollup (FormResponseAggregator): sliders join number fields as numeric questions; a slider report is flagged percent, so forms/_numeric_card headlines the average with a % and draws a 0–100 fill bar. Count questions stay plain totals.
  • Seed: the evaluation's percentage questions are now sliders (ae_slider!); the yearly-reach counts stay number fields (ae_number!).

Notes for reviewer

  • A slider stores the same 0–100 whole number a number field would, so the seed conversion is presentation-only — no data or rollup change beyond the % framing.
  • Bounds are fixed 0–100 for now; per-field min/max/step is a clean follow-up.

Anything else to add?

Some percentage sliders inherit narrow widths (third/quarter) from when they were number inputs — they work but read tight; happy to widen them if you'd like.

@maebeale
maebeale marked this pull request as ready for review August 31, 2026 20:40
@maebeale
maebeale force-pushed the maebeale/annual-evaluation-form-seed branch 2 times, most recently from ad6bc32 to 38667bc Compare September 1, 2026 03:23
@maebeale
maebeale force-pushed the maebeale/annual-evaluation-form-seed branch 2 times, most recently from 1573dc5 to 1e37221 Compare September 1, 2026 17:14
@maebeale maebeale changed the title Add a slider (0–100) form-field answer type Add a slider (0–100) form-field type, and use it for the evaluation Sep 1, 2026
@maebeale
maebeale force-pushed the maebeale/annual-evaluation-form-seed branch 2 times, most recently from 159a190 to a79cc70 Compare September 1, 2026 19:39
maebeale and others added 6 commits September 1, 2026 15:40
The annual evaluation asks many "what percentage…" questions that read best
as a drag-to-set slider. The form builder had no numeric/slider input, so add
one as a first-class answer type the seed and admins can use.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dragging shows the picked number in a bubble above the handle instead of a
separate number input; the value is written to a hidden field.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The slider answer type had no seeded example, so there was nothing to
eyeball the widget or its submitted-answer display against without
hand-building a form.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Integer() accepts base prefixes and underscore separators, so a
hand-crafted "0x40" passed the range check and was stored verbatim;
match the strict-digits rule integer fields already use.

The feature entry and controller index still described the number box
that the value bubble replaced.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Now that the slider answer type exists, make the annual evaluation's percentage
questions sliders (the yearly-reach counts stay number fields), and teach the
results rollup to treat sliders as percentages:

- FormResponseAggregator: sliders join number fields as numeric questions, and a
  slider report is flagged `percent` so the card headlines the average with a %
  and draws a 0-100 fill bar.
- Seed: percentage questions become sliders via an ae_slider! helper; counts keep
  ae_number!.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/annual-evaluation-form-seed branch from a79cc70 to 8b774a7 Compare September 1, 2026 19:41
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