Skip to content

Commit 8d72db3

Browse files
committed
Adds feature #3297 - Setting for compact graph
1 parent c97d5a3 commit 8d72db3

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,6 +2807,13 @@
28072807
"scope": "window",
28082808
"order": 27
28092809
},
2810+
"gitlens.graph.useCompactByDefault": {
2811+
"type": "boolean",
2812+
"default": false,
2813+
"markdownDescription": "Specifies whether to default to using the compact graph layout in the _Commit Graph_",
2814+
"scope": "window",
2815+
"order": 28
2816+
},
28102817
"gitlens.graph.commitOrdering": {
28112818
"type": "string",
28122819
"default": "date",

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ export interface GraphConfig {
381381
readonly additionalTypes: GraphMinimapMarkersAdditionalTypes[];
382382
};
383383
readonly highlightRowsOnRefHover: boolean;
384+
readonly useCompactByDefault: boolean;
384385
readonly layout: 'editor' | 'panel';
385386
readonly scrollRowPadding: number;
386387
readonly showDetailsView: 'open' | 'selection' | false;

src/plus/webviews/graph/graphWebview.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,10 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
17701770
}
17711771
}
17721772

1773+
if (this._graph == undefined && this.getComponentConfig().useCompactByDefault && this._firstSelection) {
1774+
void this.setColumnMode('graph', 'compact');
1775+
}
1776+
17731777
return columnsSettings;
17741778
}
17751779

@@ -1851,6 +1855,7 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
18511855
showGhostRefsOnRowHover: configuration.get('graph.showGhostRefsOnRowHover'),
18521856
showRemoteNamesOnRefs: configuration.get('graph.showRemoteNames'),
18531857
idLength: configuration.get('advanced.abbreviatedShaLength'),
1858+
useCompactByDefault: configuration.get('graph.useCompactByDefault'),
18541859
};
18551860
return config;
18561861
}

src/plus/webviews/graph/protocol.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export interface GraphComponentConfig {
184184
showGhostRefsOnRowHover?: boolean;
185185
showRemoteNamesOnRefs?: boolean;
186186
idLength?: number;
187+
useCompactByDefault?: boolean;
187188
}
188189

189190
export interface GraphColumnConfig {

src/webviews/apps/settings/partials/commit-graph.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,18 @@ <h2>
212212
</p>
213213
</div>
214214

215+
<div class="setting">
216+
<div class="setting__input">
217+
<input
218+
id="graph.useCompactByDefault"
219+
name="graph.useCompactByDefault"
220+
type="checkbox"
221+
data-setting
222+
/>
223+
<label for="graph.useCompactByDefault">Use compact graph view by default</label>
224+
</div>
225+
</div>
226+
215227
<div class="setting">
216228
<div class="setting__input">
217229
<input id="graph.avatars" name="graph.avatars" type="checkbox" data-setting />

0 commit comments

Comments
 (0)