Selaa lähdekoodia

Refines Workspace context menus & welcome

main
Eric Amodio 1 vuosi sitten
vanhempi
commit
1ff3c7fd25
2 muutettua tiedostoa jossa 124 lisäystä ja 80 poistoa
  1. +117
    -80
      package.json
  2. +7
    -0
      src/views/workspacesView.ts

+ 117
- 80
package.json Näytä tiedosto

@ -4789,7 +4789,7 @@
},
{
"command": "gitlens.showWorkspacesView",
"title": "Show GitKraken Worktrees View",
"title": "Show GitKraken Workspaces View",
"category": "GitLens+"
},
{
@ -6895,28 +6895,25 @@
},
{
"command": "gitlens.views.workspaces.convert",
"title": "Convert to GitKraken Workspace...",
"title": "Convert to Cloud Workspace...",
"category": "GitLens",
"icon": "$(cloud-upload)",
"enablement": "!operationInProgress"
"icon": "$(cloud-upload)"
},
{
"command": "gitlens.views.workspaces.create",
"title": "Create Workspace...",
"title": "Create Cloud Workspace...",
"category": "GitLens",
"icon": "$(add)",
"enablement": "!operationInProgress"
"icon": "$(add)"
},
{
"command": "gitlens.views.workspaces.delete",
"title": "Delete Workspace...",
"category": "GitLens",
"icon": "$(trash)",
"enablement": "!operationInProgress"
"icon": "$(trash)"
},
{
"command": "gitlens.views.workspaces.addRepos",
"title": "Add Repositories to Workspace...",
"title": "Add Repositories...",
"category": "GitLens",
"icon": "$(add)"
},
@ -6928,40 +6925,45 @@
},
{
"command": "gitlens.views.workspaces.locateAllRepos",
"title": "Locate All Repositories for this Workspace...",
"title": "Locate Repositories...",
"category": "GitLens",
"icon": "$(location)"
},
{
"command": "gitlens.views.workspaces.open",
"title": "Open As VS Code Workspace...",
"title": "Open as VS Code Workspace...",
"category": "GitLens",
"icon": "$(window)"
"icon": "$(empty-window)"
},
{
"command": "gitlens.views.workspaces.openRepoNewWindow",
"title": "Open Repository in New Window",
"category": "GitLens",
"icon": "$(folder-opened)"
"icon": "$(empty-window)"
},
{
"command": "gitlens.views.workspaces.openRepoCurrentWindow",
"title": "Open Repository in Current Window",
"title": "Open Repository",
"category": "GitLens",
"icon": "$(folder-opened)"
"icon": "$(window)"
},
{
"command": "gitlens.views.workspaces.openRepoWorkspace",
"title": "Add Repository to Current VS Code Workspace",
"title": "Add Repository to VS Code Workspace",
"category": "GitLens"
},
{
"command": "gitlens.views.workspaces.removeRepo",
"title": "Remove Repository from Workspace...",
"title": "Remove from Cloud Workspace...",
"category": "GitLens",
"icon": "$(trash)"
},
{
"command": "gitlens.views.workspaces.copy",
"title": "Copy",
"category": "GitLens"
},
{
"command": "gitlens.views.workspaces.refresh",
"title": "Refresh",
"category": "GitLens",
@ -9444,7 +9446,7 @@
},
{
"command": "gitlens.views.workspaces.create",
"when": "false"
"when": "gitlens:plus"
},
{
"command": "gitlens.views.workspaces.delete",
@ -9483,6 +9485,10 @@
"when": "false"
},
{
"command": "gitlens.views.workspaces.copy",
"when": "false"
},
{
"command": "gitlens.views.workspaces.refresh",
"when": "false"
},
@ -11071,12 +11077,17 @@
"group": "inline@1"
},
{
"command": "gitlens.views.workspaces.locateAllRepos",
"command": "gitlens.views.workspaces.convert",
"when": "viewItem =~ /gitlens:repositories\\b(?=.*?\\b\\+workspaces\\b)/ && gitlens:plus",
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.views.workspaces.addRepos",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "inline@1"
},
{
"command": "gitlens.views.workspaces.addRepos",
"command": "gitlens.views.workspaces.locateAllRepos",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "inline@2"
},
@ -11086,6 +11097,26 @@
"group": "inline@3"
},
{
"command": "gitlens.views.workspaces.addRepos",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.views.workspaces.locateAllRepos",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "1_gitlens_actions@2"
},
{
"command": "gitlens.views.workspaces.open",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+(cloud|local)\\b)/",
"group": "2_gitlens_quickopen@3"
},
{
"command": "gitlens.views.workspaces.delete",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "6_gitlens_actions@1"
},
{
"command": "gitlens.views.switchToAnotherBranch",
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && viewItem =~ /gitlens:branches\\b/",
"group": "inline@10"
@ -11112,26 +11143,6 @@
"alt": "gitlens.copyRemoteBranchesUrl"
},
{
"command": "gitlens.views.workspaces.locateAllRepos",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.views.workspaces.open",
"when": "viewItem =~ /gitlens:workspace/",
"group": "1_gitlens_actions@2"
},
{
"command": "gitlens.views.workspaces.addRepos",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "1_gitlens_actions@3"
},
{
"command": "gitlens.views.workspaces.delete",
"when": "viewItem =~ /gitlens:workspace\\b(?=.*?\\b\\+cloud\\b)/",
"group": "1_gitlens_actions@4"
},
{
"command": "gitlens.views.switchToAnotherBranch",
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && viewItem =~ /gitlens:branches\\b/",
"group": "1_gitlens_actions@1"
@ -11825,6 +11836,57 @@
"group": "3_gitlens_explore@10"
},
{
"command": "gitlens.views.workspaces.locateRepo",
"when": "viewItem =~ /gitlens:workspaceMissingRepository\\b/",
"group": "inline@1"
},
{
"command": "gitlens.views.workspaces.locateRepo",
"when": "viewItem =~ /gitlens:workspaceMissingRepository\\b/",
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.views.workspaces.removeRepo",
"when": "viewItem =~ /gitlens:workspaceMissingRepository\\b/",
"group": "6_gitlens_actions@1"
},
{
"command": "gitlens.views.workspaces.openRepoNewWindow",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "inline@100",
"alt": "gitlens.views.workspaces.openRepoCurrentWindow"
},
{
"command": "gitlens.views.workspaces.openRepoCurrentWindow",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "0_1gitlens_actions@1"
},
{
"command": "gitlens.views.workspaces.openRepoNewWindow",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "0_1gitlens_actions@2"
},
{
"command": "gitlens.views.workspaces.openRepoWorkspace",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "0_1gitlens_actions@3"
},
{
"command": "gitlens.views.revealRepositoryInExplorer",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "0_2gitlens_actions@1"
},
{
"command": "gitlens.views.workspaces.locateRepo",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)(?!.*?\\b\\+local\\b)/",
"group": "0_2gitlens_actions@2"
},
{
"command": "gitlens.views.workspaces.removeRepo",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)(?!.*?\\b\\+local\\b)/",
"group": "0_3gitlens_actions@1"
},
{
"command": "gitlens.views.push",
"when": "gitlens:hasRemotes && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && viewItem =~ /gitlens:repository\\b/",
"group": "inline@96",
@ -12264,42 +12326,6 @@
"group": "inline@1"
},
{
"command": "gitlens.views.workspaces.locateRepo",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)(?!.*?\\b\\+local\\b)/ || viewItem =~ /gitlens:workspaceMissingRepository\\b/",
"group": "inline@1"
},
{
"command": "gitlens.views.workspaces.locateRepo",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)(?!.*?\\b\\+local\\b)/ || viewItem =~ /gitlens:workspaceMissingRepository\\b/",
"group": "0_gitlens_actions@10"
},
{
"command": "gitlens.views.workspaces.openRepoNewWindow",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "inline@100",
"alt": "gitlens.views.workspaces.openRepoCurrentWindow"
},
{
"command": "gitlens.views.workspaces.openRepoNewWindow",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "0_gitlens_actions@11"
},
{
"command": "gitlens.views.workspaces.openRepoCurrentWindow",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "0_gitlens_actions@12"
},
{
"command": "gitlens.views.workspaces.openRepoWorkspace",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)/",
"group": "0_gitlens_actions@13"
},
{
"command": "gitlens.views.workspaces.removeRepo",
"when": "viewItem =~ /gitlens:repository\\b(?=.*?\\b\\+workspace\\b)(?!.*?\\b\\+local\\b)/ || viewItem =~ /gitlens:workspaceMissingRepository\\b/",
"group": "0_gitlens_actions@11"
},
{
"command": "gitlens.views.stash.rename",
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && viewItem == gitlens:stash",
"group": "inline@98"
@ -12428,7 +12454,7 @@
},
{
"command": "gitlens.views.copy",
"when": "viewItem =~ /gitlens:(?=(autolinked:issue|branch|commit|contributor|folder|history:line|pullrequest|remote|repository|repo-folder|stash|tag|worktree)\\b)/",
"when": "viewItem =~ /gitlens:(?=(autolinked:issue|branch|commit|contributor|folder|history:line|pullrequest|remote|repository|repo-folder|stash|tag|workspace|worktree)\\b)/",
"group": "7_gitlens_cutcopypaste@1"
},
{
@ -14032,6 +14058,12 @@
"key": "ctrl+c",
"mac": "cmd+c",
"when": "gitlens:enabled && focusedView =~ /^gitlens\\.views\\.worktrees/"
},
{
"command": "gitlens.views.workspaces.copy",
"key": "ctrl+c",
"mac": "cmd+c",
"when": "gitlens:enabled && focusedView =~ /^gitlens\\.views\\.workspaces/"
}
],
"customEditors": [
@ -14096,11 +14128,16 @@
},
{
"view": "gitlens.views.workspaces",
"contents": "Workspaces allow you and your organizations to store and sync collections of repositories across your devices and across the full line of GitKraken products.\n\nYou can create multiple workspaces, each of which can contain multiple repositories."
"contents": "Workspaces allow you to easily group and manage multiple repositories together, accessible from anywhere, streamlining your workflow.\n\nCreate workspaces just for yourself or share (coming soon in GitLens) them with your team for faster onboarding and better collaboration."
},
{
"view": "gitlens.views.workspaces",
"contents": "[Create Cloud Workspace](command:gitlens.views.workspaces.create)\n\n☁️ Access is based on your subscription tier, e.g. Free, Pro, etc",
"when": "gitlens:plus"
},
{
"view": "gitlens.views.workspaces",
"contents": "[Start Free Pro Trial](command:gitlens.plus.loginOrSignUp)\n\nStart a free 7-day Pro trial to use GitKraken Workspaces, or [sign in](command:gitlens.plus.loginOrSignUp).\n☁️ Cloud workspaces require a free account while shared cloud workspaces require a trial or subscription.",
"contents": "[Start Free Pro Trial](command:gitlens.plus.loginOrSignUp)\n\nStart a free 7-day Pro trial to use GitKraken Workspaces, or [sign in](command:gitlens.plus.loginOrSignUp).\n☁️ Requires an account and access is based on your subscription tier, e.g. Free, Pro, etc",
"when": "!gitlens:plus"
},
{

+ 7
- 0
src/views/workspacesView.ts Näytä tiedosto

@ -1,12 +1,14 @@
import type { Disposable, TreeViewVisibilityChangeEvent } from 'vscode';
import { ProgressLocation, window } from 'vscode';
import type { WorkspacesViewConfig } from '../config';
import { Commands } from '../constants';
import type { Container } from '../container';
import { unknownGitUri } from '../git/gitUri';
import type { Repository } from '../git/models/repository';
import { ensurePlusFeaturesEnabled } from '../plus/subscription/utils';
import { WorkspaceType } from '../plus/workspaces/models';
import { SubscriptionState } from '../subscription';
import { executeCommand } from '../system/command';
import { openWorkspace, OpenWorkspaceLocation } from '../system/utils';
import type { RepositoriesNode } from './nodes/repositoriesNode';
import { RepositoryNode } from './nodes/repositoryNode';
@ -74,6 +76,11 @@ export class WorkspacesView extends ViewBase
return [
registerViewCommand(
this.getQualifiedCommand('copy'),
() => executeCommand(Commands.ViewsCopy, this.activeSelection, this.selection),
this,
),
registerViewCommand(
this.getQualifiedCommand('refresh'),
() => {
this.container.workspaces.resetWorkspaces();

Ladataan…
Peruuta
Tallenna