-
Notifications
You must be signed in to change notification settings - Fork 42
feat: Conditional Survey Logic (showIf) #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
- Add conditional visibility system for questions/sections - Refactor survey machine to handle visible question navigation - Extract SurveyActions component from survey-form - Refactor Steps to use machine context and visible sections - Add comprehensive tests for conditional logic - Update type definitions and disable inspector in test mode - Fix: restore auto-empty-array for unanswered multiple choice
✅ Deploy Preview for stateofdev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…o Astro - Add 51 unit tests for conditions.ts evaluation functions - Add blocking cross-reference validation for showIf conditions - Fix SectionList type to include questions property (remove any cast) - Convert theme-toggle from React to Astro component with vanilla JS
- Add eslint-disable no-console to files using console.log - Change console.warn to console.log for consistency - Remove unused console.warn from init-session API 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Deleted the validate-survey-questions.sh script and its associated workflow. - Introduced a new CI workflow (ci.yml) that includes linting, testing, and coverage reporting. - Removed the old lint.yml and validate-survey-questions.yml workflows to streamline CI processes.
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
Implements conditional visibility system for survey questions and sections based on previous answers, reducing survey length and improving response rates.
Changes
Conditional Visibility System (
src/lib/conditions.ts)showIfconditions for questions/sections with operators: equals, notEquals, in, notInSurvey Machine Refactoring
Component Updates
SurveyActionscomponent from survey-formStepsto use machine context and show only visible sectionsSchema & Validation
ShowIfConditionSchemawith operator validationshowIffield on questions and sections (optional)Tests & Documentation
Test Coverage
Examples
Files Changed
17 files: +1291/-161 lines