Better syncing of "share with agent" status (#305854)

This commit is contained in:
Kyle Cutler
2026-03-27 17:11:21 -07:00
committed by GitHub
parent 3f19f148dc
commit 2de60eada5
2 changed files with 5 additions and 9 deletions

View File

@@ -424,21 +424,15 @@ class PlaywrightPageManager extends Disposable {
try {
await this._group!.addView(viewId);
} catch (err: unknown) {
const errorMessage = err instanceof Error ? err.message : String(err);
this.logService.error('[PlaywrightPageManager] Failed to add view:', errorMessage);
} catch (err) {
this.onViewRemoved(viewId);
throw err;
}
}
private async _removePageFromGroup(viewId: string): Promise<void> {
this.onViewRemoved(viewId);
try {
await this._group!.removeView(viewId);
} catch (err: unknown) {
const errorMessage = err instanceof Error ? err.message : String(err);
this.logService.error('[PlaywrightPageManager] Failed to remove view:', errorMessage);
}
}
private _fireTrackedPagesChanged(): void {

View File

@@ -606,8 +606,10 @@ export class BrowserViewModel extends Disposable implements IBrowserViewModel {
}
await this.playwrightService.startTrackingPage(this.id);
this._setSharedWithAgent(true);
} else {
await this.playwrightService.stopTrackingPage(this.id);
this._setSharedWithAgent(false);
}
}