refactor: remove link copying feature and update git service auto-detection#10
refactor: remove link copying feature and update git service auto-detection#10streed wants to merge 1 commit into
Conversation
This commit streamlines worktree creation and improves the UI by simplifying status indicators and removing redundant functionality. The backend now uses the repository's stored main branch instead of performing complex auto-detection logic, and adds git fetch/pull operations to ensure worktrees are created from the latest code. The frontend removes the worktree link copying feature and replaces text-based status labels with clean circular status indicators, making the interface more visually consistent while reducing visual clutter. These changes improve both the reliability of worktree creation and the overall user experience through a cleaner, more focused interface. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR removes the link copying feature from worktrees and replaces text-based status indicators with visual status dots. It also improves the worktree creation process by ensuring branches are synced with the latest remote changes before creating new worktrees.
- Removed worktree link copying functionality to simplify the UI
- Replaced text status labels with circular color-coded status dots
- Added pre-creation git sync to fetch latest changes before worktree creation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/src/components/RepositoryPanel.tsx | Removes copy link button and replaces text status with circular status dots |
| backend/src/services/git.ts | Simplifies branch detection and adds git sync before worktree creation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| } | ||
| } | ||
| baseBranch = repository.mainBranch; |
There was a problem hiding this comment.
This code assumes repository.mainBranch is always defined, but there's no null check. If repository.mainBranch is undefined or null, the worktree creation will fail with unclear errors later in the process.
| baseBranch = repository.mainBranch; | |
| baseBranch = repository.mainBranch; | |
| if (!baseBranch) { | |
| throw new Error(`Repository ${repositoryId} does not have a main branch defined. Please specify a base branch.`); | |
| } |
| try { | ||
| console.log(`Pulling latest changes for ${baseBranch} before creating worktree`); | ||
| await execAsync('git fetch origin', { cwd: repository.path }); | ||
| await execAsync(`git pull origin ${baseBranch}`, { cwd: repository.path }); |
There was a problem hiding this comment.
The baseBranch variable is interpolated directly into the shell command without validation or escaping. This could lead to command injection if the branch name contains malicious characters or shell metacharacters.
Summary
This PR streamlines worktree creation and simplifies UI status indicators in the Bob project. The changes improve the reliability of worktree creation by ensuring branches are up-to-date before creation, and enhance the user interface by replacing text-based status labels with cleaner visual indicators.
Changes Made
Backend Improvements ()
Frontend UI Enhancements ()
Status Indicator Color Scheme
Testing
Manual Testing Steps
Test worktree creation workflow:
Test status indicator functionality:
Test git sync reliability:
Test UI responsiveness:
Automated Testing
🤖 Generated with Claude Code