Browse Source

73 - Graph allow user to toggle some features in settings (Gitlens side) (#2225)

* 73 - Graph allow user to toggle some features in settings

* Modified name of "enableGhostRefs" property to be "showGhostRefsOnRowHover" instead
main
ericf-axosoft 2 years ago
committed by GitHub
parent
commit
a3c1035821
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 2 deletions
  1. +7
    -0
      package.json
  2. +1
    -0
      src/config.ts
  3. +3
    -1
      src/plus/webviews/graph/graphWebview.ts
  4. +1
    -0
      src/plus/webviews/graph/protocol.ts
  5. +2
    -1
      src/webviews/apps/plus/graph/GraphWrapper.tsx
  6. +14
    -0
      src/webviews/apps/settings/partials/commit-graph.html

+ 7
- 0
package.json View File

@ -2106,6 +2106,13 @@
"scope": "window", "scope": "window",
"order": 11 "order": 11
}, },
"gitlens.graph.showGhostRefsOnRowHover": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show a ghost ref of the hovered/selected row in the _Commit Graph_",
"scope": "window",
"order": 12
},
"gitlens.graph.defaultItemLimit": { "gitlens.graph.defaultItemLimit": {
"type": "number", "type": "number",
"default": 500, "default": 500,

+ 1
- 0
src/config.ts View File

@ -380,6 +380,7 @@ export interface GraphConfig {
dateStyle: DateStyle | null; dateStyle: DateStyle | null;
defaultItemLimit: number; defaultItemLimit: number;
highlightRowsOnRefHover: boolean; highlightRowsOnRefHover: boolean;
showGhostRefsOnRowHover: boolean;
pageItemLimit: number; pageItemLimit: number;
searchItemLimit: number; searchItemLimit: number;
statusBar: { statusBar: {

+ 3
- 1
src/plus/webviews/graph/graphWebview.ts View File

@ -358,7 +358,8 @@ export class GraphWebview extends WebviewBase {
configuration.changed(e, 'graph.avatars') || configuration.changed(e, 'graph.avatars') ||
configuration.changed(e, 'graph.dateFormat') || configuration.changed(e, 'graph.dateFormat') ||
configuration.changed(e, 'graph.dateStyle') || configuration.changed(e, 'graph.dateStyle') ||
configuration.changed(e, 'graph.highlightRowsOnRefHover')
configuration.changed(e, 'graph.highlightRowsOnRefHover') ||
configuration.changed(e, 'graph.showGhostRefsOnRowHover')
) { ) {
void this.notifyDidChangeConfiguration(); void this.notifyDidChangeConfiguration();
} }
@ -747,6 +748,7 @@ export class GraphWebview extends WebviewBase {
dateStyle: configuration.get('graph.dateStyle') ?? configuration.get('defaultDateStyle'), dateStyle: configuration.get('graph.dateStyle') ?? configuration.get('defaultDateStyle'),
enableMultiSelection: false, enableMultiSelection: false,
highlightRowsOnRefHover: configuration.get('graph.highlightRowsOnRefHover'), highlightRowsOnRefHover: configuration.get('graph.highlightRowsOnRefHover'),
showGhostRefsOnRowHover: configuration.get('graph.showGhostRefsOnRowHover'),
shaLength: configuration.get('advanced.abbreviatedShaLength'), shaLength: configuration.get('advanced.abbreviatedShaLength'),
}; };
return config; return config;

+ 1
- 0
src/plus/webviews/graph/protocol.ts View File

@ -75,6 +75,7 @@ export interface GraphComponentConfig {
dateStyle: DateStyle; dateStyle: DateStyle;
enableMultiSelection?: boolean; enableMultiSelection?: boolean;
highlightRowsOnRefHover?: boolean; highlightRowsOnRefHover?: boolean;
showGhostRefsOnRowHover?: boolean;
shaLength?: number; shaLength?: number;
} }

+ 2
- 1
src/webviews/apps/plus/graph/GraphWrapper.tsx View File

@ -686,7 +686,8 @@ export function GraphWrapper({
hasMoreCommits={pagingState?.hasMore} hasMoreCommits={pagingState?.hasMore}
height={mainHeight} height={mainHeight}
highlightedShas={searchHighlights} highlightedShas={searchHighlights}
// highlightRowssOnRefHover={graphConfig?.highlightRowsOnRefHover}
highlightRowsOnRefHover={graphConfig?.highlightRowsOnRefHover}
showGhostRefsOnRowHover={graphConfig?.showGhostRefsOnRowHover}
isLoadingRows={isLoading} isLoadingRows={isLoading}
isSelectedBySha={graphSelectedRows} isSelectedBySha={graphSelectedRows}
nonce={nonce} nonce={nonce}

+ 14
- 0
src/webviews/apps/settings/partials/commit-graph.html View File

@ -78,6 +78,20 @@
<div class="setting"> <div class="setting">
<div class="setting__input"> <div class="setting__input">
<input <input
id="graph.showGhostRefsOnRowHover"
name="graph.showGhostRefsOnRowHover"
type="checkbox"
data-setting
/>
<label for="graph.showGhostRefsOnRowHover"
>Show a ghost ref when hovering/selecting on a commit</label
>
</div>
</div>
<div class="setting">
<div class="setting__input">
<input
id="graph.dateStyle" id="graph.dateStyle"
name="graph.dateStyle" name="graph.dateStyle"
type="checkbox" type="checkbox"

Loading…
Cancel
Save