Repository navigation
sessions - when applying changes, offer action to open - #298718
Conversation
left a comment
There was a problem hiding this comment.
Pull request overview
Adds an “Open in VS Code” follow-up action after applying session changes to the parent repository in the Sessions window, improving the workflow from “apply” to “continue working in desktop VS Code”.
Changes:
- Adds an “Open in VS Code” notification action after successful/partial apply-to-parent-repo operations.
- Switches apply result notifications to
notificationService.notify(...)to support actions. - Introduces opener/product service usage to build and open a
vscode://file/...URL.
| run: () => { | ||
| const scheme = productService.quality === 'stable' | ||
| ? 'vscode' | ||
| : productService.quality === 'exploration' | ||
| ? 'vscode-exploration' | ||
| : 'vscode-insiders'; | ||
|
|
||
| const params = new URLSearchParams(); | ||
| params.set('windowId', '_blank'); | ||
| params.set('session', activeSession.resource.toString()); | ||
|
|
||
| openerService.open(URI.from({ | ||
| scheme, | ||
| authority: Schemas.file, | ||
| path: repoRoot.path, | ||
| query: params.toString(), | ||
| }), { openExternal: true }); | ||
| } |
There was a problem hiding this comment.
openFolderAction.run calls openerService.open(...) but doesn't await or return the promise. If the open fails (e.g. protocol handler missing), the rejection can go unobserved and the notification action may appear to succeed. Make run async (or return the promise) and await openerService.open(...).
| const scheme = productService.quality === 'stable' | ||
| ? 'vscode' | ||
| : productService.quality === 'exploration' | ||
| ? 'vscode-exploration' | ||
| : 'vscode-insiders'; |
There was a problem hiding this comment.
The protocol scheme is derived from productService.quality and defaults to 'vscode-insiders' for any other value. This can produce an incorrect protocol in non-standard builds (e.g. code-oss) and duplicates logic that IProductService.urlProtocol already provides. Prefer using productService.urlProtocol for the scheme here.
| const scheme = productService.quality === 'stable' | |
| ? 'vscode' | |
| : productService.quality === 'exploration' | |
| ? 'vscode-exploration' | |
| : 'vscode-insiders'; | |
| const scheme = productService.urlProtocol; |
No description provided.