Browse Source

Adds auto-expand repo nodes when tracking repositories

Programatically expands search/compare results for better experience
 - Adding collapsed &  then expanding provides better feedback (spinner)
main
Eric Amodio 6 years ago
parent
commit
3d09e0edfa
6 changed files with 6 additions and 6 deletions
  1. +1
    -1
      src/views/compareView.ts
  2. +1
    -1
      src/views/nodes/compareResultsNode.ts
  3. +1
    -1
      src/views/nodes/repositoriesNode.ts
  4. +1
    -1
      src/views/nodes/resultsCommitsNode.ts
  5. +1
    -1
      src/views/searchView.ts
  6. +1
    -1
      src/views/viewBase.ts

+ 1
- 1
src/views/compareView.ts View File

@ -115,7 +115,7 @@ export class CompareView extends ViewBase {
const root = this.ensureRoot(); const root = this.ensureRoot();
root.addOrReplace(results, !this.keepResults); 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) { private setFilesLayout(layout: ViewFilesLayout) {

+ 1
- 1
src/views/nodes/compareResultsNode.ts View File

@ -50,7 +50,7 @@ export class CompareResultsNode extends ViewNode {
`Comparing ${this._ref1.label || `Comparing ${this._ref1.label ||
GitService.shortenSha(this._ref1.ref, { working: 'Working Tree' })} to ${this._ref2.label || GitService.shortenSha(this._ref1.ref, { working: 'Working Tree' })} to ${this._ref2.label ||
GitService.shortenSha(this._ref2.ref, { working: 'Working Tree' })}${repository}`, GitService.shortenSha(this._ref2.ref, { working: 'Working Tree' })}${repository}`,
TreeItemCollapsibleState.Expanded
TreeItemCollapsibleState.Collapsed
); );
item.contextValue = ResourceType.CompareResults; item.contextValue = ResourceType.CompareResults;

+ 1
- 1
src/views/nodes/repositoriesNode.ts View File

@ -133,7 +133,7 @@ export class RepositoriesNode extends SubscribeableViewNode {
parent = parent.getParent(); parent = parent.getParent();
} }
void this.view.reveal(node /*, { expand: true } */);
void this.view.reveal(node, { expand: true });
} }
catch (ex) { catch (ex) {
Logger.error(ex); Logger.error(ex);

+ 1
- 1
src/views/nodes/resultsCommitsNode.ts View File

@ -46,7 +46,7 @@ export class ResultsCommitsNode extends ViewNode implements PageableViewNode {
const item = new TreeItem( const item = new TreeItem(
label, label,
log && log.count > 0 ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.None
log && log.count > 0 ? TreeItemCollapsibleState.Collapsed : TreeItemCollapsibleState.None
); );
item.contextValue = this._contextValue; item.contextValue = this._contextValue;

+ 1
- 1
src/views/searchView.ts View File

@ -149,7 +149,7 @@ export class SearchView extends ViewBase {
const root = this.ensureRoot(); const root = this.ensureRoot();
root.addOrReplace(results, !this.keepResults); root.addOrReplace(results, !this.keepResults);
setTimeout(() => this._tree!.reveal(results, { select: true }), 250);
setImmediate(() => this.reveal(results, { select: true, expand: true }));
} }
private async getSearchLabel( private async getSearchLabel(

+ 1
- 1
src/views/viewBase.ts View File

@ -181,7 +181,7 @@ export abstract class ViewBase> implements TreeData
options?: { options?: {
select?: boolean; select?: boolean;
focus?: boolean; focus?: boolean;
// expand?: boolean | number;
expand?: boolean | number;
} }
) { ) {
if (this._tree === undefined) return; if (this._tree === undefined) return;

Loading…
Cancel
Save