mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
feat: enhance auto mode service and UI components for branch handling and verification
- Added a new function to retrieve the current branch name in the auto mode service, improving branch management. - Updated the `getRunningCountForWorktree` method to utilize the current branch name for accurate feature counting. - Modified UI components to include a toggle for skipping verification in auto mode, enhancing user control. - Refactored various hooks and components to ensure consistent handling of branch names across the application. - Introduced a new utility file for string operations, providing common functions for text manipulation.
This commit is contained in:
@@ -77,6 +77,7 @@ export function useAutoMode(worktree?: WorktreeInfo) {
|
||||
getWorktreeKey,
|
||||
getMaxConcurrencyForWorktree,
|
||||
setMaxConcurrencyForWorktree,
|
||||
isPrimaryWorktreeBranch,
|
||||
} = useAppStore(
|
||||
useShallow((state) => ({
|
||||
autoModeByWorktree: state.autoModeByWorktree,
|
||||
@@ -90,6 +91,7 @@ export function useAutoMode(worktree?: WorktreeInfo) {
|
||||
getWorktreeKey: state.getWorktreeKey,
|
||||
getMaxConcurrencyForWorktree: state.getMaxConcurrencyForWorktree,
|
||||
setMaxConcurrencyForWorktree: state.setMaxConcurrencyForWorktree,
|
||||
isPrimaryWorktreeBranch: state.isPrimaryWorktreeBranch,
|
||||
}))
|
||||
);
|
||||
|
||||
@@ -197,9 +199,21 @@ export function useAutoMode(worktree?: WorktreeInfo) {
|
||||
}
|
||||
|
||||
// Extract branchName from event, defaulting to null (main worktree)
|
||||
const eventBranchName: string | null =
|
||||
const rawEventBranchName: string | null =
|
||||
'branchName' in event && event.branchName !== undefined ? event.branchName : null;
|
||||
|
||||
// Get projectPath for worktree lookup
|
||||
const eventProjectPath = 'projectPath' in event ? event.projectPath : currentProject?.path;
|
||||
|
||||
// Normalize branchName: convert primary worktree branch to null for consistent key lookup
|
||||
// This handles cases where the main branch is named something other than 'main' (e.g., 'master', 'develop')
|
||||
const eventBranchName: string | null =
|
||||
eventProjectPath &&
|
||||
rawEventBranchName &&
|
||||
isPrimaryWorktreeBranch(eventProjectPath, rawEventBranchName)
|
||||
? null
|
||||
: rawEventBranchName;
|
||||
|
||||
// Skip event if we couldn't determine the project
|
||||
if (!eventProjectId) {
|
||||
logger.warn('Could not determine project for event:', event);
|
||||
@@ -493,6 +507,7 @@ export function useAutoMode(worktree?: WorktreeInfo) {
|
||||
currentProject?.path,
|
||||
getMaxConcurrencyForWorktree,
|
||||
setMaxConcurrencyForWorktree,
|
||||
isPrimaryWorktreeBranch,
|
||||
]);
|
||||
|
||||
// Start auto mode - calls backend to start the auto loop for this worktree
|
||||
|
||||
Reference in New Issue
Block a user