[to share] Public form demo + infrastructure feedback#3424
Draft
[to share] Public form demo + infrastructure feedback#3424
Conversation
Adds support for validators that receive full page data, enabling conditional validation patterns like "phone required if checkbox checked". Changes: - validators.ts: Add PageValidator type and ConditionalRequiredValidator factory - public-form.ts: Add AnyValidator union type, PFField 'type' property See public-form-pattern-feedback.md "Conditional Validation" section.
Bug fixes: - Form.svelte: Add bubbles:true to _subformChange event (React wasn't receiving it) - Form.svelte: Initialize dataBuffer in init() (validation failed on form re-entry) - Form.svelte: Move resetErrors() before validation (fixed fields still showed errors) - FormSummary.svelte: Add null check in showInSummary() Enhancements: - Form.svelte: Support PageValidator, skip validation for subform pages - FormPage.svelte: Add error summary callout, description slot, errorSummaryPosition prop - Subform.svelte: Add customization props (addButtonText, addButtonType, addButtonSize, addButtonIcon, addHeading, editHeading) Styling: - FormSummary.svelte: Rewrite to match Figma review cards (flexbox layout, typography) - FormPage.svelte: Adjust heading/button margins to match Figma See public-form-pattern-feedback.md for full details.
- public-form-page.tsx: Add errorSummaryPosition prop - public-subform.tsx: Add subform customization props (addButtonText, addButtonType, addButtonSize, addButtonIcon, addHeading, editHeading)
Change "—Select month—" label text fix.
Complete public form demo at apps/public-form-demo/ demonstrating: - 3-task form structure with eligibility check - One idea per page pattern from Figma designs - V2 components (Goabx*) with design tokens - Task list with section locking - Review pages with summary cards - Results and ineligible exit pages Live demo: https://publicform.netlify.app
Bumps @abgov/design-tokens from ^1.8.0 to ^2.0.1. Required for V2 components (Goabx*) to display correct styling.
c173190 to
1411744
Compare
The digital service demo now includes a more up-to-date form alongside the workspace. No need to maintain both — redirect publicform.netlify.app to digital-service-demo-v2.netlify.app.
❌ Deploy Preview for goa-design-2 failed.
|
This reverts commit 2267415.
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.
What this is
A working public form demo built on the
GoabPublicForminfrastructure, demonstrating the "one idea per page" pattern with V2 components.Live demo: https://publicform.netlify.app
What's included
Demo app (
apps/public-form-demo/)Infrastructure changes
Feedback
While building the demo, I ran into friction points and made changes to work around them. Everything is documented in
apps/public-form-demo/FEEDBACK.md, what I encountered, what I did, and why.Happy to walk through it together and/or discuss.