feat(formplayer): Likert scale and duration question types (#693)#695
Merged
IamLRBA merged 7 commits intoJul 2, 2026
Merged
Conversation
Add built-in `likert` and `duration` formats to the formplayer (same pattern as photo/gps/signature, not app-bundle custom types). Likert scale (format: "likert"): - Displays: buttons, radio, slider, numeric, stars, emoji - Standard, clean look across all variants: neutral outlined cells with accent (border + tint + bold) only on the selected option - colorMode neutral | spectrum (semantic accent on selection) | stars - Presets, endpoint-labels-only, allowClear, allowNotApplicable - Responsive wrapping for tablet/phone widths Duration/timer (format: "duration"): - Stopwatch, countdown, manual modes; value stored as seconds - Explicit Save on stopwatch before commit Registered in App.tsx (customRenderers + addFormat) and FinalizeRenderer for readonly/review display. Includes unit tests and Storybook stories.
- Standard survey styling: pill affordance, slider value badge (n/N), inline N/A with icon, review-mode de-emphasis of unselected options - Responsive layouts: phone stacking, cols-2…cols-5 via choiceLayout, default horizontal when orientation omitted - Numeric scales auto-show verbal endpoint anchors when configured - Emoji always paired with text label; spectrum accent on selection - Add LikertJsonSchema/LikertOneOfEntry types and schema helpers for Storybook/tests; fix TS2353 errors on likert/emoji properties - Stronger integration tests asserting committed observation JSON - Storybook: readonly review, two-column layout, mobile variants
Avoid indexing an optional parameter type (TS2339) by annotating the story helper's likert arg as LikertConfig directly.
…rt-and-duration # Conflicts: # formulus-formplayer/src/renderers/FinalizeRenderer.tsx
Move form-author configuration reference for the likert/duration question types to the docs site; keep only dev-oriented file/Storybook locations in the formplayer README.
Use CSS grid for word and emoji scales so every option stays the same width on tablets, normalize schemas for Not applicable validation, and wire ui.json option translations into Likert labels.
Run Prettier on Likert tests, stories, and related source so formplayer format:check passes in CI.
IamLRBA
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds built-in
format: "likert"andformat: "duration"question types to formplayer (same pattern as photo/gps/signature — not app-bundle custom types).Closes #692
Closes #693
Likert scale
buttons,radio,slider,numeric,stars,emojiui.jsonoptions.orientation:horizontal(default),vertical,flow,cols-2…cols-5allowClear; readonly/review stylingoneOf[].const(integer, ornullfor N/A)FinalizeRenderershows human-readable label in reviewDuration / timer
stopwatch,countdown,manualTest plan
pnpm exec vitest run— 162 tests passpnpm exec tsc --noEmitcleanpnpm run lintcleanpnpm run build:copyand smoke test on Android emulator with AnthroCollectode_question_types_demo