Skip to content

Conversation

@pranavsaigandikota
Copy link

Built the form question editor component and a test page to try it out (looks pretty clean).
Supports multiple question types with dynamic UI and uses Zod schemas.

Why

To support the new "Blade Form Manager" (which will replace Google Forms for our elections and applications), and needed to build the core frontend component that allows admins to actually create and edit questions. This PR delivers that standalone component so we can start building the larger form builder UI.

What

I added the following:
QuestionEditCardComponent: The main UI for editing a single form question (apps/blade/src/components/admin/forms/question-edit-card.tsx). It looks like the Google Forms and has the following options so far:
Short Answer / Paragraph / Multiple Choice / Checkboxes / Dropdown / Date / Time
Zod Types: are on apps/blade/src/lib/types/form.ts with FormQuestionSchema and QuestionOptionSchema.
To test it out (Dev): I added a temporary page at /admin/forms/test-editor to show and test the component without needing the full backend integration yet.

Test Plan

I ran the blade app locally (pnpm dev:blade) and verified the component at http://localhost:3000/admin/forms/test-editor.
Interaction: confirmed that simple text inputs, type switching, and the "Required" toggle updates the state correctly.
Option Logic: tested adding, editing, and deleting options for multiple-choice/dropdown questions; ensure unique IDs are generated correctly using crypto.randomUUID().
Responsiveness: validated that the card layout holds up on smaller screens.
(If any features are to be added feel free to add em in)
image
image

P.S. I will change the name and clean up descriptions after.

…t (looks pretty clean).

Supports multiple question types with dynamic UI and uses Zod schemas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants