From 3c67f2c44c8aa16626d54760ae7a7e8f18c19c37 Mon Sep 17 00:00:00 2001 From: Ramin Tadayon <67011668+axosoft-ramint@users.noreply.github.com> Date: Tue, 11 Oct 2022 08:48:37 +0900 Subject: [PATCH] Add and send setting to graph for showing remote names on ref branches (#2256) --- package.json | 7 +++++++ src/config.ts | 1 + src/plus/webviews/graph/graphWebview.ts | 4 +++- 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, 27 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9564531..5fd4676 100644 --- a/package.json +++ b/package.json @@ -2135,6 +2135,13 @@ "scope": "window", "order": 13 }, + "gitlens.graph.showRemoteNamesOnRefs": { + "type": "boolean", + "default": false, + "markdownDescription": "Specifies whether to show remote names on remote branches in the _Commit Graph_", + "scope": "window", + "order": 14 + }, "gitlens.graph.defaultItemLimit": { "type": "number", "default": 500, diff --git a/src/config.ts b/src/config.ts index b331706..e6d7c6f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -382,6 +382,7 @@ export interface GraphConfig { highlightRowsOnRefHover: boolean; showDetailsView: 'open' | 'selection' | false; showGhostRefsOnRowHover: boolean; + showRemoteNamesOnRefs: boolean; pageItemLimit: number; searchItemLimit: number; statusBar: { diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 45718b7..ee3565a 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -468,7 +468,8 @@ export class GraphWebview extends WebviewBase { configuration.changed(e, 'graph.dateFormat') || configuration.changed(e, 'graph.dateStyle') || configuration.changed(e, 'graph.highlightRowsOnRefHover') || - configuration.changed(e, 'graph.showGhostRefsOnRowHover') + configuration.changed(e, 'graph.showGhostRefsOnRowHover') || + configuration.changed(e, 'graph.showRemoteNamesOnRefs') ) { void this.notifyDidChangeConfiguration(); } @@ -1127,6 +1128,7 @@ export class GraphWebview extends WebviewBase { enableMultiSelection: false, highlightRowsOnRefHover: configuration.get('graph.highlightRowsOnRefHover'), showGhostRefsOnRowHover: configuration.get('graph.showGhostRefsOnRowHover'), + showRemoteNamesOnRefs: configuration.get('graph.showRemoteNamesOnRefs'), idLength: configuration.get('advanced.abbreviatedShaLength'), }; return config; diff --git a/src/plus/webviews/graph/protocol.ts b/src/plus/webviews/graph/protocol.ts index 8e06225..624cd9e 100644 --- a/src/plus/webviews/graph/protocol.ts +++ b/src/plus/webviews/graph/protocol.ts @@ -96,6 +96,7 @@ export interface GraphComponentConfig { enableMultiSelection?: boolean; highlightRowsOnRefHover?: boolean; showGhostRefsOnRowHover?: boolean; + showRemoteNamesOnRefs?: boolean; idLength?: number; } diff --git a/src/webviews/apps/plus/graph/GraphWrapper.tsx b/src/webviews/apps/plus/graph/GraphWrapper.tsx index b5266a2..c8afb19 100644 --- a/src/webviews/apps/plus/graph/GraphWrapper.tsx +++ b/src/webviews/apps/plus/graph/GraphWrapper.tsx @@ -711,6 +711,7 @@ export function GraphWrapper({ highlightedShas={searchResults?.ids as GraphContainerProps['highlightedShas']} highlightRowsOnRefHover={graphConfig?.highlightRowsOnRefHover} showGhostRefsOnRowHover={graphConfig?.showGhostRefsOnRowHover} + showRemoteNamesOnRefs={graphConfig?.showRemoteNamesOnRefs} isLoadingRows={isLoading} isSelectedBySha={selectedRows} nonce={nonce} diff --git a/src/webviews/apps/settings/partials/commit-graph.html b/src/webviews/apps/settings/partials/commit-graph.html index 6c98c4a..3f1a2e8 100644 --- a/src/webviews/apps/settings/partials/commit-graph.html +++ b/src/webviews/apps/settings/partials/commit-graph.html @@ -116,6 +116,20 @@
+ +
+
+ +
+
+