atian25 / redis-roadmap

https://redis-roadmap-ivory.vercel.app
1 stars 0 forks source link

feat: the roadmap request input should at least 10 word #2

Open atian25 opened 1 month ago

atian25 commented 1 month ago

✨✨ Here's an AI-assisted sketch of how you might approach this issue saved by @atian25 using Copilot Workspace v0.17

Topic
Does the roadmap request input enforce a minimum word count of 10 using the component's properties?
Before
* No, the roadmap request input does not enforce a minimum word count of 10 using the component's properties. * The input field for feature requests in `app/form.tsx` uses `maxLength={150}` to limit the maximum number of characters to 150, but there is no property enforcing a minimum word count. * The form submission does not include any checks or validations for a minimum word count before processing the request.
After
* Yes, the roadmap request input now enforces a minimum word count of 10 using the component's properties. * The input field for feature requests in `app/form.tsx` includes a new validation function to check for a minimum word count. * The form submission process in `app/form.tsx` now includes a step to validate the word count before processing the request.
Plan
* `app/form.tsx` (CHANGE) - Add a new function `validateWordCount` to check if the input has at least 10 words. - Modify the `onSubmit` function to call `validateWordCount` before proceeding with the form submission. - Display an error message if the word count is less than 10.
Sketch of implementation
[View the changes](https://copilot-workspace.githubnext.com/atian25/redis-roadmap/issues/2?shareId=ddaed43d-554f-40af-bc8d-03f7c80da7ca)
Details
Code analyzed at 1f616e20f357697acafffb092f121359d88a5f40