Skip to content

Commit d72d7ab

Browse files
Copilotalexr00
andcommitted
Revert create view related changes
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 940b826 commit d72d7ab

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

src/github/createPRViewProvider.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -505,28 +505,6 @@ export abstract class BaseCreatePullRequestViewProvider<T extends BasePullReques
505505
return this._replyMessage(message, undefined);
506506
}
507507

508-
private async openCreateInBrowser(): Promise<void> {
509-
// Get the base repository info
510-
const baseRepo = this.getBaseGitHubRepo();
511-
if (!baseRepo) {
512-
vscode.window.showErrorMessage(vscode.l10n.t('Unable to find repository to create pull request in.'));
513-
return;
514-
}
515-
516-
// Get the compare branch name - this is the branch we want to create a PR from
517-
const compareBranch = this._defaultCompareBranch;
518-
if (!compareBranch) {
519-
vscode.window.showErrorMessage(vscode.l10n.t('Unable to determine branch to create pull request from.'));
520-
return;
521-
}
522-
523-
// Construct the GitHub URL for creating a PR
524-
// Format: https://github.com/{owner}/{repo}/pull/new/{branch}
525-
const url = `${baseRepo.remote.normalizedHost}/${baseRepo.remote.owner}/${baseRepo.remote.repositoryName}/pull/new/${encodeURIComponent(compareBranch)}`;
526-
527-
await vscode.env.openExternal(vscode.Uri.parse(url));
528-
}
529-
530508
protected override async _onDidReceiveMessage(message: IRequestMessage<any>) {
531509
const result = await super._onDidReceiveMessage(message);
532510
if (result !== this.MESSAGE_UNHANDLED) {
@@ -561,9 +539,6 @@ export abstract class BaseCreatePullRequestViewProvider<T extends BasePullReques
561539
case 'pr.removeLabel':
562540
return this.removeLabel(message);
563541

564-
case 'pr.openCreateInBrowser':
565-
return this.openCreateInBrowser();
566-
567542
default:
568543
return this.MESSAGE_UNHANDLED;
569544
}
@@ -1367,4 +1342,4 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
13671342
vscode.window.showErrorMessage('Unsupported webview message');
13681343
}
13691344
}
1370-
}
1345+
}

webviews/common/createContextNew.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ export class CreatePRContextNew {
9797
return this.postMessage({ command: 'pr.cancelCreate', args });
9898
};
9999

100-
public openCreateInBrowser = (): Promise<void> => {
101-
return this.postMessage({ command: 'pr.openCreateInBrowser' });
102-
};
103-
104100
public updateState = (params: Partial<CreateParamsNew>, reset: boolean = false): void => {
105101
this.createParams = reset ? { ...defaultCreateParams, ...params } : { ...this.createParams, ...params };
106102
vscode.setState(this.createParams);

webviews/createPullRequestViewNew/app.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,6 @@ export function main() {
354354
Cancel
355355
</button>
356356

357-
<button disabled={isBusy || !ctx.initialized} className='secondary' onClick={() => ctx.openCreateInBrowser()} title='Create pull request on GitHub.com'>
358-
Create in Browser
359-
</button>
360-
361357
<ContextDropdown optionsContext={() => makeCreateMenuContext(params)}
362358
defaultAction={onCreateButton}
363359
defaultOptionLabel={() => createMethodLabel(ctx.createParams.isDraft, ctx.createParams.autoMerge, ctx.createParams.autoMergeMethod, ctx.createParams.baseHasMergeQueue).label}

0 commit comments

Comments
 (0)