Closed jacob-ai-bot[bot] closed 1 month ago
Hello human! š
This PR was created by JACoB to address the issue Persist Issue Creator State When Navigating Between Sections
Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.
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.
Once the code looks good, approve the PR and merge the code.
JACoB here...
I'm responding to a code review on this PR.
Hello human! š
This PR was updated by JACoB
Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.
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.
Once the code looks good, approve the PR and merge the code.
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
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.