@@ -505,6 +505,29 @@ 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+ // or https://github.com/{owner}/{repo}/compare/{base}...{head} for cross-repo PRs
526+ const url = `${ baseRepo . remote . url } /pull/new/${ compareBranch } ` ;
527+
528+ await vscode . env . openExternal ( vscode . Uri . parse ( url ) ) ;
529+ }
530+
508531 protected override async _onDidReceiveMessage ( message : IRequestMessage < any > ) {
509532 const result = await super . _onDidReceiveMessage ( message ) ;
510533 if ( result !== this . MESSAGE_UNHANDLED ) {
@@ -539,6 +562,9 @@ export abstract class BaseCreatePullRequestViewProvider<T extends BasePullReques
539562 case 'pr.removeLabel' :
540563 return this . removeLabel ( message ) ;
541564
565+ case 'pr.openCreateInBrowser' :
566+ return this . openCreateInBrowser ( ) ;
567+
542568 default :
543569 return this . MESSAGE_UNHANDLED ;
544570 }
@@ -1342,4 +1368,4 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
13421368 vscode . window . showErrorMessage ( 'Unsupported webview message' ) ;
13431369 }
13441370 }
1345- }
1371+ }
0 commit comments