From e398897a7ebebcf0e7a70754420c7fc297368b74 Mon Sep 17 00:00:00 2001 From: Ramin Tadayon <67011668+axosoft-ramint@users.noreply.github.com> Date: Fri, 16 Dec 2022 03:52:50 -0700 Subject: [PATCH] Add graph setting for auto-dimming merge commit rows (#2401) --- package.json | 7 +++++++ src/config.ts | 1 + src/plus/webviews/graph/graphWebview.ts | 2 ++ src/plus/webviews/graph/protocol.ts | 1 + src/webviews/apps/plus/graph/GraphWrapper.tsx | 1 + src/webviews/apps/settings/partials/commit-graph.html | 14 ++++++++++++++ 6 files changed, 26 insertions(+) diff --git a/package.json b/package.json index c8a14fc..5a97e34 100644 --- a/package.json +++ b/package.json @@ -2236,6 +2236,13 @@ "scope": "window", "order": 24 }, + "gitlens.graph.dimMergeCommits": { + "type": "boolean", + "default": false, + "markdownDescription": "Specifies whether to always dim rows with merge commits in the _Commit Graph_", + "scope": "window", + "order": 25 + }, "gitlens.graph.commitOrdering": { "type": "string", "default": "date", diff --git a/src/config.ts b/src/config.ts index ba3755b..c771f27 100644 --- a/src/config.ts +++ b/src/config.ts @@ -387,6 +387,7 @@ export interface GraphConfig { dateFormat: DateTimeFormat | string | null; dateStyle: DateStyle | null; defaultItemLimit: number; + dimMergeCommits: boolean; highlightRowsOnRefHover: boolean; scrollRowPadding: number; showDetailsView: 'open' | 'selection' | false; diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 62941db..c626515 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -529,6 +529,7 @@ export class GraphWebview extends WebviewBase { configuration.changed(e, 'graph.avatars') || configuration.changed(e, 'graph.dateFormat') || configuration.changed(e, 'graph.dateStyle') || + configuration.changed(e, 'graph.dimMergeCommits') || configuration.changed(e, 'graph.highlightRowsOnRefHover') || configuration.changed(e, 'graph.scrollRowPadding') || configuration.changed(e, 'graph.showGhostRefsOnRowHover') || @@ -1453,6 +1454,7 @@ export class GraphWebview extends WebviewBase { dateFormat: configuration.get('graph.dateFormat') ?? configuration.get('defaultDateFormat') ?? 'short+short', dateStyle: configuration.get('graph.dateStyle') ?? configuration.get('defaultDateStyle'), + dimMergeCommits: configuration.get('graph.dimMergeCommits'), enableMultiSelection: false, highlightRowsOnRefHover: configuration.get('graph.highlightRowsOnRefHover'), scrollRowPadding: configuration.get('graph.scrollRowPadding'), diff --git a/src/plus/webviews/graph/protocol.ts b/src/plus/webviews/graph/protocol.ts index 3f7b5c1..9fb32fa 100644 --- a/src/plus/webviews/graph/protocol.ts +++ b/src/plus/webviews/graph/protocol.ts @@ -107,6 +107,7 @@ export interface GraphComponentConfig { avatars?: boolean; dateFormat: DateTimeFormat | string; dateStyle: DateStyle; + dimMergeCommits?: boolean; enableMultiSelection?: boolean; highlightRowsOnRefHover?: boolean; scrollRowPadding?: number; diff --git a/src/webviews/apps/plus/graph/GraphWrapper.tsx b/src/webviews/apps/plus/graph/GraphWrapper.tsx index 2e1a37b..6a64995 100644 --- a/src/webviews/apps/plus/graph/GraphWrapper.tsx +++ b/src/webviews/apps/plus/graph/GraphWrapper.tsx @@ -941,6 +941,7 @@ export function GraphWrapper({ columnsSettings={columns} contexts={context} cssVariables={styleProps?.cssVariables} + dimMergeCommits={graphConfig?.dimMergeCommits} enableMultiSelection={graphConfig?.enableMultiSelection} excludeRefsById={excludeRefsById} excludeByType={excludeTypes} diff --git a/src/webviews/apps/settings/partials/commit-graph.html b/src/webviews/apps/settings/partials/commit-graph.html index 3da60e9..913e1f3 100644 --- a/src/webviews/apps/settings/partials/commit-graph.html +++ b/src/webviews/apps/settings/partials/commit-graph.html @@ -135,6 +135,20 @@
+ +
+
+ +
+
+