Browse Source

Adds layout resets to graph columns context menu

main
Ramin Tadayon 1 year ago
parent
commit
82ae7552da
No known key found for this signature in database GPG Key ID: 79D60DDE3DFB95F5
3 changed files with 61 additions and 12 deletions
  1. +29
    -1
      package.json
  2. +28
    -7
      src/plus/webviews/graph/graphWebview.ts
  3. +4
    -4
      yarn.lock

+ 29
- 1
package.json View File

@ -7369,6 +7369,16 @@
"category": "GitLens"
},
{
"command": "gitlens.graph.resetColumnsDefault",
"title": "Reset Columns to Default Layout",
"category": "GitLens"
},
{
"command": "gitlens.graph.resetColumnsCompact",
"title": "Reset Columns to Compact Layout",
"category": "GitLens"
},
{
"command": "gitlens.timeline.refresh",
"title": "Refresh",
"category": "GitLens",
@ -9594,6 +9604,14 @@
"when": "false"
},
{
"command": "gitlens.graph.resetColumnsDefault",
"when": "false"
},
{
"command": "gitlens.graph.resetColumnsCompact",
"when": "false"
},
{
"command": "gitlens.enableDebugLogging",
"when": "config.gitlens.outputLevel != debug"
},
@ -12436,6 +12454,16 @@
"command": "gitlens.graph.columnGraphCompact",
"when": "webviewItem =~ /gitlens:graph:columns\\b/ && webviewItemValue =~ /\\bgraph:visible(?![^,]*\\+compact\\b)/",
"group": "2_columns@1"
},
{
"command": "gitlens.graph.resetColumnsDefault",
"when": "webviewItem =~ /gitlens:graph:columns\\b/",
"group": "3_columns@1"
},
{
"command": "gitlens.graph.resetColumnsCompact",
"when": "webviewItem =~ /gitlens:graph:columns\\b/",
"group": "3_columns@2"
}
],
"gitlens/commit/browse": [
@ -14093,7 +14121,7 @@
"vscode:prepublish": "yarn run bundle"
},
"dependencies": {
"@gitkraken/gitkraken-components": "10.1.0",
"@gitkraken/gitkraken-components": "10.1.2",
"@microsoft/fast-element": "1.12.0",
"@microsoft/fast-react-wrapper": "0.3.18",
"@octokit/core": "4.2.1",

+ 28
- 7
src/plus/webviews/graph/graphWebview.ts View File

@ -177,13 +177,23 @@ import {
} from './protocol';
const defaultGraphColumnsSettings: GraphColumnsSettings = {
ref: { width: 150, isHidden: false },
graph: { width: 150, isHidden: false },
message: { width: 300, isHidden: false },
author: { width: 130, isHidden: false },
datetime: { width: 130, isHidden: false },
sha: { width: 130, isHidden: false },
changes: { width: 130, isHidden: true },
ref: { width: 130, isHidden: false, order: 0 },
graph: { width: 150, mode: undefined, isHidden: false, order: 1 },
message: { width: 300, isHidden: false, order: 2 },
author: { width: 130, isHidden: false, order: 3 },
changes: { width: 200, isHidden: false, order: 4 },
datetime: { width: 130, isHidden: false, order: 5 },
sha: { width: 130, isHidden: false, order: 6 },
};
const compactGraphColumnsSettings: GraphColumnsSettings = {
ref: { width: 32, isHidden: false },
graph: { width: 150, mode: 'compact', isHidden: false },
author: { width: 32, isHidden: false, order: 2 },
message: { width: 500, isHidden: false, order: 3 },
changes: { width: 200, isHidden: false, order: 4 },
datetime: { width: 130, isHidden: true, order: 5 },
sha: { width: 130, isHidden: false, order: 6 },
};
export class GraphWebviewProvider implements WebviewProvider<State> {
@ -422,6 +432,17 @@ export class GraphWebviewProvider implements WebviewProvider {
registerCommand('gitlens.graph.openChangedFileDiffs', this.openAllChanges, this),
registerCommand('gitlens.graph.openChangedFileDiffsWithWorking', this.openAllChangesWithWorking, this),
registerCommand('gitlens.graph.openChangedFileRevisions', this.openRevisions, this),
registerCommand(
'gitlens.graph.resetColumnsDefault',
() => this.updateColumns(defaultGraphColumnsSettings),
this,
),
registerCommand(
'gitlens.graph.resetColumnsCompact',
() => this.updateColumns(compactGraphColumnsSettings),
this,
),
];
}

+ 4
- 4
yarn.lock View File

@ -202,10 +202,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@10.1.0":
version "10.1.0"
resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-10.1.0.tgz#e7139fcd6e57d29827ac5ebcf6b861bb3de33525"
integrity sha512-g+DbbppjZ05g9VOyzWsc1y6LPIDuKvM/Qo2tJEZ1IUH9oNTY9Ti8iR3wCglGPK27F/ruc1QzPjUpX48omBwUPA==
"@gitkraken/gitkraken-components@10.1.2":
version "10.1.2"
resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-10.1.2.tgz#3ef0954400e4475d2bee15da3e7f361efdfbfab6"
integrity sha512-tcBC+Ii2Pz47F8MxHrOFmEvxhRnh3Kh1ybVjGrkS6XCqCsW01A1H5QcdOp6J/jyJfHI+qeJ4sgD8/FwrB6cb/w==
dependencies:
"@axosoft/react-virtualized" "9.22.3-gitkraken.3"
classnames "2.3.2"

Loading…
Cancel
Save