Browse Source

Continues refining context menus

- Consolidates Open on Remote commands into "Open on Remote (Web)" submenu
 - Enables "Open on Remote (Web)" submenu by default
 - More ordering refinements
main
Eric Amodio 1 year ago
parent
commit
0af8ba29bb
2 changed files with 140 additions and 84 deletions
  1. +129
    -73
      package.json
  2. +11
    -11
      src/webviews/apps/settings/partials/menus.html

+ 129
- 73
package.json View File

@ -3222,7 +3222,7 @@
"clipboard": true, "clipboard": true,
"compare": true, "compare": true,
"history": true, "history": true,
"remote": false
"remote": true
}, },
"editorGroup": { "editorGroup": {
"blame": true, "blame": true,
@ -3232,13 +3232,13 @@
"clipboard": true, "clipboard": true,
"compare": true, "compare": true,
"history": true, "history": true,
"remote": false
"remote": true
}, },
"explorer": { "explorer": {
"clipboard": true, "clipboard": true,
"compare": true, "compare": true,
"history": true, "history": true,
"remote": false
"remote": true
}, },
"ghpr": { "ghpr": {
"worktree": true "worktree": true
@ -3262,12 +3262,14 @@
"openClose": true, "openClose": true,
"stash": true "stash": true
}, },
"scmItemInline": {},
"scmItemInline": {
"stash": false
},
"scmItem": { "scmItem": {
"clipboard": true, "clipboard": true,
"compare": true, "compare": true,
"history": true, "history": true,
"remote": false,
"remote": true,
"share": true, "share": true,
"stash": true "stash": true
} }
@ -9439,37 +9441,29 @@
], ],
"editor/context": [ "editor/context": [
{ {
"submenu": "gitlens/editor/context/changes",
"when": "editorTextFocus && config.gitlens.menus.editor.compare && resourceScheme != output",
"group": "1_z_gitlens_changes@1"
},
{
"command": "gitlens.openCommitOnRemote",
"when": "editorTextFocus && gitlens:activeFileStatus =~ /remotes/ && config.gitlens.menus.editor.remote && resourceScheme != output",
"group": "1_z_gitlens_changes@4",
"alt": "gitlens.copyRemoteCommitUrl"
"command": "gitlens.openWorkingFile",
"when": "editorTextFocus && config.gitlens.menus.editor.compare && resourceScheme == gitlens",
"group": "1_z_gitlens@0"
}, },
{ {
"command": "gitlens.openFileOnRemote",
"when": "editorTextFocus && gitlens:activeFileStatus =~ /remotes/ && config.gitlens.menus.editor.remote && resourceScheme != output",
"group": "1_z_gitlens_changes@2",
"alt": "gitlens.copyRemoteFileUrlToClipboard"
"submenu": "gitlens/editor/context/changes",
"when": "editorTextFocus && config.gitlens.menus.editor.compare && resourceScheme != output",
"group": "1_z_gitlens_open@1"
}, },
{ {
"command": "gitlens.openFileOnRemoteFrom",
"submenu": "gitlens/editor/context/openOn",
"when": "editorTextFocus && gitlens:activeFileStatus =~ /remotes/ && config.gitlens.menus.editor.remote && resourceScheme != output", "when": "editorTextFocus && gitlens:activeFileStatus =~ /remotes/ && config.gitlens.menus.editor.remote && resourceScheme != output",
"group": "1_z_gitlens_changes@3",
"alt": "gitlens.copyRemoteFileUrlFrom"
"group": "1_z_gitlens_open@2"
}, },
{ {
"submenu": "gitlens/editor/annotations", "submenu": "gitlens/editor/annotations",
"when": "editorTextFocus && gitlens:activeFileStatus =~ /blameable/ && config.gitlens.menus.editor.blame && resourceScheme != output", "when": "editorTextFocus && gitlens:activeFileStatus =~ /blameable/ && config.gitlens.menus.editor.blame && resourceScheme != output",
"group": "1_z_gitlens_file@1"
"group": "1_z_gitlens_open_file@1"
}, },
{ {
"submenu": "gitlens/editor/history", "submenu": "gitlens/editor/history",
"when": "gitlens:activeFileStatus =~ /tracked/ && config.gitlens.menus.editor.history && resourceScheme != output", "when": "gitlens:activeFileStatus =~ /tracked/ && config.gitlens.menus.editor.history && resourceScheme != output",
"group": "1_z_gitlens_file@2"
"group": "1_z_gitlens_open_file@2"
} }
], ],
"editor/context/copy": [ "editor/context/copy": [
@ -9684,31 +9678,24 @@
"group": "1_cutcopypaste@101" "group": "1_cutcopypaste@101"
}, },
{ {
"submenu": "gitlens/editor/changes",
"when": "gitlens:enabled && config.gitlens.menus.editorTab.compare && isFileSystemResource",
"group": "2_a_gitlens_changes@0"
},
{
"command": "gitlens.openWorkingFile", "command": "gitlens.openWorkingFile",
"when": "resourceScheme == gitlens && isFileSystemResource", "when": "resourceScheme == gitlens && isFileSystemResource",
"group": "2_a_gitlens_changes@1"
"group": "2_a_gitlens@0"
}, },
{ {
"command": "gitlens.openFileOnRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && config.gitlens.menus.editorTab.remote && isFileSystemResource",
"group": "2_a_gitlens_changes@2",
"alt": "gitlens.copyRemoteFileUrlWithoutRange"
"submenu": "gitlens/editor/changes",
"when": "gitlens:enabled && config.gitlens.menus.editorTab.compare && isFileSystemResource",
"group": "2_a_gitlens_open@1"
}, },
{ {
"command": "gitlens.openFileOnRemoteFrom",
"submenu": "gitlens/editor/openOn",
"when": "gitlens:enabled && gitlens:hasRemotes && config.gitlens.menus.editorTab.remote && isFileSystemResource", "when": "gitlens:enabled && gitlens:hasRemotes && config.gitlens.menus.editorTab.remote && isFileSystemResource",
"group": "2_a_gitlens_changes@3",
"alt": "gitlens.copyRemoteFileUrlFrom"
"group": "2_a_gitlens_open@2"
}, },
{ {
"submenu": "gitlens/editor/history", "submenu": "gitlens/editor/history",
"when": "gitlens:enabled && config.gitlens.menus.editorTab.history && isFileSystemResource", "when": "gitlens:enabled && config.gitlens.menus.editorTab.history && isFileSystemResource",
"group": "2_a_gitlens_file@2"
"group": "2_a_gitlens_open_file@1"
} }
], ],
"explorer/context": [ "explorer/context": [
@ -9718,16 +9705,9 @@
"group": "4_t_gitlens@0" "group": "4_t_gitlens@0"
}, },
{ {
"command": "gitlens.openFileOnRemote",
"when": "!explorerResourceIsRoot && !explorerResourceIsFolder && gitlens:enabled && gitlens:hasRemotes && config.gitlens.menus.explorer.remote",
"group": "4_t_gitlens@1",
"alt": "gitlens.copyRemoteFileUrlWithoutRange"
},
{
"command": "gitlens.openFileOnRemoteFrom",
"when": "!explorerResourceIsRoot && !explorerResourceIsFolder && gitlens:enabled && gitlens:hasRemotes && config.gitlens.menus.explorer.remote",
"group": "4_t_gitlens@2",
"alt": "gitlens.copyRemoteFileUrlFrom"
"submenu": "gitlens/explorer/openOn",
"when": "!explorerResourceIsRoot && gitlens:enabled && gitlens:hasRemotes && config.gitlens.menus.explorer.remote",
"group": "4_t_gitlens@1"
}, },
{ {
"submenu": "gitlens/explorer/history", "submenu": "gitlens/explorer/history",
@ -9854,16 +9834,14 @@
"group": "navigation" "group": "navigation"
}, },
{ {
"command": "gitlens.openFileOnRemote",
"submenu": "gitlens/scm/resourceState/openOn",
"when": "gitlens:enabled && gitlens:hasRemotes && scmProvider == git && scmResourceGroup =~ /^(workingTree|index|merge)$/ && config.gitlens.menus.scmItem.remote", "when": "gitlens:enabled && gitlens:hasRemotes && scmProvider == git && scmResourceGroup =~ /^(workingTree|index|merge)$/ && config.gitlens.menus.scmItem.remote",
"group": "1_a_gitlens@1",
"alt": "gitlens.copyRemoteFileUrlWithoutRange"
"group": "navigation"
}, },
{ {
"command": "gitlens.openFileOnRemoteFrom",
"when": "gitlens:enabled && gitlens:hasRemotes && scmProvider == git && scmResourceGroup =~ /^(workingTree|index|merge)$/ && config.gitlens.menus.scmItem.remote",
"group": "1_a_gitlens@2",
"alt": "gitlens.copyRemoteFileUrlFrom"
"submenu": "gitlens/scm/resourceState/history",
"when": "gitlens:enabled && scmProvider == git && scmResourceGroup =~ /^(workingTree|index|merge)$/ && config.gitlens.menus.scmItem.history",
"group": "1_a_gitlens@2"
}, },
{ {
"command": "gitlens.stashSaveFiles", "command": "gitlens.stashSaveFiles",
@ -9871,11 +9849,6 @@
"group": "1_modification@2" "group": "1_modification@2"
}, },
{ {
"submenu": "gitlens/scm/resourceState/history",
"when": "gitlens:enabled && scmProvider == git && scmResourceGroup =~ /^(workingTree|index|merge)$/ && config.gitlens.menus.scmItem.history",
"group": "7_a_gitlens_history@1"
},
{
"submenu": "gitlens/share", "submenu": "gitlens/share",
"when": "gitlens:enabled && scmProvider == git && scmResourceGroup =~ /^(workingTree|index|merge)$/ && config.gitlens.menus.scmItem.share", "when": "gitlens:enabled && scmProvider == git && scmResourceGroup =~ /^(workingTree|index|merge)$/ && config.gitlens.menus.scmItem.share",
"group": "7_a_gitlens_share@1" "group": "7_a_gitlens_share@1"
@ -11093,33 +11066,28 @@
{ {
"command": "gitlens.views.openFile", "command": "gitlens.views.openFile",
"when": "viewItem =~ /gitlens:(file|history:(file|line)|status:file)\\b/", "when": "viewItem =~ /gitlens:(file|history:(file|line)|status:file)\\b/",
"group": "2_gitlens_quickopen@3"
"group": "2_gitlens_quickopen_file@3"
}, },
{ {
"command": "gitlens.views.openFileRevision", "command": "gitlens.views.openFileRevision",
"when": "viewItem =~ /gitlens:file\\b((?=.*?\\b\\+(committed|stashed)\\b)|:results)/", "when": "viewItem =~ /gitlens:file\\b((?=.*?\\b\\+(committed|stashed)\\b)|:results)/",
"group": "2_gitlens_quickopen@4"
"group": "2_gitlens_quickopen_file@4"
}, },
{ {
"command": "gitlens.openFileOnRemote", "command": "gitlens.openFileOnRemote",
"when": "viewItem =~ /gitlens:file\\b((?=.*?\\b\\+committed\\b)|:results)/ && gitlens:hasRemotes", "when": "viewItem =~ /gitlens:file\\b((?=.*?\\b\\+committed\\b)|:results)/ && gitlens:hasRemotes",
"group": "2_gitlens_quickopen@5",
"group": "2_gitlens_quickopen_file@5",
"alt": "gitlens.copyRemoteFileUrlWithoutRange" "alt": "gitlens.copyRemoteFileUrlWithoutRange"
}, },
{ {
"command": "gitlens.openFileHistory",
"when": "view != gitlens.views.fileHistory && viewItem =~ /gitlens:file\\b/",
"group": "2_gitlens_quickopen@6"
},
{
"command": "gitlens.showTimelinePage",
"submenu": "gitlens/commit/file/history",
"when": "viewItem =~ /gitlens:file\\b/", "when": "viewItem =~ /gitlens:file\\b/",
"group": "2_gitlens_quickopen@7"
"group": "3_gitlens_explore@1"
}, },
{ {
"submenu": "gitlens/commit/file/commit", "submenu": "gitlens/commit/file/commit",
"when": "view =~ /^gitlens\\.views\\.(fileHistory|lineHistory)/ && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)/", "when": "view =~ /^gitlens\\.views\\.(fileHistory|lineHistory)/ && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)/",
"group": "3_gitlens_explore@1"
"group": "3_gitlens_explore@2"
}, },
{ {
"command": "gitlens.views.compareWithHead", "command": "gitlens.views.compareWithHead",
@ -12544,6 +12512,21 @@
"group": "2_gitlens@2" "group": "2_gitlens@2"
} }
], ],
"gitlens/commit/file/history": [
{
"command": "gitlens.openFileHistory",
"when": "view != gitlens.views.fileHistory/",
"group": "1_gitlens@1"
},
{
"command": "gitlens.showTimelinePage",
"group": "1_gitlens@2"
},
{
"command": "gitlens.quickOpenFileHistory",
"group": "1_gitlens_quick@1"
}
],
"gitlens/editor/annotations": [ "gitlens/editor/annotations": [
{ {
"command": "gitlens.clearFileAnnotations", "command": "gitlens.clearFileAnnotations",
@ -12634,6 +12617,23 @@
"group": "3_gitlens@2" "group": "3_gitlens@2"
} }
], ],
"gitlens/editor/context/openOn": [
{
"command": "gitlens.openFileOnRemote",
"group": "1_gitlens@2",
"alt": "gitlens.copyRemoteFileUrlToClipboard"
},
{
"command": "gitlens.openFileOnRemoteFrom",
"group": "1_gitlens@3",
"alt": "gitlens.copyRemoteFileUrlFrom"
},
{
"command": "gitlens.openCommitOnRemote",
"group": "1_gitlens_commit@1",
"alt": "gitlens.copyRemoteCommitUrl"
}
],
"gitlens/editor/changes": [ "gitlens/editor/changes": [
{ {
"command": "gitlens.diffWithPrevious", "command": "gitlens.diffWithPrevious",
@ -12667,6 +12667,18 @@
"group": "1_gitlens_quick@1" "group": "1_gitlens_quick@1"
} }
], ],
"gitlens/editor/openOn": [
{
"command": "gitlens.openFileOnRemote",
"group": "1_gitlens@1",
"alt": "gitlens.copyRemoteFileUrlWithoutRange"
},
{
"command": "gitlens.openFileOnRemoteFrom",
"group": "1_gitlens@2",
"alt": "gitlens.copyRemoteFileUrlFrom"
}
],
"gitlens/explorer/changes": [ "gitlens/explorer/changes": [
{ {
"command": "gitlens.diffWithPrevious", "command": "gitlens.diffWithPrevious",
@ -12703,6 +12715,18 @@
"group": "1_gitlens_quick@1" "group": "1_gitlens_quick@1"
} }
], ],
"gitlens/explorer/openOn": [
{
"command": "gitlens.openFileOnRemote",
"group": "1_gitlens@1",
"alt": "gitlens.copyRemoteFileUrlWithoutRange"
},
{
"command": "gitlens.openFileOnRemoteFrom",
"group": "1_gitlens@2",
"alt": "gitlens.copyRemoteFileUrlFrom"
}
],
"gitlens/graph/configuration": [ "gitlens/graph/configuration": [
{ {
"command": "gitlens.graph.switchToEditorLayout", "command": "gitlens.graph.switchToEditorLayout",
@ -12767,6 +12791,18 @@
"group": "1_gitlens_quick@1" "group": "1_gitlens_quick@1"
} }
], ],
"gitlens/scm/resourceState/openOn": [
{
"command": "gitlens.openFileOnRemote",
"group": "1_gitlens@1",
"alt": "gitlens.copyRemoteFileUrlWithoutRange"
},
{
"command": "gitlens.openFileOnRemoteFrom",
"group": "1_gitlens@2",
"alt": "gitlens.copyRemoteFileUrlFrom"
}
],
"gitlens/view/repositories/sections": [ "gitlens/view/repositories/sections": [
{ {
"command": "gitlens.views.repositories.setShowBranchComparisonOn", "command": "gitlens.views.repositories.setShowBranchComparisonOn",
@ -12932,6 +12968,10 @@
"label": "Open Changes with" "label": "Open Changes with"
}, },
{ {
"id": "gitlens/commit/file/history",
"label": "File History"
},
{
"id": "gitlens/editor/annotations", "id": "gitlens/editor/annotations",
"label": "File Annotations", "label": "File Annotations",
"icon": { "icon": {
@ -12944,11 +12984,11 @@
"label": "Open Changes" "label": "Open Changes"
}, },
{ {
"id": "gitlens/editor/changes",
"label": "Open Changes"
"id": "gitlens/editor/context/openOn",
"label": "Open on Remote (Web)"
}, },
{ {
"id": "gitlens/explorer/changes",
"id": "gitlens/editor/changes",
"label": "Open Changes" "label": "Open Changes"
}, },
{ {
@ -12956,10 +12996,22 @@
"label": "File History" "label": "File History"
}, },
{ {
"id": "gitlens/editor/openOn",
"label": "Open on Remote (Web)"
},
{
"id": "gitlens/explorer/changes",
"label": "Open Changes"
},
{
"id": "gitlens/explorer/history", "id": "gitlens/explorer/history",
"label": "File History" "label": "File History"
}, },
{ {
"id": "gitlens/explorer/openOn",
"label": "Open on Remote (Web)"
},
{
"id": "gitlens/graph/configuration", "id": "gitlens/graph/configuration",
"label": "Commit Graph Settings", "label": "Commit Graph Settings",
"icon": "$(gear)" "icon": "$(gear)"
@ -12977,6 +13029,10 @@
"label": "File History" "label": "File History"
}, },
{ {
"id": "gitlens/scm/resourceState/openOn",
"label": "Open on Remote (Web)"
},
{
"id": "gitlens/share", "id": "gitlens/share",
"label": "Share" "label": "Share"
}, },

+ 11
- 11
src/webviews/apps/settings/partials/menus.html View File

@ -52,7 +52,7 @@
data-setting-type="object" data-setting-type="object"
disabled disabled
/> />
<label for="menus.editor.remote">Add <i>Open * on Remote</i> commands</label>
<label for="menus.editor.remote">Add an <i>Open on Remote (Web)</i> submenu</label>
</div> </div>
</div> </div>
@ -154,7 +154,7 @@
data-setting-type="object" data-setting-type="object"
disabled disabled
/> />
<label for="menus.editorTab.remote">Add <i>Open File on Remote *</i> commands</label>
<label for="menus.editorTab.remote">Add an <i>Open on Remote (Web)</i> submenu</label>
</div> </div>
</div> </div>
@ -274,7 +274,7 @@
data-setting-type="object" data-setting-type="object"
disabled disabled
/> />
<label for="menus.explorer.remote">Add <i>Open File on Remote *</i> commands</label>
<label for="menus.explorer.remote">Add an <i>Open on Remote (Web)</i> submenu</label>
</div> </div>
</div> </div>
@ -620,7 +620,7 @@
data-setting-type="object" data-setting-type="object"
disabled disabled
/> />
<label for="menus.scmItem.compare">Add a <i>Open Changes with</i> submenu</label>
<label for="menus.scmItem.compare">Add an <i>Open Changes with</i> submenu</label>
</div> </div>
</div> </div>
@ -634,35 +634,35 @@
data-setting-type="object" data-setting-type="object"
disabled disabled
/> />
<label for="menus.scmItem.remote">Add <i>Open File on Remote *</i> commands</label>
<label for="menus.scmItem.remote">Add an <i>Open on Remote (Web)</i> submenu</label>
</div> </div>
</div> </div>
<div class="setting" data-enablement="menus.scmItem"> <div class="setting" data-enablement="menus.scmItem">
<div class="setting__input"> <div class="setting__input">
<input <input
id="menus.scmItem.stash"
name="menus.scmItem.stash"
id="menus.scmItem.history"
name="menus.scmItem.history"
type="checkbox" type="checkbox"
data-setting data-setting
data-setting-type="object" data-setting-type="object"
disabled disabled
/> />
<label for="menus.scmItem.stash">Add a <i>Stash Changes</i> command</label>
<label for="menus.scmItem.history">Add a <i>File History</i> submenu</label>
</div> </div>
</div> </div>
<div class="setting" data-enablement="menus.scmItem"> <div class="setting" data-enablement="menus.scmItem">
<div class="setting__input"> <div class="setting__input">
<input <input
id="menus.scmItem.history"
name="menus.scmItem.history"
id="menus.scmItem.stash"
name="menus.scmItem.stash"
type="checkbox" type="checkbox"
data-setting data-setting
data-setting-type="object" data-setting-type="object"
disabled disabled
/> />
<label for="menus.scmItem.history">Add a <i>File History</i> submenu</label>
<label for="menus.scmItem.stash">Add a <i>Stash Changes</i> command</label>
</div> </div>
</div> </div>

Loading…
Cancel
Save