Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #3297 - Adds default setting for compact graph #3300

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2814,6 +2814,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 @@ -380,6 +380,7 @@ export interface GraphConfig {
readonly dimMergeCommits: boolean;
readonly highlightRowsOnRefHover: boolean;
readonly layout: 'editor' | 'panel';
readonly useCompactByDefault: boolean;
readonly minimap: {
readonly enabled: boolean;
readonly dataType: 'commits' | 'lines';
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 @@ -1760,6 +1760,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 @@ -1842,6 +1846,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 @@ -185,6 +185,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
Loading