Skip to content

Conversation

@streed
Copy link
Owner

@streed streed commented Sep 17, 2025

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 ()

  • Simplified branch detection: Replaced complex fallback logic for default branch detection with direct use of
  • Added pre-creation sync: Now fetches and pulls latest changes from the base branch before creating worktrees to ensure they start from the most recent state
  • Enhanced error handling: Added graceful fallback when pull operations fail, allowing worktree creation to continue

Frontend UI Enhancements ()

  • Removed worktree link copying feature: Eliminated the copy link button and related functionality to simplify the interface
  • Streamlined status indicators:
    • Replaced text-based status labels with clean circular status dots
    • Removed verbose status text ("Running", "Starting", etc.) in favor of color-coded visual indicators
    • Simplified status object structure by removing redundant property
  • Improved visual consistency: Status indicators now use consistent circular design with appropriate sizing (12px for detailed view, 8px for compact view)

Status Indicator Color Scheme

  • 🟢 Green: Running instances
  • 🟡 Yellow: Starting instances
  • 🔴 Red: Error states
  • Gray: Stopped or no instances

Testing

Manual Testing Steps

  1. Test worktree creation workflow:

    • Add a repository to Bob
    • Create a new worktree using the "+" button
    • Verify the worktree starts from the latest version of the base branch
    • Check that status indicators display correctly as circular dots
  2. Test status indicator functionality:

    • Start/stop Claude instances and observe status dot color changes
    • Verify status dots appear consistently in both detailed and compact views
    • Confirm no text labels are shown, only color-coded dots
  3. Test git sync reliability:

    • Create worktrees from repositories with recent remote changes
    • Verify worktrees include the latest commits from the base branch
    • Test behavior when network/git operations fail (should continue gracefully)
  4. Test UI responsiveness:

    • Navigate through different repositories and worktrees
    • Confirm the simplified interface loads faster without the copy link functionality
    • Verify the cleaner visual design improves overall user experience

Automated Testing

  • Existing unit tests should continue to pass
  • Integration tests for worktree creation should verify the new sync behavior
  • UI component tests should validate the simplified status indicator rendering

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings September 17, 2025 11:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.`);
}

Copilot uses AI. Check for mistakes.
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 });
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants