Skip to content

Commit

Permalink
Adds feature #3297 - Setting for compact graph
Browse files Browse the repository at this point in the history
  • Loading branch information
TJohnsonSE committed May 18, 2024
1 parent 1cc51d9 commit 542ecb7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]

## [15.0.4] - 2024-05-17

- Adds [#3297](https://github.com/gitkraken/vscode-gitlens/issues/3297) - Setting for Graph compact mode

## [15.0.3] - 2024-05-14

- Fixes [#3288](https://github.com/gitkraken/vscode-gitlens/issues/3288) - Branch, Tags, Stashes, Local Branch, and Remote Branch "Markers" Are Missing/Removed From Minimap
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,13 @@
"scope": "window",
"order": 27
},
"gitlens.graph.useCompactByDefault": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to default to using the compact graph layout in the _Commit Graph_",
"scope": "window",
"order": 28
},
"gitlens.graph.commitOrdering": {
"type": "string",
"default": "date",
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ export interface GraphConfig {
readonly additionalTypes: GraphMinimapMarkersAdditionalTypes[];
};
readonly highlightRowsOnRefHover: boolean;
readonly useCompactByDefault: boolean;
readonly layout: 'editor' | 'panel';
readonly scrollRowPadding: number;
readonly showDetailsView: 'open' | 'selection' | false;
Expand Down
5 changes: 5 additions & 0 deletions src/plus/webviews/graph/graphWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,10 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
}
}

if (this._graph == undefined && this.getComponentConfig().useCompactByDefault && this._firstSelection) {
void this.setColumnMode('graph', 'compact');
}

return columnsSettings;
}

Expand Down Expand Up @@ -1851,6 +1855,7 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
showGhostRefsOnRowHover: configuration.get('graph.showGhostRefsOnRowHover'),
showRemoteNamesOnRefs: configuration.get('graph.showRemoteNames'),
idLength: configuration.get('advanced.abbreviatedShaLength'),
useCompactByDefault: configuration.get('graph.useCompactByDefault'),
};
return config;
}
Expand Down
1 change: 1 addition & 0 deletions src/plus/webviews/graph/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export interface GraphComponentConfig {
showGhostRefsOnRowHover?: boolean;
showRemoteNamesOnRefs?: boolean;
idLength?: number;
useCompactByDefault?: boolean;
}

export interface GraphColumnConfig {
Expand Down
12 changes: 12 additions & 0 deletions src/webviews/apps/settings/partials/commit-graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ <h2>
</p>
</div>

<div class="setting">
<div class="setting__input">
<input
id="graph.useCompactByDefault"
name="graph.useCompactByDefault"
type="checkbox"
data-setting
/>
<label for="graph.useCompactByDefault">Use compact graph view by default</label>
</div>
</div>

<div class="setting">
<div class="setting__input">
<input id="graph.avatars" name="graph.avatars" type="checkbox" data-setting />
Expand Down

0 comments on commit 542ecb7

Please sign in to comment.