Skip to content

Commit 3fd26a3

Browse files
committed
Adds feature #3297 - Setting for compact graph
1 parent 1cc51d9 commit 3fd26a3

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
@@ -2772,6 +2772,13 @@
27722772
"scope": "window",
27732773
"order": 27
27742774
},
2775+
"gitlens.graph.useCompactByDefault": {
2776+
"type": "boolean",
2777+
"default": false,
2778+
"markdownDescription": "Specifies whether to default to using the compact graph layout in the _Commit Graph_",
2779+
"scope": "window",
2780+
"order": 28
2781+
},
27752782
"gitlens.graph.commitOrdering": {
27762783
"type": "string",
27772784
"default": "date",

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ export interface GraphConfig {
378378
readonly additionalTypes: GraphMinimapMarkersAdditionalTypes[];
379379
};
380380
readonly highlightRowsOnRefHover: boolean;
381+
readonly useCompactByDefault: boolean;
381382
readonly layout: 'editor' | 'panel';
382383
readonly scrollRowPadding: number;
383384
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)