diff --git a/src/views/compareView.ts b/src/views/compareView.ts index 532da65..f1cc859 100644 --- a/src/views/compareView.ts +++ b/src/views/compareView.ts @@ -115,7 +115,7 @@ export class CompareView extends ViewBase { const root = this.ensureRoot(); root.addOrReplace(results, !this.keepResults); - setTimeout(() => this._tree!.reveal(results, { select: true }), 250); + setImmediate(() => this.reveal(results, { select: true, expand: true })); } private setFilesLayout(layout: ViewFilesLayout) { diff --git a/src/views/nodes/compareResultsNode.ts b/src/views/nodes/compareResultsNode.ts index 3a0cbde..afa5f1b 100644 --- a/src/views/nodes/compareResultsNode.ts +++ b/src/views/nodes/compareResultsNode.ts @@ -50,7 +50,7 @@ export class CompareResultsNode extends ViewNode { `Comparing ${this._ref1.label || GitService.shortenSha(this._ref1.ref, { working: 'Working Tree' })} to ${this._ref2.label || GitService.shortenSha(this._ref2.ref, { working: 'Working Tree' })}${repository}`, - TreeItemCollapsibleState.Expanded + TreeItemCollapsibleState.Collapsed ); item.contextValue = ResourceType.CompareResults; diff --git a/src/views/nodes/repositoriesNode.ts b/src/views/nodes/repositoriesNode.ts index 2368202..8ba1e36 100644 --- a/src/views/nodes/repositoriesNode.ts +++ b/src/views/nodes/repositoriesNode.ts @@ -133,7 +133,7 @@ export class RepositoriesNode extends SubscribeableViewNode { parent = parent.getParent(); } - void this.view.reveal(node /*, { expand: true } */); + void this.view.reveal(node, { expand: true }); } catch (ex) { Logger.error(ex); diff --git a/src/views/nodes/resultsCommitsNode.ts b/src/views/nodes/resultsCommitsNode.ts index 4e144ae..4992c2f 100644 --- a/src/views/nodes/resultsCommitsNode.ts +++ b/src/views/nodes/resultsCommitsNode.ts @@ -46,7 +46,7 @@ export class ResultsCommitsNode extends ViewNode implements PageableViewNode { const item = new TreeItem( label, - log && log.count > 0 ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.None + log && log.count > 0 ? TreeItemCollapsibleState.Collapsed : TreeItemCollapsibleState.None ); item.contextValue = this._contextValue; diff --git a/src/views/searchView.ts b/src/views/searchView.ts index 3072170..d48a96f 100644 --- a/src/views/searchView.ts +++ b/src/views/searchView.ts @@ -149,7 +149,7 @@ export class SearchView extends ViewBase { const root = this.ensureRoot(); root.addOrReplace(results, !this.keepResults); - setTimeout(() => this._tree!.reveal(results, { select: true }), 250); + setImmediate(() => this.reveal(results, { select: true, expand: true })); } private async getSearchLabel( diff --git a/src/views/viewBase.ts b/src/views/viewBase.ts index 62ecbbb..684a1e9 100644 --- a/src/views/viewBase.ts +++ b/src/views/viewBase.ts @@ -181,7 +181,7 @@ export abstract class ViewBase> implements TreeData options?: { select?: boolean; focus?: boolean; - // expand?: boolean | number; + expand?: boolean | number; } ) { if (this._tree === undefined) return;