Closed jacob-ai-bot[bot] closed 1 month ago
Hello human! 👋
This PR was created by JACoB to address the issue Feature Request: Add "Start New Issue" Button to Codebase Detail Component
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:
Feature Request: Add "Start New Issue" Button to Codebase Detail Component
Description
Enhance the Code Visualization - Codebase Detail component by introducing a new button labeled "Start New Issue". This feature will allow users to seamlessly create GitHub issues related to specific files directly from the codebase view, streamlining the reporting and tracking of necessary updates.
Current Functionality
Proposed Enhancement
"Start New Issue" Button
Functionality:
IssueWriter Integration:
Update [filename.ext]
.Please update the
[filename.ext]
file to address the following:Implementation Steps
UI Development:
Functionality Integration:
IssueWriter Component Enhancement:
Error Handling:
Testing:
Expected Outcome
Additional Information
@jacob-ai-bot --skip-build
Plan:
Step 1: Edit
/src/app/dashboard/[org]/[repo]/code-visualizer/codebase/CodebaseDetails.tsx
Task: Add 'Start New Issue' button and click handler to CodebaseDetails component
Instructions: In the CodebaseDetails.tsx component, add a new button labeled 'Start New Issue' adjacent to the existing 'Update with Chat' button at the bottom of the component. Ensure the new button matches the existing styling for consistency, following the styling patterns used for buttons in this component. Implement a click handler for this button. When clicked, the handler should check if a file is selected. If a file is selected, retrieve the current file's name and path, URL-encode the file path, and use the router to navigate to the IssueWriter component, passing the encoded file path as a query parameter named 'file_path'. If no file is selected, display an appropriate error message to the user.
Exit Criteria: The 'Start New Issue' button is displayed alongside the 'Update with Chat' button, styled consistently. Clicking it navigates to the IssueWriter component with the file path passed as a URL parameter when a file is selected. An error message is shown if no file is selected.
Step 2: Edit
/src/app/dashboard/[org]/[repo]/issue-writer/IssueWriter.tsx
Task: Modify IssueWriter component to accept file path from URL parameters and pre-populate issue content
Instructions: In IssueWriter.tsx, use the appropriate hook (e.g., useSearchParams from 'next/navigation') to retrieve the 'file_path' parameter from the URL. Decode the encoded file path, and if present, extract the file name from the path. Use the file name to pre-populate the issue title and body. The issue title should be formatted as 'Update [filename.ext]', where '[filename.ext]' is the extracted file name. The issue body should be populated with the following template:
Update Required for [filename.ext]
Please update the
[filename.ext]
file to address the following:Ensure that the issue title and body fields are editable, allowing the user to modify the pre-filled content before submitting the issue.
Exit Criteria: When navigated to with a 'file_path' parameter, IssueWriter pre-populates the issue title and body using the file name, and the user can edit both fields before creating the issue.