Skip to content

Commit 1701081

Browse files
committed
Allows search & compare view to be grouped
1 parent 65afa4d commit 1701081

File tree

16 files changed

+233
-61
lines changed

16 files changed

+233
-61
lines changed

images/icons/search-view-filled.svg

Lines changed: 1 addition & 0 deletions
Loading

images/icons/search-view.svg

Lines changed: 1 addition & 1 deletion
Loading

images/icons/template/mapping.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"contributors-view-filled": 61752,
6060
"remotes-view-filled": 61753,
6161
"repositories-view-filled": 61754,
62-
"stashes-view-filled": 61755,
63-
"tags-view-filled": 61756,
64-
"worktrees-view-filled": 61757
62+
"search-view-filled": 61755,
63+
"stashes-view-filled": 61756,
64+
"tags-view-filled": 61757,
65+
"worktrees-view-filled": 61758
6566
}

package.json

Lines changed: 154 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8184,8 +8184,7 @@
81848184
},
81858185
{
81868186
"command": "gitlens.views.grouped.branches.moveToNewView",
8187-
"title": "Move to Separate View",
8188-
"icon": "$(gitlens-branches-view)"
8187+
"title": "Move to Separate View"
81898188
},
81908189
{
81918190
"command": "gitlens.views.grouped.branches.setAsDefault",
@@ -8198,8 +8197,7 @@
81988197
},
81998198
{
82008199
"command": "gitlens.views.grouped.commits.moveToNewView",
8201-
"title": "Move to Separate View",
8202-
"icon": "$(gitlens-commits-view)"
8200+
"title": "Move to Separate View"
82038201
},
82048202
{
82058203
"command": "gitlens.views.grouped.commits.setAsDefault",
@@ -8212,8 +8210,7 @@
82128210
},
82138211
{
82148212
"command": "gitlens.views.grouped.contributors.moveToNewView",
8215-
"title": "Move to Separate View",
8216-
"icon": "$(gitlens-contributors-view)"
8213+
"title": "Move to Separate View"
82178214
},
82188215
{
82198216
"command": "gitlens.views.grouped.contributors.setAsDefault",
@@ -8226,8 +8223,7 @@
82268223
},
82278224
{
82288225
"command": "gitlens.views.grouped.remotes.moveToNewView",
8229-
"title": "Move to Separate View",
8230-
"icon": "$(gitlens-remotes-view)"
8226+
"title": "Move to Separate View"
82318227
},
82328228
{
82338229
"command": "gitlens.views.grouped.remotes.setAsDefault",
@@ -8240,22 +8236,33 @@
82408236
},
82418237
{
82428238
"command": "gitlens.views.grouped.repositories.moveToNewView",
8243-
"title": "Move to Separate View",
8244-
"icon": "$(gitlens-repositories-view)"
8239+
"title": "Move to Separate View"
82458240
},
82468241
{
82478242
"command": "gitlens.views.grouped.repositories.setAsDefault",
82488243
"title": "Set as Default View"
82498244
},
8245+
{
8246+
"command": "gitlens.views.grouped.searchAndCompare",
8247+
"title": "Search & Compare",
8248+
"icon": "$(gitlens-search-view)"
8249+
},
8250+
{
8251+
"command": "gitlens.views.grouped.searchAndCompare.moveToNewView",
8252+
"title": "Move to Separate View"
8253+
},
8254+
{
8255+
"command": "gitlens.views.grouped.searchAndCompare.setAsDefault",
8256+
"title": "Set as Default View"
8257+
},
82508258
{
82518259
"command": "gitlens.views.grouped.stashes",
82528260
"title": "Stashes",
82538261
"icon": "$(gitlens-stashes-view)"
82548262
},
82558263
{
82568264
"command": "gitlens.views.grouped.stashes.moveToNewView",
8257-
"title": "Move to Separate View",
8258-
"icon": "$(gitlens-stashes-view)"
8265+
"title": "Move to Separate View"
82598266
},
82608267
{
82618268
"command": "gitlens.views.grouped.stashes.setAsDefault",
@@ -8268,8 +8275,7 @@
82688275
},
82698276
{
82708277
"command": "gitlens.views.grouped.tags.moveToNewView",
8271-
"title": "Move to Separate View",
8272-
"icon": "$(gitlens-tags-view)"
8278+
"title": "Move to Separate View"
82738279
},
82748280
{
82758281
"command": "gitlens.views.grouped.tags.setAsDefault",
@@ -8282,8 +8288,7 @@
82828288
},
82838289
{
82848290
"command": "gitlens.views.grouped.worktrees.moveToNewView",
8285-
"title": "Move to Separate View",
8286-
"icon": "$(gitlens-worktrees-view)"
8291+
"title": "Move to Separate View"
82878292
},
82888293
{
82898294
"command": "gitlens.views.grouped.worktrees.setAsDefault",
@@ -8672,6 +8677,12 @@
86728677
"title": "Copy",
86738678
"category": "GitLens"
86748679
},
8680+
{
8681+
"command": "gitlens.views.searchAndCompare.close",
8682+
"title": "Close",
8683+
"category": "GitLens",
8684+
"icon": "$(close)"
8685+
},
86758686
{
86768687
"command": "gitlens.views.searchAndCompare.refresh",
86778688
"title": "Refresh",
@@ -10045,25 +10056,32 @@
1004510056
"fontCharacter": "\\f13a"
1004610057
}
1004710058
},
10059+
"gitlens-search-view-filled": {
10060+
"description": "search-view-filled icon",
10061+
"default": {
10062+
"fontPath": "dist/glicons.woff2",
10063+
"fontCharacter": "\\f13b"
10064+
}
10065+
},
1004810066
"gitlens-stashes-view-filled": {
1004910067
"description": "stashes-view-filled icon",
1005010068
"default": {
1005110069
"fontPath": "dist/glicons.woff2",
10052-
"fontCharacter": "\\f13b"
10070+
"fontCharacter": "\\f13c"
1005310071
}
1005410072
},
1005510073
"gitlens-tags-view-filled": {
1005610074
"description": "tags-view-filled icon",
1005710075
"default": {
1005810076
"fontPath": "dist/glicons.woff2",
10059-
"fontCharacter": "\\f13c"
10077+
"fontCharacter": "\\f13d"
1006010078
}
1006110079
},
1006210080
"gitlens-worktrees-view-filled": {
1006310081
"description": "worktrees-view-filled icon",
1006410082
"default": {
1006510083
"fontPath": "dist/glicons.woff2",
10066-
"fontCharacter": "\\f13d"
10084+
"fontCharacter": "\\f13e"
1006710085
}
1006810086
}
1006910087
},
@@ -11853,6 +11871,18 @@
1185311871
"command": "gitlens.views.grouped.repositories.setAsDefault",
1185411872
"when": "false"
1185511873
},
11874+
{
11875+
"command": "gitlens.views.grouped.searchAndCompare",
11876+
"when": "false"
11877+
},
11878+
{
11879+
"command": "gitlens.views.grouped.searchAndCompare.moveToNewView",
11880+
"when": "false"
11881+
},
11882+
{
11883+
"command": "gitlens.views.grouped.searchAndCompare.setAsDefault",
11884+
"when": "false"
11885+
},
1185611886
{
1185711887
"command": "gitlens.views.grouped.stashes",
1185811888
"when": "false"
@@ -12173,6 +12203,10 @@
1217312203
"command": "gitlens.views.searchAndCompare.copy",
1217412204
"when": "false"
1217512205
},
12206+
{
12207+
"command": "gitlens.views.searchAndCompare.close",
12208+
"when": "false"
12209+
},
1217612210
{
1217712211
"command": "gitlens.views.searchAndCompare.refresh",
1217812212
"when": "false"
@@ -13836,6 +13870,17 @@
1383613870
"when": "view == gitlens.views.grouped && gitlens:views:grouped:views =~ /\\brepositories\\b/ && gitlens:views:grouped:view == repositories",
1383713871
"group": "navigation@8"
1383813872
},
13873+
{
13874+
"command": "gitlens.views.grouped.searchAndCompare",
13875+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:views =~ /\\bsearchAndCompare\\b/ && gitlens:views:grouped:view != searchAndCompare",
13876+
"group": "navigation@9",
13877+
"alt": "gitlens.views.grouped.searchAndCompare.moveToNewView"
13878+
},
13879+
{
13880+
"submenu": "gitlens/views/grouped/searchAndCompare",
13881+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:views =~ /\\bsearchAndCompare\\b/ && gitlens:views:grouped:view == searchAndCompare",
13882+
"group": "navigation@9"
13883+
},
1383913884
{
1384013885
"command": "gitlens.views.grouped.refresh",
1384113886
"when": "view == gitlens.views.grouped",
@@ -14089,6 +14134,11 @@
1408914134
{
1409014135
"command": "gitlens.views.searchAndCompare.refresh",
1409114136
"when": "view == gitlens.views.searchAndCompare",
14137+
"group": "navigation@98"
14138+
},
14139+
{
14140+
"command": "gitlens.views.searchAndCompare.close",
14141+
"when": "view == gitlens.views.searchAndCompare && config.gitlens.views.grouped.enabled",
1409214142
"group": "navigation@99"
1409314143
},
1409414144
{
@@ -17445,12 +17495,12 @@
1744517495
"gitlens/view/searchAndCompare/new": [
1744617496
{
1744717497
"command": "gitlens.views.searchAndCompare.searchCommits",
17448-
"when": "view == gitlens.views.searchAndCompare",
17498+
"when": "view == gitlens.views.searchAndCompare || (view === gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare)",
1744917499
"group": "navigation@10"
1745017500
},
1745117501
{
1745217502
"command": "gitlens.views.searchAndCompare.selectForCompare",
17453-
"when": "view == gitlens.views.searchAndCompare",
17503+
"when": "view == gitlens.views.searchAndCompare || (view === gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare)",
1745417504
"group": "navigation@11"
1745517505
}
1745617506
],
@@ -17609,6 +17659,38 @@
1760917659
"group": "2_gitlens_actions@3"
1761017660
}
1761117661
],
17662+
"gitlens/views/grouped/searchAndCompare": [
17663+
{
17664+
"command": "gitlens.views.grouped.searchAndCompare.moveToNewView",
17665+
"when": "gitlens:views:grouped:view == searchAndCompare",
17666+
"group": "2_gitlens@1"
17667+
},
17668+
{
17669+
"command": "gitlens.views.grouped.searchAndCompare.setAsDefault",
17670+
"when": "gitlens:views:grouped:view == searchAndCompare && gitlens:views:grouped:default != searchAndCompare",
17671+
"group": "2_gitlens@2"
17672+
},
17673+
{
17674+
"submenu": "gitlens/views/grouped/more",
17675+
"when": "gitlens:views:grouped:view == searchAndCompare",
17676+
"group": "2_gitlens@3"
17677+
},
17678+
{
17679+
"command": "gitlens.views.searchAndCompare.searchCommits",
17680+
"when": "view == gitlens.views.searchAndCompare || (view === gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare)",
17681+
"group": "2_gitlens_actions@1"
17682+
},
17683+
{
17684+
"command": "gitlens.views.searchAndCompare.selectForCompare",
17685+
"when": "view == gitlens.views.searchAndCompare || (view === gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare)",
17686+
"group": "2_gitlens_actions@2"
17687+
},
17688+
{
17689+
"command": "gitlens.views.searchAndCompare.clear",
17690+
"when": "gitlens:views:grouped:view == searchAndCompare",
17691+
"group": "2_gitlens_actions_@1"
17692+
}
17693+
],
1761217694
"gitlens/views/grouped/stashes": [
1761317695
{
1761417696
"command": "gitlens.views.grouped.stashes.moveToNewView",
@@ -17966,6 +18048,36 @@
1796618048
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == repositories",
1796718049
"group": "9_gitlens@1"
1796818050
},
18051+
{
18052+
"command": "gitlens.views.searchAndCompare.setFilesLayoutToAuto",
18053+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare && config.gitlens.views.searchAndCompare.files.layout == tree",
18054+
"group": "3_gitlens@0"
18055+
},
18056+
{
18057+
"command": "gitlens.views.searchAndCompare.setFilesLayoutToList",
18058+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare && config.gitlens.views.searchAndCompare.files.layout == auto",
18059+
"group": "3_gitlens@0"
18060+
},
18061+
{
18062+
"command": "gitlens.views.searchAndCompare.setFilesLayoutToTree",
18063+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare && config.gitlens.views.searchAndCompare.files.layout == list",
18064+
"group": "3_gitlens@0"
18065+
},
18066+
{
18067+
"command": "gitlens.views.searchAndCompare.setShowAvatarsOn",
18068+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare && !config.gitlens.views.searchAndCompare.avatars",
18069+
"group": "5_gitlens@0"
18070+
},
18071+
{
18072+
"command": "gitlens.views.searchAndCompare.setShowAvatarsOff",
18073+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare && config.gitlens.views.searchAndCompare.avatars",
18074+
"group": "5_gitlens@0"
18075+
},
18076+
{
18077+
"command": "gitlens.showSettingsPage!search-compare-view",
18078+
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == searchAndCompare",
18079+
"group": "9_gitlens@1"
18080+
},
1796918081
{
1797018082
"command": "gitlens.views.stashes.setFilesLayoutToAuto",
1797118083
"when": "view == gitlens.views.grouped && gitlens:views:grouped:view == stashes && config.gitlens.views.stashes.files.layout == tree",
@@ -18172,6 +18284,11 @@
1817218284
"label": "Repositories",
1817318285
"icon": "$(gitlens-repositories-view-filled)"
1817418286
},
18287+
{
18288+
"id": "gitlens/views/grouped/searchAndCompare",
18289+
"label": "Search & Compare",
18290+
"icon": "$(gitlens-search-view-filled)"
18291+
},
1817518292
{
1817618293
"id": "gitlens/views/grouped/stashes",
1817718294
"label": "Stashes",
@@ -18701,16 +18818,31 @@
1870118818
"contents": "Search for commits by [message](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22message%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [author](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22author%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [SHA](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22commit%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [file](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22file%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), or [changes](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22change%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D)\n\n[Search Commits...](command:gitlens.views.searchAndCompare.searchCommits)",
1870218819
"when": "!gitlens:hasVirtualFolders"
1870318820
},
18821+
{
18822+
"view": "gitlens.views.grouped",
18823+
"contents": "Search for commits by [message](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22message%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [author](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22author%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [SHA](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22commit%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [file](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22file%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), or [changes](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22change%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D)\n\n[Search Commits...](command:gitlens.views.searchAndCompare.searchCommits)",
18824+
"when": "!gitlens:hasVirtualFolders && gitlens:views:grouped:view == searchAndCompare"
18825+
},
1870418826
{
1870518827
"view": "gitlens.views.searchAndCompare",
1870618828
"contents": "Search for commits by [message](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22message%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [author](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22author%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), or [SHA](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22commit%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D)\n\n[Search Commits...](command:gitlens.views.searchAndCompare.searchCommits)",
1870718829
"when": "gitlens:hasVirtualFolders"
1870818830
},
18831+
{
18832+
"view": "gitlens.views.grouped",
18833+
"contents": "Search for commits by [message](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22message%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [author](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22author%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), or [SHA](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22query%22%3A%22commit%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D)\n\n[Search Commits...](command:gitlens.views.searchAndCompare.searchCommits)",
18834+
"when": "gitlens:hasVirtualFolders && gitlens:views:grouped:view == searchAndCompare"
18835+
},
1870918836
{
1871018837
"view": "gitlens.views.searchAndCompare",
1871118838
"contents": "Compare a <branch, tag, or ref> with another <branch, tag, or ref>\n\n[Compare References...](command:gitlens.views.searchAndCompare.selectForCompare)",
1871218839
"when": "!gitlens:hasVirtualFolders"
1871318840
},
18841+
{
18842+
"view": "gitlens.views.grouped",
18843+
"contents": "Compare a <branch, tag, or ref> with another <branch, tag, or ref>\n\n[Compare References...](command:gitlens.views.searchAndCompare.selectForCompare)",
18844+
"when": "!gitlens:hasVirtualFolders && gitlens:views:grouped:view == searchAndCompare"
18845+
},
1871418846
{
1871518847
"view": "gitlens.views.drafts",
1871618848
"contents": "Cloud Patches ᴘʀᴇᴠɪᴇᴡ — easily and securely share code with your teammates or other developers, accessible from anywhere, streamlining your workflow with better collaboration."
@@ -18956,7 +19088,7 @@
1895619088
{
1895719089
"id": "gitlens.views.searchAndCompare",
1895819090
"name": "Search & Compare",
18959-
"when": "!gitlens:disabled",
19091+
"when": "!gitlens:disabled && (!config.gitlens.views.grouped.enabled || (config.gitlens.views.grouped.enabled && gitlens:views:grouped:views && !(gitlens:views:grouped:views =~ /\\bsearchAndCompare\\b/)))",
1896019092
"contextualTitle": "GitLens",
1896119093
"icon": "$(gitlens-search-view)",
1896219094
"initialSize": 2,

src/constants.views.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ export type TreeViewTypeFromId<T extends TreeViewIds> = T extends `gitlens.views
2323

2424
export type GroupableTreeViewTypes = Extract<
2525
TreeViewTypes,
26-
'branches' | 'commits' | 'contributors' | 'remotes' | 'repositories' | 'stashes' | 'tags' | 'worktrees'
26+
| 'branches'
27+
| 'commits'
28+
| 'contributors'
29+
| 'remotes'
30+
| 'repositories'
31+
| 'searchAndCompare'
32+
| 'stashes'
33+
| 'tags'
34+
| 'worktrees'
2735
>;
2836
export type GroupableTreeViewIds<T extends GroupableTreeViewTypes = GroupableTreeViewTypes> = TreeViewIds<T>;
2937

0 commit comments

Comments
 (0)