Closed jacob-ai-bot[bot] closed 1 month ago
Hello human! đź‘‹
This PR was created by JACoB to address the issue Add "Create Branch" Button to Dashboard Menu
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
Currently, the dashboard menu includes a dropdown for selecting branches. To enhance the user experience and streamline the branching process, we propose adding a "Create Branch" button adjacent to the existing branch dropdown. This feature will allow users to create new branches directly from the dashboard without navigating away from the current interface.
Feature Requirements
UI Enhancements
Validation
Backend Integration
createBranch
branchName
: The name of the new branch.baseBranch
: The name of the base branch.Post-Creation Behavior
Expected Outcome
Additional Notes
Plan:
Step 1: Edit
/src/app/dashboard/[org]/[repo]/components/Header.tsx
Task: Enhance Header Component to Support Branch Creation
Instructions: In '/src/app/dashboard/[org]/[repo]/components/Header.tsx', perform the following:
Exit Criteria: The Header component displays the 'Create Branch' button, properly manages modal visibility and state, and updates the branch dropdown after branch creation.
Step 2: Edit
/src/server/api/routers/github.ts
Task: Add 'createBranch' Mutation to GitHub TRPC Router
Instructions: In '/src/server/api/routers/github.ts', add a new protected mutation called 'createBranch' with input parameters 'org', 'repo', 'branchName', and 'baseBranch'. Implement the mutation to:
Exit Criteria: The 'createBranch' mutation successfully creates new branches via the GitHub API and provides clear feedback for success and error states.
Step 3: Create
/src/app/dashboard/[org]/[repo]/components/CreateBranchModal.tsx
Task: Implement CreateBranchModal Component with Branch Creation Functionality
Instructions: Create a new component 'CreateBranchModal' in '/src/app/dashboard/[org]/[repo]/components/'. The component should:
Exit Criteria: The 'CreateBranchModal' component allows users to create new branches, handles validation and errors appropriately, and integrates smoothly with the Header component.