Browse Source

Graph: add support for activity column (#2494)

* Add activity column settings and toggling

* Add colors for the column

* Mutes the bar colors

* Renames column to "changes"

* Hides the column by default

* Remove redundant css properties

* Use vscode colors

* Put colors and other params directly into graph style

* Bumps graph dependency
main
Ramin Tadayon 2 years ago
committed by GitHub
parent
commit
9f2221f93e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 9 deletions
  1. +29
    -1
      package.json
  2. +8
    -4
      src/plus/webviews/graph/graphWebview.ts
  3. +6
    -0
      src/webviews/apps/plus/graph/graph.scss
  4. +4
    -4
      yarn.lock

+ 29
- 1
package.json View File

@ -6954,6 +6954,16 @@
"command": "gitlens.graph.columnShaOff",
"title": "Hide SHA",
"category": "GitLens"
},
{
"command": "gitlens.graph.columnChangesOn",
"title": "Show Changes",
"category": "GitLens"
},
{
"command": "gitlens.graph.columnChangesOff",
"title": "Hide Changes",
"category": "GitLens"
}
],
"icons": {
@ -9006,6 +9016,14 @@
"when": "false"
},
{
"command": "gitlens.graph.columnChangesOn",
"when": "false"
},
{
"command": "gitlens.graph.columnChangesOff",
"when": "false"
},
{
"command": "gitlens.enableDebugLogging",
"when": "config.gitlens.outputLevel != debug"
},
@ -11737,6 +11755,16 @@
"command": "gitlens.graph.columnShaOff",
"when": "webviewItem =~ /gitlens:graph:columns\b/ && webviewItemValue =~ /^(?:(?!\bsha\b).)*$/",
"group": "1_columns@3"
},
{
"command": "gitlens.graph.columnChangesOn",
"when": "webviewItem =~ /gitlens:graph:columns\b/ && webviewItemValue =~ /\bchanges\b/",
"group": "1_columns@4"
},
{
"command": "gitlens.graph.columnChangesOff",
"when": "webviewItem =~ /gitlens:graph:columns\b/ && webviewItemValue =~ /^(?:(?!\bchanges\b).)*$/",
"group": "1_columns@4"
}
],
"gitlens/commit/browse": [
@ -13085,7 +13113,7 @@
"vscode:prepublish": "yarn run bundle"
},
"dependencies": {
"@gitkraken/gitkraken-components": "5.0.0",
"@gitkraken/gitkraken-components": "6.0.0",
"@microsoft/fast-element": "1.11.0",
"@microsoft/fast-react-wrapper": "0.3.16-0",
"@octokit/core": "4.2.0",

+ 8
- 4
src/plus/webviews/graph/graphWebview.ts View File

@ -174,6 +174,7 @@ const defaultGraphColumnsSettings: GraphColumnsSettings = {
author: { width: 130, isHidden: false },
datetime: { width: 130, isHidden: false },
sha: { width: 130, isHidden: false },
changes: { width: 130, isHidden: true },
};
export class GraphWebview extends WebviewBase<State> {
@ -412,6 +413,8 @@ export class GraphWebview extends WebviewBase {
registerCommand('gitlens.graph.columnDateTimeOff', () => this.toggleColumn('datetime', false)),
registerCommand('gitlens.graph.columnShaOn', () => this.toggleColumn('sha', true)),
registerCommand('gitlens.graph.columnShaOff', () => this.toggleColumn('sha', false)),
registerCommand('gitlens.graph.columnChangesOn', () => this.toggleColumn('changes', true)),
registerCommand('gitlens.graph.columnChangesOff', () => this.toggleColumn('changes', false)),
registerCommand('gitlens.graph.copyDeepLinkToBranch', this.copyDeepLinkToBranch, this),
registerCommand('gitlens.graph.copyDeepLinkToCommit', this.copyDeepLinkToCommit, this),
@ -1774,11 +1777,14 @@ export class GraphWebview extends WebviewBase {
const ref =
this._selectedId == null || this._selectedId === GitRevision.uncommitted ? 'HEAD' : this._selectedId;
const columns = this.getColumns();
const columnSettings = this.getColumnSettings(columns);
const dataPromise = this.container.git.getCommitsForGraph(
this.repository.path,
this._panel!.webview.asWebviewUri.bind(this._panel!.webview),
{
include: { stats: configuration.get('graph.experimental.minimap.enabled') },
include: { stats: configuration.get('graph.experimental.minimap.enabled') || !columnSettings.changes.isHidden },
limit: limit,
ref: ref,
},
@ -1807,8 +1813,6 @@ export class GraphWebview extends WebviewBase {
this.setSelectedRows(data.id);
}
const columns = this.getColumns();
const lastFetched = await this.repository.getLastFetched();
const branch = await this.repository.getBranch();
@ -1834,7 +1838,7 @@ export class GraphWebview extends WebviewBase {
hasMore: data.paging?.hasMore ?? false,
}
: undefined,
columns: this.getColumnSettings(columns),
columns: columnSettings,
config: this.getComponentConfig(),
context: {
header: this.getColumnHeaderContext(columns),

+ 6
- 0
src/webviews/apps/plus/graph/graph.scss View File

@ -33,6 +33,12 @@ body {
border-color: var(--vscode-scrollbarSlider-background);
}
}
--color-graph-stats-added: var(--vscode-gitDecoration-addedResourceForeground);
--color-graph-stats-deleted: var(--vscode-gitDecoration-deletedResourceForeground);
--color-graph-stats-files: var(--vscode-gitDecoration-modifiedResourceForeground);
--graph-stats-bar-height: 40%;
--graph-stats-bar-border-radius: 5px;
}
::-webkit-scrollbar-corner {

+ 4
- 4
yarn.lock View File

@ -185,10 +185,10 @@
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
"@gitkraken/gitkraken-components@5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-5.0.0.tgz#2898918a9c83c01941251eb738c28d54c39d7b7f"
integrity sha512-S3mavyTM/M5VOn+eUYy/BRGHF8rK3n0s6x2/i+OCilUobchXh5T4NvnDvAQ2cQgkb0Yv9UtiwO/mjsgq5PvKYQ==
"@gitkraken/gitkraken-components@6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-6.0.0.tgz#fc9333c3057a4f1aafeb4cf968301dd5ed7ab69e"
integrity sha512-tcCqDLT03UfqqA1Rkhc0SP0eqnkUbLYGOKIwhWa7liKLTJBWPuFSgyAUqglHQtrXD25jtHDPpktO9GMgHvIIWg==
dependencies:
"@axosoft/react-virtualized" "9.22.3-gitkraken.3"
classnames "2.3.2"

||||||
x
 
000:0
Loading…
Cancel
Save