Conversation
Copilot
AI
changed the title
[WIP] Add optional default parameters for all UI forms
Add typed default values for all form response types and wire them into UI initialization
Mar 2, 2026
|
🪓 PR closed, deleted preview. |
Co-authored-by: JackWilb <36867477+JackWilb@users.noreply.github.com>
Co-authored-by: JackWilb <36867477+JackWilb@users.noreply.github.com>
9f001c4 to
f163fd9
Compare
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.
This issue adds optional defaults across UI form responses so Study Designers can prepopulate inputs in study configs, including complex matrix defaults. The parser types now model these defaults, and response initialization applies them consistently in form state.
Parser/type surface: add
defaultto form-capable responsessrc/parser/types.tsto add optionaldefaulton:numerical,shortText,longText,likertdropdown,slider,radio,checkbox,buttonsmatrix-radio/matrix-checkbox(typed as row-keyed defaults)ranking-*responsesRecord<string, string | string[]>Form initialization: apply defaults centrally
generateInitFieldsinsrc/components/response/utils.tsto seed values fromresponse.defaultwhen no stored answer exists.paramCapturequery values.Matrix defaults: normalize to existing internal encoding
"a|b"), matching current matrix checkbox storage/dispatch behavior.Reset behavior (
withDontKnow): reset back to configured defaultsResponseSwitcherreset path to reuse the same default-normalization logic so toggling “I don’t know” restores configured defaults (instead of always empty values).Schema + focused test updates
StudyConfigSchema.jsonandLibraryConfigSchema.jsonto expose the newdefaultfields.src/components/response/utils.spec.tswith default-initialization coverage, including matrix checkbox normalization.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.