feat: forms subsystem (admin + Coltorapps builder + public renderer + CSV export)#2011
Merged
Merged
Conversation
Deploying usrse-github-io with
|
| Latest commit: |
741c581
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1f0384c3.usrse-github-io.pages.dev |
| Branch Preview URL: | https://cdcore09-forms-implementatio.usrse-github-io.pages.dev |
4 tasks
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
Plan 4 of 5 from the events / announcements / forms brainstorm. Lands the forms subsystem on top of Plans 1-3: admin forms CRUD with inline Coltorapps form-builder, admin submissions list + CSV export, polymorphic form-to-entity attachment, and public
/forms/:slugrenderer + submission endpoint.Schema parser (Task 1)
packages/api/src/lib/forms/schemaTypes.ts+schemaParser.ts— server-side source of truth for the stored schema shape. 9 field types: text, textarea, email, url, number, date, single_choice, multi_choice, checkbox. Hard caps (50 fields, 30 options per choice).validateSubmissionPayloadchecks every submission against the stored schema.Admin API (Tasks 2-6)
POST/GET /admin/forms— create draft + list with status/scope/entityType/q filtersGET/PATCH /admin/forms/:id— detail (with reviews/comments/audit/submission count) + patch with schema re-validation + CHECK constraint enforcement (entityType + entityId both-or-neither)POST /admin/forms/:id/transitions— wrapsapplyTransitionwithcloseinstead ofcancelfor the staff-only post-publish actionPOST /admin/forms/:id/comments— usessanitizeCommentBodyGET /admin/forms/:id/submissions— paginated JSON list, plus CSV export via?format=csvPublic API (Task 7)
GET /forms/:slug— scope-aware (anonymous can readpublic, signed-in can readcommunity+public)POST /forms/:slug/submissions— validates payload throughvalidateSubmissionPayload, returns 201 with submissionId. Anonymous allowed iff form.scope='public'. 410 when accepts_submissions=false.Coltorapps builder (Task 8, 11)
@coltorapps/builder+@coltorapps/builder-reactv0.2.4 (MIT) installed in apps/admin only.apps/admin/src/components/FormBuilder.tsx— wires Coltorapps' store-based headless primitives onto admin editorial design tokens. ↑/↓ reorder buttons (keyboard-accessible). Bidirectional adapter between Coltorapps' nested-entity format and our flatFormSchema.Admin UI (Tasks 9-12)
/admin/formslist with filters/admin/forms/newlightweight compose (title/slug/description; seeds a minimal valid form)/admin/forms/:iddetail page with Identity / Content (form builder) / Review / Audit tabs + "View submissions" link/admin/forms/:id/submissionspage with paginated table + CSV download buttonPublic UI (Task 13)
apps/web/src/components/FormRenderer.tsx— renders the schema as an editable form. All 9 field types. Inline field errors on 400.apps/web/src/pages/forms/FormPage.tsxat/forms/:slug— fetches form, wraps<FormRenderer />with site chrome (dark gradient hero matching EventDetailPage aesthetic).Stats
Test plan
/forms/<slug>, fills out the form, submission lands in adminPlan + spec
docs/superpowers/specs/2026-05-20-events-announcements-forms-design.md§5docs/superpowers/plans/2026-05-27-forms-implementation.mdDeferred (per spec §10 + scope notes)