Browse Source

Adds proper workspace configuration

main
Eric Amodio 1 year ago
parent
commit
d769f2bb91
4 changed files with 241 additions and 2 deletions
  1. +211
    -0
      package.json
  2. +28
    -0
      src/config.ts
  3. +1
    -1
      src/views/nodes/repositoriesNode.ts
  4. +1
    -1
      src/views/workspacesView.ts

+ 211
- 0
package.json View File

@ -1971,6 +1971,217 @@
}
},
{
"id": "workspaces-view",
"title": "GitKraken Workspaces View",
"order": 23,
"properties": {
"gitlens.views.workspaces.showBranchComparison": {
"type": [
"boolean",
"string"
],
"enum": [
false,
"branch",
"working"
],
"enumDescriptions": [
"Hides the branch comparison",
"Compares the current branch with a user-selected reference",
"Compares the working tree with a user-selected reference"
],
"default": "working",
"markdownDescription": "Specifies whether to show a comparison of the current branch or the working tree with a user-selected reference (branch, tag. etc) in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 10
},
"gitlens.views.workspaces.showUpstreamStatus": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the upstream status of the current branch for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 11
},
"gitlens.views.workspaces.includeWorkingTree": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to include working tree file status for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 12
},
"gitlens.views.workspaces.pullRequests.enabled": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to query for pull requests associated with branches and commits in the _GitKraken Workspaces_ view. Requires a connection to a supported remote service (e.g. GitHub)",
"scope": "window",
"order": 20
},
"gitlens.views.workspaces.pullRequests.showForBranches": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show pull requests (if any) associated with branches in the _GitKraken Workspaces_ view. Requires a connection to a supported remote service (e.g. GitHub)",
"scope": "window",
"order": 21
},
"gitlens.views.workspaces.pullRequests.showForCommits": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show pull requests (if any) associated with commits in the _GitKraken Workspaces_ view. Requires a connection to a supported remote service (e.g. GitHub)",
"scope": "window",
"order": 22
},
"gitlens.views.workspaces.showCommits": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the commits on the current branch for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 30
},
"gitlens.views.workspaces.showBranches": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the branches for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 31
},
"gitlens.views.workspaces.showRemotes": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the remotes for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 32
},
"gitlens.views.workspaces.showStashes": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the stashes for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 33
},
"gitlens.views.workspaces.showTags": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the tags for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 34
},
"gitlens.views.workspaces.showContributors": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the contributors for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 35
},
"gitlens.views.workspaces.showWorktrees": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the worktrees for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 36
},
"gitlens.views.workspaces.showIncomingActivity": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show the experimental incoming activity for each repository in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 37
},
"gitlens.views.workspaces.avatars": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 60
},
"gitlens.views.workspaces.branches.layout": {
"type": "string",
"default": "tree",
"enum": [
"list",
"tree"
],
"enumDescriptions": [
"Displays branches as a list",
"Displays branches as a tree when branch names contain slashes `/`"
],
"markdownDescription": "Specifies how the _GitKraken Workspaces_ view will display branches",
"scope": "window",
"order": 70
},
"gitlens.views.workspaces.files.layout": {
"type": "string",
"default": "auto",
"enum": [
"auto",
"list",
"tree"
],
"enumDescriptions": [
"Automatically switches between displaying files as a `tree` or `list` based on the `#gitlens.views.workspaces.files.threshold#` value and the number of files at each nesting level",
"Displays files as a list",
"Displays files as a tree"
],
"markdownDescription": "Specifies how the _GitKraken Workspaces_ view will display files",
"scope": "window",
"order": 80
},
"gitlens.views.workspaces.files.threshold": {
"type": "number",
"default": 5,
"markdownDescription": "Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _GitKraken Workspaces_ view. Only applies when `#gitlens.views.workspaces.files.layout#` is set to `auto`",
"scope": "window",
"order": 81
},
"gitlens.views.workspaces.files.compact": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to compact (flatten) unnecessary file nesting in the _GitKraken Workspaces_ view. Only applies when `#gitlens.views.workspaces.files.layout#` is set to `tree` or `auto`",
"scope": "window",
"order": 82
},
"gitlens.views.workspaces.files.icon": {
"type": "string",
"default": "type",
"enum": [
"status",
"type"
],
"enumDescriptions": [
"Shows the file's status as the icon",
"Shows the file's type (theme icon) as the icon"
],
"markdownDescription": "Specifies how the _GitKraken Workspaces_ view will display file icons",
"scope": "window",
"order": 83
},
"gitlens.views.workspaces.compact": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show the _GitKraken Workspaces_ view in a compact display density",
"scope": "window",
"order": 90
},
"gitlens.views.workspaces.branches.showBranchComparison": {
"type": [
"boolean",
"string"
],
"enum": [
false,
"branch"
],
"enumDescriptions": [
"Hides the branch comparison",
"Compares the branch with a user-selected reference"
],
"default": "branch",
"markdownDescription": "Specifies whether to show a comparison of the branch with a user-selected reference (branch, tag. etc) under each branch in the _GitKraken Workspaces_ view",
"scope": "window",
"order": 100
}
}
},
{
"id": "file-blame",
"title": "File Blame",
"order": 100,

+ 28
- 0
src/config.ts View File

@ -576,6 +576,7 @@ interface ViewsConfigs {
readonly stashes: StashesViewConfig;
readonly tags: TagsViewConfig;
readonly worktrees: WorktreesViewConfig;
readonly workspaces: WorkspacesViewConfig;
}
export type ViewsConfigKeys = keyof ViewsConfigs;
@ -592,6 +593,7 @@ export const viewsConfigKeys: ViewsConfigKeys[] = [
'stashes',
'tags',
'worktrees',
'workspaces',
];
export type ViewsConfig = ViewsCommonConfig & ViewsConfigs;
@ -738,6 +740,32 @@ export interface WorktreesViewConfig {
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
}
export interface WorkspacesViewConfig {
readonly avatars: boolean;
readonly branches: {
readonly layout: ViewBranchesLayout;
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
};
readonly compact: boolean;
readonly files: ViewsFilesConfig;
readonly includeWorkingTree: boolean;
readonly pullRequests: {
readonly enabled: boolean;
readonly showForBranches: boolean;
readonly showForCommits: boolean;
};
readonly showBranchComparison: false | ViewShowBranchComparison;
readonly showBranches: boolean;
readonly showCommits: boolean;
readonly showContributors: boolean;
readonly showIncomingActivity: boolean;
readonly showRemotes: boolean;
readonly showStashes: boolean;
readonly showTags: boolean;
readonly showUpstreamStatus: boolean;
readonly showWorktrees: boolean;
}
export interface ViewsFilesConfig {
readonly compact: boolean;
readonly icon: 'status' | 'type';

+ 1
- 1
src/views/nodes/repositoriesNode.ts View File

@ -127,7 +127,7 @@ export class RepositoriesNode extends SubscribeableViewNode<'repositories', View
protected subscribe() {
const subscriptions = [this.view.container.git.onDidChangeRepositories(this.onRepositoriesChanged, this)];
if (this.view.config.autoReveal) {
if (this.view.id === 'gitlens.views.repositories' && this.view.config.autoReveal) {
subscriptions.push(window.onDidChangeActiveTextEditor(debounce(this.onActiveEditorChanged, 500), this));
}

+ 1
- 1
src/views/workspacesView.ts View File

@ -86,7 +86,7 @@ export class WorkspacesViewNode extends ViewNode<'workspaces-view', WorkspacesVi
}
export class WorkspacesView extends ViewBase<'workspaces', WorkspacesViewNode, WorkspacesViewConfig> {
protected readonly configKey = 'repositories';
protected readonly configKey = 'workspaces';
private _disposable: Disposable | undefined;
constructor(container: Container) {

Loading…
Cancel
Save