Skip to content

Commit d769f2b

Browse files
committed
Adds proper workspace configuration
1 parent b6b8f36 commit d769f2b

4 files changed

Lines changed: 241 additions & 2 deletions

File tree

package.json

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,217 @@
19701970
}
19711971
}
19721972
},
1973+
{
1974+
"id": "workspaces-view",
1975+
"title": "GitKraken Workspaces View",
1976+
"order": 23,
1977+
"properties": {
1978+
"gitlens.views.workspaces.showBranchComparison": {
1979+
"type": [
1980+
"boolean",
1981+
"string"
1982+
],
1983+
"enum": [
1984+
false,
1985+
"branch",
1986+
"working"
1987+
],
1988+
"enumDescriptions": [
1989+
"Hides the branch comparison",
1990+
"Compares the current branch with a user-selected reference",
1991+
"Compares the working tree with a user-selected reference"
1992+
],
1993+
"default": "working",
1994+
"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",
1995+
"scope": "window",
1996+
"order": 10
1997+
},
1998+
"gitlens.views.workspaces.showUpstreamStatus": {
1999+
"type": "boolean",
2000+
"default": true,
2001+
"markdownDescription": "Specifies whether to show the upstream status of the current branch for each repository in the _GitKraken Workspaces_ view",
2002+
"scope": "window",
2003+
"order": 11
2004+
},
2005+
"gitlens.views.workspaces.includeWorkingTree": {
2006+
"type": "boolean",
2007+
"default": false,
2008+
"markdownDescription": "Specifies whether to include working tree file status for each repository in the _GitKraken Workspaces_ view",
2009+
"scope": "window",
2010+
"order": 12
2011+
},
2012+
"gitlens.views.workspaces.pullRequests.enabled": {
2013+
"type": "boolean",
2014+
"default": true,
2015+
"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)",
2016+
"scope": "window",
2017+
"order": 20
2018+
},
2019+
"gitlens.views.workspaces.pullRequests.showForBranches": {
2020+
"type": "boolean",
2021+
"default": true,
2022+
"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)",
2023+
"scope": "window",
2024+
"order": 21
2025+
},
2026+
"gitlens.views.workspaces.pullRequests.showForCommits": {
2027+
"type": "boolean",
2028+
"default": true,
2029+
"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)",
2030+
"scope": "window",
2031+
"order": 22
2032+
},
2033+
"gitlens.views.workspaces.showCommits": {
2034+
"type": "boolean",
2035+
"default": true,
2036+
"markdownDescription": "Specifies whether to show the commits on the current branch for each repository in the _GitKraken Workspaces_ view",
2037+
"scope": "window",
2038+
"order": 30
2039+
},
2040+
"gitlens.views.workspaces.showBranches": {
2041+
"type": "boolean",
2042+
"default": true,
2043+
"markdownDescription": "Specifies whether to show the branches for each repository in the _GitKraken Workspaces_ view",
2044+
"scope": "window",
2045+
"order": 31
2046+
},
2047+
"gitlens.views.workspaces.showRemotes": {
2048+
"type": "boolean",
2049+
"default": true,
2050+
"markdownDescription": "Specifies whether to show the remotes for each repository in the _GitKraken Workspaces_ view",
2051+
"scope": "window",
2052+
"order": 32
2053+
},
2054+
"gitlens.views.workspaces.showStashes": {
2055+
"type": "boolean",
2056+
"default": true,
2057+
"markdownDescription": "Specifies whether to show the stashes for each repository in the _GitKraken Workspaces_ view",
2058+
"scope": "window",
2059+
"order": 33
2060+
},
2061+
"gitlens.views.workspaces.showTags": {
2062+
"type": "boolean",
2063+
"default": true,
2064+
"markdownDescription": "Specifies whether to show the tags for each repository in the _GitKraken Workspaces_ view",
2065+
"scope": "window",
2066+
"order": 34
2067+
},
2068+
"gitlens.views.workspaces.showContributors": {
2069+
"type": "boolean",
2070+
"default": true,
2071+
"markdownDescription": "Specifies whether to show the contributors for each repository in the _GitKraken Workspaces_ view",
2072+
"scope": "window",
2073+
"order": 35
2074+
},
2075+
"gitlens.views.workspaces.showWorktrees": {
2076+
"type": "boolean",
2077+
"default": true,
2078+
"markdownDescription": "Specifies whether to show the worktrees for each repository in the _GitKraken Workspaces_ view",
2079+
"scope": "window",
2080+
"order": 36
2081+
},
2082+
"gitlens.views.workspaces.showIncomingActivity": {
2083+
"type": "boolean",
2084+
"default": false,
2085+
"markdownDescription": "Specifies whether to show the experimental incoming activity for each repository in the _GitKraken Workspaces_ view",
2086+
"scope": "window",
2087+
"order": 37
2088+
},
2089+
"gitlens.views.workspaces.avatars": {
2090+
"type": "boolean",
2091+
"default": true,
2092+
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _GitKraken Workspaces_ view",
2093+
"scope": "window",
2094+
"order": 60
2095+
},
2096+
"gitlens.views.workspaces.branches.layout": {
2097+
"type": "string",
2098+
"default": "tree",
2099+
"enum": [
2100+
"list",
2101+
"tree"
2102+
],
2103+
"enumDescriptions": [
2104+
"Displays branches as a list",
2105+
"Displays branches as a tree when branch names contain slashes `/`"
2106+
],
2107+
"markdownDescription": "Specifies how the _GitKraken Workspaces_ view will display branches",
2108+
"scope": "window",
2109+
"order": 70
2110+
},
2111+
"gitlens.views.workspaces.files.layout": {
2112+
"type": "string",
2113+
"default": "auto",
2114+
"enum": [
2115+
"auto",
2116+
"list",
2117+
"tree"
2118+
],
2119+
"enumDescriptions": [
2120+
"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",
2121+
"Displays files as a list",
2122+
"Displays files as a tree"
2123+
],
2124+
"markdownDescription": "Specifies how the _GitKraken Workspaces_ view will display files",
2125+
"scope": "window",
2126+
"order": 80
2127+
},
2128+
"gitlens.views.workspaces.files.threshold": {
2129+
"type": "number",
2130+
"default": 5,
2131+
"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`",
2132+
"scope": "window",
2133+
"order": 81
2134+
},
2135+
"gitlens.views.workspaces.files.compact": {
2136+
"type": "boolean",
2137+
"default": true,
2138+
"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`",
2139+
"scope": "window",
2140+
"order": 82
2141+
},
2142+
"gitlens.views.workspaces.files.icon": {
2143+
"type": "string",
2144+
"default": "type",
2145+
"enum": [
2146+
"status",
2147+
"type"
2148+
],
2149+
"enumDescriptions": [
2150+
"Shows the file's status as the icon",
2151+
"Shows the file's type (theme icon) as the icon"
2152+
],
2153+
"markdownDescription": "Specifies how the _GitKraken Workspaces_ view will display file icons",
2154+
"scope": "window",
2155+
"order": 83
2156+
},
2157+
"gitlens.views.workspaces.compact": {
2158+
"type": "boolean",
2159+
"default": false,
2160+
"markdownDescription": "Specifies whether to show the _GitKraken Workspaces_ view in a compact display density",
2161+
"scope": "window",
2162+
"order": 90
2163+
},
2164+
"gitlens.views.workspaces.branches.showBranchComparison": {
2165+
"type": [
2166+
"boolean",
2167+
"string"
2168+
],
2169+
"enum": [
2170+
false,
2171+
"branch"
2172+
],
2173+
"enumDescriptions": [
2174+
"Hides the branch comparison",
2175+
"Compares the branch with a user-selected reference"
2176+
],
2177+
"default": "branch",
2178+
"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",
2179+
"scope": "window",
2180+
"order": 100
2181+
}
2182+
}
2183+
},
19732184
{
19742185
"id": "file-blame",
19752186
"title": "File Blame",

src/config.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ interface ViewsConfigs {
576576
readonly stashes: StashesViewConfig;
577577
readonly tags: TagsViewConfig;
578578
readonly worktrees: WorktreesViewConfig;
579+
readonly workspaces: WorkspacesViewConfig;
579580
}
580581

581582
export type ViewsConfigKeys = keyof ViewsConfigs;
@@ -592,6 +593,7 @@ export const viewsConfigKeys: ViewsConfigKeys[] = [
592593
'stashes',
593594
'tags',
594595
'worktrees',
596+
'workspaces',
595597
];
596598

597599
export type ViewsConfig = ViewsCommonConfig & ViewsConfigs;
@@ -738,6 +740,32 @@ export interface WorktreesViewConfig {
738740
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
739741
}
740742

743+
export interface WorkspacesViewConfig {
744+
readonly avatars: boolean;
745+
readonly branches: {
746+
readonly layout: ViewBranchesLayout;
747+
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
748+
};
749+
readonly compact: boolean;
750+
readonly files: ViewsFilesConfig;
751+
readonly includeWorkingTree: boolean;
752+
readonly pullRequests: {
753+
readonly enabled: boolean;
754+
readonly showForBranches: boolean;
755+
readonly showForCommits: boolean;
756+
};
757+
readonly showBranchComparison: false | ViewShowBranchComparison;
758+
readonly showBranches: boolean;
759+
readonly showCommits: boolean;
760+
readonly showContributors: boolean;
761+
readonly showIncomingActivity: boolean;
762+
readonly showRemotes: boolean;
763+
readonly showStashes: boolean;
764+
readonly showTags: boolean;
765+
readonly showUpstreamStatus: boolean;
766+
readonly showWorktrees: boolean;
767+
}
768+
741769
export interface ViewsFilesConfig {
742770
readonly compact: boolean;
743771
readonly icon: 'status' | 'type';

src/views/nodes/repositoriesNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class RepositoriesNode extends SubscribeableViewNode<'repositories', View
127127
protected subscribe() {
128128
const subscriptions = [this.view.container.git.onDidChangeRepositories(this.onRepositoriesChanged, this)];
129129

130-
if (this.view.config.autoReveal) {
130+
if (this.view.id === 'gitlens.views.repositories' && this.view.config.autoReveal) {
131131
subscriptions.push(window.onDidChangeActiveTextEditor(debounce(this.onActiveEditorChanged, 500), this));
132132
}
133133

src/views/workspacesView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class WorkspacesViewNode extends ViewNode<'workspaces-view', WorkspacesVi
8686
}
8787

8888
export class WorkspacesView extends ViewBase<'workspaces', WorkspacesViewNode, WorkspacesViewConfig> {
89-
protected readonly configKey = 'repositories';
89+
protected readonly configKey = 'workspaces';
9090
private _disposable: Disposable | undefined;
9191

9292
constructor(container: Container) {

0 commit comments

Comments
 (0)