Skip to content

fix(web): add char limit validation to custom question fields#54

Open
guangshinhaha wants to merge 1 commit into
feat/posts-frontendfrom
fix/pgtw-45-custom-question-validation
Open

fix(web): add char limit validation to custom question fields#54
guangshinhaha wants to merge 1 commit into
feat/posts-frontendfrom
fix/pgtw-45-custom-question-validation

Conversation

@guangshinhaha
Copy link
Copy Markdown
Collaborator

Summary

  • Add 120-char limit on custom question text and 250-char limit on helper text (description), matching PG's validation
  • Add maxLength + character counters to QuestionBuilder inputs (same pattern as title/venue fields)
  • Add form-level validation in isCreatePostFormValid so the submit button disables when limits are exceeded
  • Add unit tests for boundary conditions (at limit, over limit)

Closes #45

Note: The 120/250 limits are based on the PG screenshot in the issue. Since we run in mock mode, these have not been verified against actual PGW FE/BE validation. Cross-check with the PGW codebase before merging.

Test plan

  • Verify question text input stops at 120 characters and shows counter
  • Verify helper text textarea stops at 250 characters and shows counter
  • Verify submit button disables if limits are somehow exceeded
  • Cross-check char limits against PGW FE/BE codebase (mock mode — can't test live)
  • pnpm test passes (5 new validation tests added)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

[FE] Create 'With responses' post - Custom questions fields no validation checks for Question and Description field

1 participant