Skip to content

feat(forms): rating-family field types (stars, NPS, slider, emoji) — slice 9a#61

Merged
Musiker15 merged 1 commit into
mainfrom
feat/slice-9a-rating-fields
Jun 21, 2026
Merged

feat(forms): rating-family field types (stars, NPS, slider, emoji) — slice 9a#61
Musiker15 merged 1 commit into
mainfrom
feat/slice-9a-rating-fields

Conversation

@Musiker15

Copy link
Copy Markdown
Member

First Phase 2 slice — new field types. Adds star rating, NPS (0–10), slider, and emoji scale.

Approach

All four answer with a number on a bounded scale resolved by one shared helper scaleBounds(field) in @msk-forms/shared, so the renderer widgets, server-side validation, and the answer formatter can't drift.

Changes

  • sharedscaleBounds, EMOJI_SCALE, SCALE_FIELD_TYPES, NPS_MIN/MAX; added step to field validation. buildAnswerSchema enforces per-type bounds (NPS 0–10 incl. 0, emoji 1–5, stars 1–max [default 5], slider min/max [default 0–100]). formatAnswerValue renders stars/NPS/emoji with their scale.
  • web — renderer widgets StarRating / ScaleButtons / SliderInput; wired the four cases in FieldInput; builder offers the new types with star-max and slider min/max/step config; DE/EN field-type labels + builder strings.
  • tests — scale validation for all four types + formatter output (shared now 16 tests).

Validation

pnpm typecheck, pnpm lint, pnpm test, pnpm build — all green.

Follow-ups in this slice: matrix (9b), signature (9c).

…slice 9a

First batch of Phase 2 field types. All four answer with a number on a bounded
scale resolved by a single shared `scaleBounds` helper, so the renderer widgets,
server-side validation, and answer formatter stay in sync.

- shared: `scaleBounds`, `EMOJI_SCALE`, `SCALE_FIELD_TYPES`, NPS constants; add
  `step` to field validation; `buildAnswerSchema` enforces per-type scale bounds
  (NPS 0–10 incl. 0, emoji 1–5, stars 1–max default 5, slider min/max default
  0–100); `formatAnswerValue` renders stars/NPS/emoji with their scale.
- web: renderer widgets (`StarRating`, `ScaleButtons`, `SliderInput`); wire the
  four cases in `FieldInput`; builder offers the new types with star-max and
  slider min/max/step config; DE/EN labels + builder strings.
- tests: scale validation for all four types + formatter output.

Follow-ups: matrix (9b), signature (9c).
@Musiker15 Musiker15 merged commit 8fb6d58 into main Jun 21, 2026
3 checks passed
@Musiker15 Musiker15 deleted the feat/slice-9a-rating-fields branch June 21, 2026 11:57
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