fix(vscode): retain sidebar webview context when hidden (#227)

Set retainContextWhenHidden on the sidebar WebviewView registration so
review state survives switching to other sidebar panels (Fixes #224).
This commit is contained in:
xyJen 2026-06-26 15:36:16 +08:00 committed by GitHub
parent c8ff673667
commit 02a6423894
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,11 @@ export function activate(context: vscode.ExtensionContext): void {
const configPanel = new ConfigPanelProvider(extensionUri, cli, config, (cfg) => sidebar.pushConfig(cfg));
sidebar.bindConfigPanel((focus) => configPanel.open(focus));
const viewReg = vscode.window.registerWebviewViewProvider(SIDEBAR_VIEW_ID, sidebar);
const viewReg = vscode.window.registerWebviewViewProvider(
SIDEBAR_VIEW_ID,
sidebar,
{ webviewOptions: { retainContextWhenHidden: true } },
);
const cmdReg = registerCommands(comments, () => configPanel.open());
disposables.push(viewReg, cmdReg, comments, output, configPanel);