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 Persist Issue Creator State When Navigating Between Sections #228

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

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

Summary:

Description

When using the Issue Creator component, any entered issue title and text are lost if the user navigates to a different section of the application before submitting. This results in lost work and a frustrating user experience. Implement a temporary state persistence mechanism (without saving to the database) to retain the issue title and text, ensuring that users can resume their work seamlessly upon returning to the Issue Creator page.

Steps to Reproduce

  1. Navigate to the Issue Creator component in the application.
  2. Enter a title and some text for a new issue.
  3. Navigate to a different section of the application without submitting the issue.
  4. Return to the Issue Creator component.

Expected Outcome The previously entered issue title and text remain populated in the Issue Creator form, allowing the user to continue editing without losing any information.

Actual Outcome All entered information in the Issue Creator form is cleared upon returning, requiring the user to re-enter the issue details.


@jacob-ai-bot --skip-build

Plan:

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

Task: Persist Issue Title and Body in IssueWriter Component

Instructions: Modify the IssueWriter component to store the 'issueTitle' and 'issueBody' in localStorage whenever they are updated. On component mount, initialize the 'issueTitle' and 'issueBody' state variables from localStorage if values are available. Ensure that the localStorage keys are unique per organization and repository by including the 'org' and 'repo' identifiers in the key names (e.g., 'issueTitle-org-repo'). When an issue is successfully created and submitted, clear the stored values from localStorage to reset the form state.

Exit Criteria: When a user navigates away from the Issue Creator page after entering an issue title and body, and then returns to the page, the previously entered information is still present in the form fields. Upon successful creation and submission of an issue, the form fields are cleared and localStorage no longer contains the stored issue title and body for that repository.

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

Hello human! šŸ‘‹

This PR was created by JACoB to address the issue Persist Issue Creator State When Navigating Between Sections

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.

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

JACoB here...

I'm responding to a code review on this PR.

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

Hello human! šŸ‘‹

This PR was updated by JACoB

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.