Bläddra i källkod

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 år sedan
förälder
incheckning
3d09e0edfa
6 ändrade filer med 6 tillägg och 6 borttagningar
  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 Visa fil

@ -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) {

+ 1
- 1
src/views/nodes/compareResultsNode.ts Visa fil

@ -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;

+ 1
- 1
src/views/nodes/repositoriesNode.ts Visa fil

@ -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);

+ 1
- 1
src/views/nodes/resultsCommitsNode.ts Visa fil

@ -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;

+ 1
- 1
src/views/searchView.ts Visa fil

@ -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(

+ 1
- 1
src/views/viewBase.ts Visa fil

@ -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;

Laddar…
Avbryt
Spara