apply the patches

This commit is contained in:
webdevcody
2026-01-20 10:24:38 -05:00
parent 179c5ae9c2
commit 76eb3a2ac2
42 changed files with 2679 additions and 757 deletions

View File

@@ -1566,15 +1566,18 @@ function createMockWorktreeAPI(): WorktreeAPI {
projectPath: string,
branchName: string,
worktreePath: string,
targetBranch?: string,
options?: object
) => {
const target = targetBranch || 'main';
console.log('[Mock] Merging feature:', {
projectPath,
branchName,
worktreePath,
targetBranch: target,
options,
});
return { success: true, mergedBranch: branchName };
return { success: true, mergedBranch: branchName, targetBranch: target };
},
getInfo: async (projectPath: string, featureId: string) => {
@@ -1684,14 +1687,15 @@ function createMockWorktreeAPI(): WorktreeAPI {
};
},
push: async (worktreePath: string, force?: boolean) => {
console.log('[Mock] Pushing worktree:', { worktreePath, force });
push: async (worktreePath: string, force?: boolean, remote?: string) => {
const targetRemote = remote || 'origin';
console.log('[Mock] Pushing worktree:', { worktreePath, force, remote: targetRemote });
return {
success: true,
result: {
branch: 'feature-branch',
pushed: true,
message: 'Successfully pushed to origin/feature-branch',
message: `Successfully pushed to ${targetRemote}/feature-branch`,
},
};
},
@@ -1777,6 +1781,7 @@ function createMockWorktreeAPI(): WorktreeAPI {
],
aheadCount: 2,
behindCount: 0,
hasRemoteBranch: true,
},
};
},
@@ -1793,6 +1798,26 @@ function createMockWorktreeAPI(): WorktreeAPI {
};
},
listRemotes: async (worktreePath: string) => {
console.log('[Mock] Listing remotes for:', worktreePath);
return {
success: true,
result: {
remotes: [
{
name: 'origin',
url: 'git@github.com:example/repo.git',
branches: [
{ name: 'main', fullRef: 'origin/main' },
{ name: 'develop', fullRef: 'origin/develop' },
{ name: 'feature/example', fullRef: 'origin/feature/example' },
],
},
],
},
};
},
openInEditor: async (worktreePath: string, editorCommand?: string) => {
const ANTIGRAVITY_EDITOR_COMMAND = 'antigravity';
const ANTIGRAVITY_LEGACY_COMMAND = 'agy';

View File

@@ -1763,8 +1763,16 @@ export class HttpApiClient implements ElectronAPI {
projectPath: string,
branchName: string,
worktreePath: string,
targetBranch?: string,
options?: object
) => this.post('/api/worktree/merge', { projectPath, branchName, worktreePath, options }),
) =>
this.post('/api/worktree/merge', {
projectPath,
branchName,
worktreePath,
targetBranch,
options,
}),
getInfo: (projectPath: string, featureId: string) =>
this.post('/api/worktree/info', { projectPath, featureId }),
getStatus: (projectPath: string, featureId: string) =>
@@ -1788,8 +1796,8 @@ export class HttpApiClient implements ElectronAPI {
this.post('/api/worktree/commit', { worktreePath, message }),
generateCommitMessage: (worktreePath: string) =>
this.post('/api/worktree/generate-commit-message', { worktreePath }),
push: (worktreePath: string, force?: boolean) =>
this.post('/api/worktree/push', { worktreePath, force }),
push: (worktreePath: string, force?: boolean, remote?: string) =>
this.post('/api/worktree/push', { worktreePath, force, remote }),
createPR: (worktreePath: string, options?: any) =>
this.post('/api/worktree/create-pr', { worktreePath, ...options }),
getDiffs: (projectPath: string, featureId: string) =>
@@ -1807,6 +1815,8 @@ export class HttpApiClient implements ElectronAPI {
this.post('/api/worktree/list-branches', { worktreePath, includeRemote }),
switchBranch: (worktreePath: string, branchName: string) =>
this.post('/api/worktree/switch-branch', { worktreePath, branchName }),
listRemotes: (worktreePath: string) =>
this.post('/api/worktree/list-remotes', { worktreePath }),
openInEditor: (worktreePath: string, editorCommand?: string) =>
this.post('/api/worktree/open-in-editor', { worktreePath, editorCommand }),
getDefaultEditor: () => this.get('/api/worktree/default-editor'),