Skip to content

Commit 1622c75

Browse files
committed
Allow hiding the "Resolve with Copilot" button in the merge conflicts dialog
1 parent e85f956 commit 1622c75

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

app/src/ui/app.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,6 +2540,10 @@ export class App extends React.Component<IAppProps, IAppState> {
25402540
this.state.copilotModels,
25412541
this.state.byokProviders
25422542
)}
2543+
conflictResolutionDisabled={
2544+
this.state.selectedCopilotModels['conflict-resolution'] ===
2545+
DisabledCopilotModel
2546+
}
25432547
openFileInExternalEditor={this.getOpenFileInExternalEditorHandler(
25442548
popup.repository
25452549
)}

app/src/ui/multi-commit-operation/base-multi-commit-operation.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ export interface IMultiCommitOperationProps {
6565
*/
6666
readonly copilotConflictResolutionModel: IConflictResolutionModelDisplay
6767

68+
/**
69+
* Whether to hide the "Resolve with Copilot" button.
70+
*/
71+
readonly conflictResolutionDisabled: boolean
72+
6873
/**
6974
* Callbacks for the conflict selection components to let the user jump out
7075
* to their preferred editor.
@@ -292,7 +297,11 @@ export abstract class BaseMultiCommitOperation extends React.Component<IMultiCom
292297
openFileInExternalEditor={openFileInExternalEditor}
293298
openRepositoryInShell={openRepositoryInShell}
294299
someConflictsHaveBeenResolved={this.setConflictsHaveBeenResolved}
295-
onResolveWithCopilot={this.onResolveWithCopilot}
300+
onResolveWithCopilot={
301+
this.props.conflictResolutionDisabled
302+
? undefined
303+
: this.onResolveWithCopilot
304+
}
296305
/>
297306
)
298307
}

app/src/ui/multi-commit-operation/multi-commit-operation.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class MultiCommitOperation extends React.Component<IMultiCommitOperationP
3838
copilotConflictResolutionModel={
3939
this.props.copilotConflictResolutionModel
4040
}
41+
conflictResolutionDisabled={this.props.conflictResolutionDisabled}
4142
openFileInExternalEditor={this.props.openFileInExternalEditor}
4243
resolvedExternalEditor={this.props.resolvedExternalEditor}
4344
openRepositoryInShell={this.props.openRepositoryInShell}
@@ -64,6 +65,7 @@ export class MultiCommitOperation extends React.Component<IMultiCommitOperationP
6465
copilotConflictResolutionModel={
6566
this.props.copilotConflictResolutionModel
6667
}
68+
conflictResolutionDisabled={this.props.conflictResolutionDisabled}
6769
openFileInExternalEditor={this.props.openFileInExternalEditor}
6870
resolvedExternalEditor={this.props.resolvedExternalEditor}
6971
openRepositoryInShell={this.props.openRepositoryInShell}
@@ -90,6 +92,7 @@ export class MultiCommitOperation extends React.Component<IMultiCommitOperationP
9092
copilotConflictResolutionModel={
9193
this.props.copilotConflictResolutionModel
9294
}
95+
conflictResolutionDisabled={this.props.conflictResolutionDisabled}
9396
openFileInExternalEditor={this.props.openFileInExternalEditor}
9497
resolvedExternalEditor={this.props.resolvedExternalEditor}
9598
openRepositoryInShell={this.props.openRepositoryInShell}

0 commit comments

Comments
 (0)