jacob-ai-bot / jacob

Just Another Coding Bot
https://jacb.ai
Apache License 2.0
131 stars 20 forks source link

JACoB PR for Issue Display Specific Error When Issue Title is Missing on Issue Writer Page #171

Closed jacob-ai-bot[bot] closed 1 month ago

jacob-ai-bot[bot] commented 1 month ago

Summary:

Description

When a user attempts to create a new issue on the Issue Writer page without providing a title, the application does not adequately inform the user of the missing title. To enhance user experience and prevent confusion, the system should display a specific error message indicating that the title is required. Additionally, the title input field should be highlighted, and focus should be automatically set to it.

Steps to Reproduce

  1. Navigate to the Issue Writer page.
  2. Attempt to create a new issue without entering a title.
  3. Click the Create Issue button to create the issue.

Expected Behavior

Actual Behavior

Suggested Implementation


@jacob-ai-bot

Plan:

Step 1: Edit /src/app/dashboard/[org]/[repo]/issue-writer/IssueWriter.tsx

Task: Enhance issue title validation and user feedback in IssueWriter component

Instructions: In the file /src/app/dashboard/[org]/[repo]/issue-writer/IssueWriter.tsx, update the handleCreateIssue function to separately check if the issueTitle is empty after trimming whitespace. If the issueTitle is empty, perform the following actions:

Modify the title input field to visually highlight it when there is an error. This can be achieved by conditionally applying error styling (such as a red border) to the input field's class when the error state is true. Ensure that the error state is reset when the user starts typing in the title input field.

Exit Criteria: When a user attempts to create a new issue without entering a title, a specific error toast appears with the message 'Error: Issue title is required. Please add a title to proceed.', the title input field is highlighted to indicate an error, and the cursor focus is automatically set to the title input field.

jacob-ai-bot[bot] commented 1 month ago

Hello human! 👋

This PR was created by JACoB to address the issue Display Specific Error When Issue Title is Missing on Issue Writer Page

Next Steps

  1. Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.

  2. If you identify code that needs to be changed, please reject the PR with a specific reason. Be as detailed as possible in your comments. JACoB will take these comments, make changes to the code and push up changes. Please note that this process will take a few minutes.

  3. Once the code looks good, approve the PR and merge the code.