Skip to content

Commit 4ada774

Browse files
committed
Adds star/unstar support for worktrees in views
- Adds star/unstar context menu actions to worktrees - Adds star badge and tooltip display for favorited worktrees Adds star/unstar to branches in the Graph Refactors star/unstar cmds to be context-specific - Improves branch starring to sync local and remote branch pairs
1 parent ba39cd8 commit 4ada774

File tree

12 files changed

+456
-193
lines changed

12 files changed

+456
-193
lines changed

contributions.json

Lines changed: 190 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -4756,6 +4756,101 @@
47564756
"label": "Show Worktrees View",
47574757
"commandPalette": "gitlens:enabled && !gitlens:hasVirtualFolders"
47584758
},
4759+
"gitlens.star.branch:graph": {
4760+
"label": "Add to Favorites",
4761+
"icon": "$(star-empty)",
4762+
"menus": {
4763+
"webview/context": [
4764+
{
4765+
"when": "webviewItem =~ /gitlens:branch\\b(?!.*?\\b\\+starred\\b)/ && !listMultiSelection",
4766+
"group": "8_gitlens_actions",
4767+
"order": 1
4768+
}
4769+
]
4770+
}
4771+
},
4772+
"gitlens.star.branch:views": {
4773+
"label": "Add to Favorites",
4774+
"icon": "$(star-empty)",
4775+
"menus": {
4776+
"view/item/context": [
4777+
{
4778+
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+starred\\b)/ && !listMultiSelection",
4779+
"group": "8_gitlens_actions",
4780+
"order": 1
4781+
},
4782+
{
4783+
"when": "viewItem =~ /gitlens:worktree\\b(?!.*?\\b\\+starred\\b)/ && !listMultiSelection",
4784+
"group": "8_gitlens_actions",
4785+
"order": 1
4786+
}
4787+
]
4788+
}
4789+
},
4790+
"gitlens.star.branch.multi:views": {
4791+
"label": "Add to Favorites",
4792+
"icon": "$(star-empty)",
4793+
"menus": {
4794+
"view/item/context": [
4795+
{
4796+
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+starred\\b)/ && listMultiSelection",
4797+
"group": "8_gitlens_actions",
4798+
"order": 1
4799+
},
4800+
{
4801+
"when": "viewItem =~ /gitlens:worktree\\b(?!.*?\\b\\+starred\\b)/ && listMultiSelection",
4802+
"group": "8_gitlens_actions",
4803+
"order": 1
4804+
}
4805+
]
4806+
}
4807+
},
4808+
"gitlens.star.repository:views": {
4809+
"label": "Add to Favorites",
4810+
"icon": "$(star-empty)",
4811+
"menus": {
4812+
"view/item/context": [
4813+
{
4814+
"when": "viewItem =~ /gitlens:repo-folder\\b(?!.*?\\b\\+starred\\b)/",
4815+
"group": "inline",
4816+
"order": 99
4817+
},
4818+
{
4819+
"when": "viewItem =~ /gitlens:repo-folder\\b(?!.*?\\b\\+starred\\b)/ && !listMultiSelection",
4820+
"group": "8_gitlens_actions_",
4821+
"order": 1
4822+
},
4823+
{
4824+
"when": "viewItem =~ /gitlens:repository\\b(?!.*?\\b\\+(starred|workspace)\\b)/",
4825+
"group": "inline",
4826+
"order": 99
4827+
},
4828+
{
4829+
"when": "viewItem =~ /gitlens:repository\\b(?!.*?\\b\\+(starred|workspace)\\b)/ && !listMultiSelection",
4830+
"group": "8_gitlens_actions_",
4831+
"order": 1
4832+
}
4833+
]
4834+
}
4835+
},
4836+
"gitlens.star.repository.multi:views": {
4837+
"label": "Add to Favorites",
4838+
"icon": "$(star-empty)",
4839+
"menus": {
4840+
"view/item/context": [
4841+
{
4842+
"when": "viewItem =~ /gitlens:repo-folder\\b(?!.*?\\b\\+starred\\b)/ && listMultiSelection",
4843+
"group": "8_gitlens_actions_",
4844+
"order": 1
4845+
},
4846+
{
4847+
"when": "viewItem =~ /gitlens:repository\\b(?!.*?\\b\\+(starred|workspace)\\b)/ && listMultiSelection",
4848+
"group": "8_gitlens_actions_",
4849+
"order": 1
4850+
}
4851+
]
4852+
}
4853+
},
47594854
"gitlens.startWork": {
47604855
"label": "Start Work",
47614856
"icon": "$(rocket)",
@@ -5283,6 +5378,101 @@
52835378
"label": "Toggle Zen Mode",
52845379
"commandPalette": "gitlens:enabled"
52855380
},
5381+
"gitlens.unstar.branch:graph": {
5382+
"label": "Remove from Favorites",
5383+
"icon": "$(star-full)",
5384+
"menus": {
5385+
"webview/context": [
5386+
{
5387+
"when": "webviewItem =~ /gitlens:branch\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
5388+
"group": "8_gitlens_actions",
5389+
"order": 1
5390+
}
5391+
]
5392+
}
5393+
},
5394+
"gitlens.unstar.branch:views": {
5395+
"label": "Remove from Favorites",
5396+
"icon": "$(star-full)",
5397+
"menus": {
5398+
"view/item/context": [
5399+
{
5400+
"when": "viewItem =~ /gitlens:branch\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
5401+
"group": "8_gitlens_actions",
5402+
"order": 1
5403+
},
5404+
{
5405+
"when": "viewItem =~ /gitlens:worktree\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
5406+
"group": "8_gitlens_actions",
5407+
"order": 1
5408+
}
5409+
]
5410+
}
5411+
},
5412+
"gitlens.unstar.branch.multi:views": {
5413+
"label": "Remove from Favorites",
5414+
"icon": "$(star-full)",
5415+
"menus": {
5416+
"view/item/context": [
5417+
{
5418+
"when": "viewItem =~ /gitlens:branch\\b(?=.*?\\b\\+starred\\b)/ && listMultiSelection",
5419+
"group": "8_gitlens_actions",
5420+
"order": 1
5421+
},
5422+
{
5423+
"when": "viewItem =~ /gitlens:worktree\\b(?=.*?\\b\\+starred\\b)/ && listMultiSelection",
5424+
"group": "8_gitlens_actions",
5425+
"order": 1
5426+
}
5427+
]
5428+
}
5429+
},
5430+
"gitlens.unstar.repository:views": {
5431+
"label": "Remove from Favorites",
5432+
"icon": "$(star-full)",
5433+
"menus": {
5434+
"view/item/context": [
5435+
{
5436+
"when": "viewItem =~ /gitlens:repo-folder\\b(?=.*?\\b\\+starred\\b)/",
5437+
"group": "inline",
5438+
"order": 99
5439+
},
5440+
{
5441+
"when": "viewItem =~ /gitlens:repo-folder\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
5442+
"group": "8_gitlens_actions_",
5443+
"order": 1
5444+
},
5445+
{
5446+
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+starred\\b)/",
5447+
"group": "inline",
5448+
"order": 99
5449+
},
5450+
{
5451+
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
5452+
"group": "8_gitlens_actions_",
5453+
"order": 1
5454+
}
5455+
]
5456+
}
5457+
},
5458+
"gitlens.unstar.repository.multi:views": {
5459+
"label": "Remove from Favorites",
5460+
"icon": "$(star-full)",
5461+
"menus": {
5462+
"view/item/context": [
5463+
{
5464+
"when": "viewItem =~ /gitlens:repo-folder\\b(?=.*?\\b\\+starred\\b)/ && listMultiSelection",
5465+
"group": "8_gitlens_actions_",
5466+
"order": 1
5467+
},
5468+
{
5469+
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+starred\\b)/ && listMultiSelection",
5470+
"group": "8_gitlens_actions_",
5471+
"order": 1
5472+
}
5473+
]
5474+
}
5475+
},
52865476
"gitlens.views.abortPausedOperation": {
52875477
"label": "Abort",
52885478
"icon": "$(circle-slash)",
@@ -14080,62 +14270,6 @@
1408014270
]
1408114271
}
1408214272
},
14083-
"gitlens.views.star": {
14084-
"label": "Add to Favorites",
14085-
"icon": "$(star-empty)",
14086-
"menus": {
14087-
"view/item/context": [
14088-
{
14089-
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+starred\\b)/ && !listMultiSelection",
14090-
"group": "8_gitlens_actions",
14091-
"order": 1
14092-
},
14093-
{
14094-
"when": "viewItem =~ /gitlens:repo-folder\\b(?!.*?\\b\\+starred\\b)/",
14095-
"group": "inline",
14096-
"order": 99
14097-
},
14098-
{
14099-
"when": "viewItem =~ /gitlens:repo-folder\\b(?!.*?\\b\\+starred\\b)/ && !listMultiSelection",
14100-
"group": "8_gitlens_actions_",
14101-
"order": 1
14102-
},
14103-
{
14104-
"when": "viewItem =~ /gitlens:repository\\b(?!.*?\\b\\+(starred|workspace)\\b)/",
14105-
"group": "inline",
14106-
"order": 99
14107-
},
14108-
{
14109-
"when": "viewItem =~ /gitlens:repository\\b(?!.*?\\b\\+(starred|workspace)\\b)/ && !listMultiSelection",
14110-
"group": "8_gitlens_actions_",
14111-
"order": 1
14112-
}
14113-
]
14114-
}
14115-
},
14116-
"gitlens.views.star.multi": {
14117-
"label": "Add to Favorites",
14118-
"icon": "$(star-empty)",
14119-
"menus": {
14120-
"view/item/context": [
14121-
{
14122-
"when": "viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+starred\\b)/ && listMultiSelection",
14123-
"group": "8_gitlens_actions",
14124-
"order": 1
14125-
},
14126-
{
14127-
"when": "viewItem =~ /gitlens:repo-folder\\b(?!.*?\\b\\+starred\\b)/ && listMultiSelection",
14128-
"group": "8_gitlens_actions_",
14129-
"order": 1
14130-
},
14131-
{
14132-
"when": "viewItem =~ /gitlens:repository\\b(?!.*?\\b\\+(starred|workspace)\\b)/ && listMultiSelection",
14133-
"group": "8_gitlens_actions_",
14134-
"order": 1
14135-
}
14136-
]
14137-
}
14138-
},
1413914273
"gitlens.views.stashes.attach": {
1414014274
"label": "Group into GitLens View",
1414114275
"icon": "$(close)",
@@ -14952,62 +15086,6 @@
1495215086
]
1495315087
}
1495415088
},
14955-
"gitlens.views.unstar": {
14956-
"label": "Remove from Favorites",
14957-
"icon": "$(star-full)",
14958-
"menus": {
14959-
"view/item/context": [
14960-
{
14961-
"when": "viewItem =~ /gitlens:branch\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
14962-
"group": "8_gitlens_actions",
14963-
"order": 1
14964-
},
14965-
{
14966-
"when": "viewItem =~ /gitlens:repo-folder\\b(?=.*?\\b\\+starred\\b)/",
14967-
"group": "inline",
14968-
"order": 99
14969-
},
14970-
{
14971-
"when": "viewItem =~ /gitlens:repo-folder\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
14972-
"group": "8_gitlens_actions_",
14973-
"order": 1
14974-
},
14975-
{
14976-
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+starred\\b)/",
14977-
"group": "inline",
14978-
"order": 99
14979-
},
14980-
{
14981-
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+starred\\b)/ && !listMultiSelection",
14982-
"group": "8_gitlens_actions_",
14983-
"order": 1
14984-
}
14985-
]
14986-
}
14987-
},
14988-
"gitlens.views.unstar.multi": {
14989-
"label": "Remove from Favorites",
14990-
"icon": "$(star-full)",
14991-
"menus": {
14992-
"view/item/context": [
14993-
{
14994-
"when": "viewItem =~ /gitlens:branch\\b(?=.*?\\b\\+starred\\b)/ && listMultiSelection",
14995-
"group": "8_gitlens_actions",
14996-
"order": 1
14997-
},
14998-
{
14999-
"when": "viewItem =~ /gitlens:repo-folder\\b(?=.*?\\b\\+starred\\b)/ && listMultiSelection",
15000-
"group": "8_gitlens_actions_",
15001-
"order": 1
15002-
},
15003-
{
15004-
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+starred\\b)/ && listMultiSelection",
15005-
"group": "8_gitlens_actions_",
15006-
"order": 1
15007-
}
15008-
]
15009-
}
15010-
},
1501115089
"gitlens.views.workspaces.addRepos": {
1501215090
"label": "Add Repositories...",
1501315091
"icon": "$(add)",

docs/telemetry-events.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)