From 5b4a8faf85852c6ec6be080270873588e4e41efb Mon Sep 17 00:00:00 2001
From: Cursor Agent
Date: Thu, 16 Jul 2026 10:13:03 +0000
Subject: [PATCH 1/2] Add stickyHeader setting to keep graph header fixed while
scrolling
Introduce git-graph.stickyHeader (default true) so the control bar and
column headers stay visible when scrolling the Graph View, following the
approach from upstream PR #394.
Co-authored-by: Philipp Litzenberger
---
README.md | 1 +
package.json | 5 +++++
src/config.ts | 7 +++++++
src/gitGraphView.ts | 8 +++++---
src/types.ts | 1 +
tests/config.test.ts | 2 ++
tests/gitGraphView.test.ts | 17 +++++++++++++++++
web/contextMenu.ts | 2 +-
web/main.ts | 30 +++++++++++++++++++++++++++++-
web/styles/contextMenu.css | 4 ++--
web/styles/main.css | 22 ++++++++++++++++++----
11 files changed, 88 insertions(+), 11 deletions(-)
diff --git a/README.md b/README.md
index 022a5c4f..fa706c53 100644
--- a/README.md
+++ b/README.md
@@ -137,6 +137,7 @@ A summary of the Git Graph extension settings are:
* **Retain Context When Hidden**: Specifies if the Git Graph view Visual Studio Code context is kept when the panel is no longer visible (e.g. moved to background tab). Enabling this setting will make Git Graph load significantly faster when switching back to the Git Graph tab, however has a higher memory overhead.
* **Show Status Bar Item**: Show a Status Bar Item that opens the Git Graph View when clicked.
* **Source Code Provider Integration Location**: Specifies where the "View Git Graph" action appears on the title of SCM Providers.
+* **Sticky Header**: Keeps the Graph View header (control bar and column headers) visible when the view is scrolled.
* **Tab Icon Colour Theme**: Specifies the colour theme of the icon displayed on the Git Graph tab.
This extension consumes the following settings:
diff --git a/package.json b/package.json
index 3d024431..849338db 100644
--- a/package.json
+++ b/package.json
@@ -1155,6 +1155,11 @@
"default": "Inline",
"description": "Specifies where the \"View Git Graph\" action appears on the title of SCM Providers."
},
+ "git-graph.stickyHeader": {
+ "type": "boolean",
+ "default": true,
+ "description": "Keeps the Graph View header (control bar and column headers) visible when the view is scrolled."
+ },
"git-graph.tabIconColourTheme": {
"type": "string",
"enum": [
diff --git a/src/config.ts b/src/config.ts
index 8d777ca8..76570bab 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -546,6 +546,13 @@ class Config {
return !!this.config.get('showStatusBarItem', true);
}
+ /**
+ * Get the value of the `git-graph.stickyHeader` Extension Setting.
+ */
+ get stickyHeader() {
+ return !!this.config.get('stickyHeader', true);
+ }
+
/**
* Get the value of the `git-graph.tabIconColourTheme` Extension Setting.
*/
diff --git a/src/gitGraphView.ts b/src/gitGraphView.ts
index 1acba6ff..6430052c 100644
--- a/src/gitGraphView.ts
+++ b/src/gitGraphView.ts
@@ -692,7 +692,8 @@ export class GitGraphView extends Disposable {
repoDropdownOrder: config.repoDropdownOrder,
showRemoteBranches: config.showRemoteBranches,
showStashes: config.showStashes,
- showTags: config.showTags
+ showTags: config.showTags,
+ stickyHeader: config.stickyHeader
},
lastActiveRepo: this.extensionState.getLastActiveRepo(),
loadViewTo: this.loadViewTo,
@@ -715,9 +716,10 @@ export class GitGraphView extends Disposable {