Skip to content

Commit 0466e45

Browse files
authored
Merge pull request #108 from microsoft/user/mattwar/GuardHistoryReveal
Dont force sidebar open when history is added
2 parents 7177a05 + 404e4a7 commit 0466e45

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/Client/features/historyPanel.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ export class HistoryPanel {
3636
// Auto-reveal newly added entries in the tree view
3737
manager.onDidAddEntry((meta) => {
3838
this.treeProvider.refresh();
39+
// Skip reveal when the tree view is not visible. TreeView.reveal() forces
40+
// its containing view to become visible, which would yank the Kusto sidebar
41+
// open while the user is doing something else (running a query saves a
42+
// history entry as a side effect, not as a request to see history).
43+
if (!this.treeView.visible) {
44+
return;
45+
}
3946
const item = new HistoryItem(meta);
4047
this.treeView.reveal(item, { select: true, focus: false }).then(undefined, (err) => console.warn('Failed to reveal history item:', err));
4148
});
@@ -46,6 +53,13 @@ export class HistoryPanel {
4653

4754
/** Reveals and selects a history entry in the tree view. */
4855
revealEntry(entry: HistoryEntry): void {
56+
// Skip reveal when the tree view is not visible. This entry point is
57+
// invoked as a side effect of "Show Results" (queryEditor.ts), not as
58+
// an explicit "navigate to history" request, so we must not force the
59+
// Kusto sidebar open.
60+
if (!this.treeView.visible) {
61+
return;
62+
}
4963
const item = new HistoryItem(entry);
5064
this.treeView.reveal(item, { select: true, focus: false }).then(undefined, (err) => console.warn('Failed to reveal history item:', err));
5165
}

0 commit comments

Comments
 (0)