Skip to content

Commit c16bcf2

Browse files
committed
Fixes views group all command
Adds reset all views command
1 parent 608ba50 commit c16bcf2

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

contributions.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9729,7 +9729,7 @@
97299729
{
97309730
"when": "view == gitlens.views.scm.grouped",
97319731
"group": "9_gitlens",
9732-
"order": 98
9732+
"order": 97
97339733
}
97349734
]
97359735
}
@@ -10033,7 +10033,7 @@
1003310033
{
1003410034
"when": "view == gitlens.views.scm.grouped",
1003510035
"group": "9_gitlens",
10036-
"order": 99
10036+
"order": 98
1003710037
}
1003810038
]
1003910039
}
@@ -10434,6 +10434,19 @@
1043410434
]
1043510435
}
1043610436
},
10437+
"gitlens.views.scm.grouped.resetAll": {
10438+
"label": "Reset All Views",
10439+
"enablement": "!gitlens:views:scm:grouped:welcome",
10440+
"menus": {
10441+
"gitlens/views/grouped/attachOrDetach": [
10442+
{
10443+
"when": "view == gitlens.views.scm.grouped",
10444+
"group": "9_gitlens",
10445+
"order": 99
10446+
}
10447+
]
10448+
}
10449+
},
1043710450
"gitlens.views.scm.grouped.searchAndCompare": {
1043810451
"label": "Search & Compare",
1043910452
"icon": "$(gitlens-search-view)",

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9460,6 +9460,11 @@
94609460
"command": "gitlens.views.scm.grouped.repositories.visibility.show",
94619461
"title": "Show Repositories View"
94629462
},
9463+
{
9464+
"command": "gitlens.views.scm.grouped.resetAll",
9465+
"title": "Reset All Views",
9466+
"enablement": "!gitlens:views:scm:grouped:welcome"
9467+
},
94639468
{
94649469
"command": "gitlens.views.scm.grouped.searchAndCompare",
94659470
"title": "Search & Compare",
@@ -13217,6 +13222,10 @@
1321713222
"command": "gitlens.views.scm.grouped.repositories.visibility.show",
1321813223
"when": "false"
1321913224
},
13225+
{
13226+
"command": "gitlens.views.scm.grouped.resetAll",
13227+
"when": "false"
13228+
},
1322013229
{
1322113230
"command": "gitlens.views.scm.grouped.searchAndCompare",
1322213231
"when": "false"
@@ -15125,11 +15134,16 @@
1512515134
{
1512615135
"command": "gitlens.views.scm.grouped.attachAll",
1512715136
"when": "view == gitlens.views.scm.grouped",
15128-
"group": "9_gitlens@98"
15137+
"group": "9_gitlens@97"
1512915138
},
1513015139
{
1513115140
"command": "gitlens.views.scm.grouped.detachAll",
1513215141
"when": "view == gitlens.views.scm.grouped",
15142+
"group": "9_gitlens@98"
15143+
},
15144+
{
15145+
"command": "gitlens.views.scm.grouped.resetAll",
15146+
"when": "view == gitlens.views.scm.grouped",
1513315147
"group": "9_gitlens@99"
1513415148
}
1513515149
],

src/constants.commands.generated.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ export type ContributedCommands =
494494
| 'gitlens.views.scm.grouped.repositories.setAsDefault'
495495
| 'gitlens.views.scm.grouped.repositories.visibility.hide'
496496
| 'gitlens.views.scm.grouped.repositories.visibility.show'
497+
| 'gitlens.views.scm.grouped.resetAll'
497498
| 'gitlens.views.scm.grouped.searchAndCompare'
498499
| 'gitlens.views.scm.grouped.searchAndCompare.attach'
499500
| 'gitlens.views.scm.grouped.searchAndCompare.detach'

src/views/views.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,30 @@ import { WorktreesView } from './worktreesView';
4848

4949
const defaultScmGroupedViews = {
5050
commits: true,
51+
worktrees: true,
5152
branches: true,
5253
remotes: true,
5354
stashes: true,
5455
tags: true,
55-
worktrees: true,
5656
contributors: true,
5757
fileHistory: false,
5858
repositories: false,
59-
searchAndCompare: false,
6059
launchpad: false,
60+
searchAndCompare: false,
61+
} as const;
62+
63+
const allScmGroupedViews = {
64+
commits: true,
65+
worktrees: true,
66+
branches: true,
67+
remotes: true,
68+
stashes: true,
69+
tags: true,
70+
contributors: true,
71+
fileHistory: true,
72+
repositories: true,
73+
launchpad: true,
74+
searchAndCompare: true,
6175
} as const;
6276

6377
export class Views implements Disposable {
@@ -366,9 +380,12 @@ export class Views implements Disposable {
366380
executeCommand(`gitlens.views.${this._scmGroupedView.view.type}.refresh`);
367381
}),
368382
registerCommand('gitlens.views.scm.grouped.attachAll', () =>
369-
updateScmGroupedViewsInConfig(getGroupedViews(defaultScmGroupedViews)),
383+
updateScmGroupedViewsInConfig(getGroupedViews(allScmGroupedViews)),
370384
),
371385
registerCommand('gitlens.views.scm.grouped.detachAll', () => updateScmGroupedViewsInConfig(new Set())),
386+
registerCommand('gitlens.views.scm.grouped.resetAll', () =>
387+
updateScmGroupedViewsInConfig(getGroupedViews(defaultScmGroupedViews)),
388+
),
372389

373390
registerCommand('gitlens.views.scm.grouped.welcome.dismiss', () => {
374391
this._welcomeDismissed = true;

0 commit comments

Comments
 (0)