Skip to content

fix: prevent empty feedback form submission (#1415)#2171

Open
Avanish-Gupta-CSE wants to merge 1 commit intojson-schema-org:mainfrom
Avanish-Gupta-CSE:fix/issue-1415-feedback-form-validation
Open

fix: prevent empty feedback form submission (#1415)#2171
Avanish-Gupta-CSE wants to merge 1 commit intojson-schema-org:mainfrom
Avanish-Gupta-CSE:fix/issue-1415-feedback-form-validation

Conversation

@Avanish-Gupta-CSE
Copy link
Copy Markdown

@Avanish-Gupta-CSE Avanish-Gupta-CSE commented Jan 27, 2026

What kind of change does this PR introduce?

Bugfix - Prevents empty feedback form submissions by adding validation.

Issue Number:

Screenshots/videos:

N/A - This is a validation logic change. The form now shows an error message "Feedback comment cannot be empty." when users try to submit empty or whitespace-only feedback.

If relevant, did you update the documentation?

N/A - No documentation changes required.

Summary

This PR fixes the issue where users could submit empty feedback via the documentation help form. The changes include:

  • Added validation in createFeedbackHandler to check for empty/whitespace feedback
  • Added validation in createGitHubIssueHandler for consistency
  • Changed label from "Optional" to "Required" (red color)
  • Shows error message "Feedback comment cannot be empty." when validation fails

Test Coverage

Added 3 new Cypress component tests:

  • Empty feedback submission blocked
  • Whitespace-only feedback blocked
  • GitHub issue creation with empty feedback blocked

Does this PR introduce a breaking change?

No.

Checklist

- Add validation to prevent empty/whitespace-only feedback submission
- Show error message "Feedback comment cannot be empty."
- Update label from "Optional" to "Required"
- Add validation for both feedback form and GitHub issue creation
- Add complete Cypress test coverage for validation scenarios

Fixes json-schema-org#1415
@github-actions
Copy link
Copy Markdown

Hi @Avanish-Gupta-CSE! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 27, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview 6e53c6e

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fd76cd7) to head (6e53c6e).
⚠️ Report is 87 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2171   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           30        30           
  Lines          640       650   +10     
  Branches       198       200    +2     
=========================================
+ Hits           640       650   +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Avanish-Gupta-CSE
Copy link
Copy Markdown
Author

Hi, checking in on this PR. Please let me know if there's anything I should update or if a review is possible. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready to review

Development

Successfully merging this pull request may close these issues.

🐛Bug: Feedback Form Submits Empty String

1 participant