Skip to content

Commit cb3b502

Browse files
Copilotrajbos
andcommitted
Add fallback to default tab if saved tab doesn't exist
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent bef17a8 commit cb3b502

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/webview/diagnostics/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,10 +953,11 @@ function renderLayout(data: DiagnosticsData): void {
953953
setupEditorFilterHandlers();
954954
setupFileLinks();
955955

956-
// Restore active tab from saved state
956+
// Restore active tab from saved state, with fallback to default
957957
const savedState = vscode.getState();
958-
if (savedState?.activeTab) {
959-
activateTab(savedState.activeTab);
958+
if (savedState?.activeTab && !activateTab(savedState.activeTab)) {
959+
// If saved tab doesn't exist (e.g., structure changed), activate default "report" tab
960+
activateTab('report');
960961
}
961962
}
962963

0 commit comments

Comments
 (0)