cds-snc / cds-snc/platform-forms-client

Flag empty options, questions, and pages that show up blank in Preview / for end user forms

Open
#1,510 1 comment 0 reactions 0 assignees View on GitHub
:vertical_traffic_light: Moderate app development end users ready for dev
Dominant language
TypeScript
Stars
46
Forks
16
Avg merge
1d 9h
Merged PRs (30d)
91

Description

### User Story:

As a form-building client, if I accidentally click **“Add form element” and create a blank question**, I would not want to see an empty question field in draft review / in the published form experience for end users.

As a client, if I accidentally click **“Add option” and create a blank selection**, I would not want to see an empty radio or checkbox or dropdown field in draft review / in the published form experience for end users.

As a client, if I accidentally click **“Add option” and create a blank selection**, I would not want to see an empty radio or checkbox or dropdown field in draft review / in the published form experience for end users.

https://images.zenhubusercontent.com/315708034/a2974bfd-b846-4aeb-98da-ef188acefe48/empty_question.mov

## Description

Consider adding validation for empty pages, questions, and options before publishing?

We saw this become an issue on a higher-profile form that accidentally created a blank page and couldn't republish.

Would be good to flag to users somehow if a form appears incomplete. We have a check for missing translations but not for missing content outright.

It is possible to publish a form with an empty selection option/choice (ex: checkbox with no content that is unselectable)

https://images.zenhubusercontent.com/315708034/a2974bfd-b846-4aeb-98da-ef188acefe48/empty_question.mov

## Steps to reproduce (ex: no checkbox option content)

1. Create a draft form
2. Add a checkbox form element
3. Add 5 checkbox options
4. Add a 6th option but leave the content blank
5. Input translations and meet all other publishing requirements
6. Do not add content to the 6th option
7. Publish form
8. Try filling out selecting checkbox with no content

[Private Zenhub Video](https://api.zenhub.com/attachedFiles/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBeTJMRGc9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--bc048e784dc3f796ee4f463d0e55ef29417d7e43/Screen%20Recording%202026-07-22%20at%208.47.33%E2%80%AFAM.mov)

### Acceptance criteria:

- Add logic that hides empty questions from the form output
- OR include a validation step that would prevent the saving/publishing of forms that are missing text

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Reproduce the blank question, option, and page cases in the form builder, then trace the preview, published form output, and publishing validation entry points. Done means empty content is either hidden from both outputs or reliably blocks saving or publishing with a user-facing validation message.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.