Skip to content
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

- Changes the default _Commit Graph_ lane colors for dark and high-contrast themes to a new vibrant, perceptually-uniform palette — every lane shares the same perceived brightness so no lane visually dominates; light themes keep the previous colors, and any `gitlens.graphLane1Color`–`gitlens.graphLane10Color` customizations in `workbench.colorCustomizations` are still honored
- Changes the _Commit Graph_ sidebar to be unpinned by default — the sidebar now floats over the graph and auto-collapses when it loses focus; pin it (or set `gitlens.graph.sidebar.pinned` to `true`) to restore the previous shared-space layout ([#5447](https://github.com/gitkraken/vscode-gitlens/issues/5447))
- Changes the _Commit Graph_ to automatically use a compact graph column and hide the SHA and Changes columns when the graph is narrow — based on the graph's actual width rather than where the details panel is pinned, so your column layout for a wide graph is preserved and restored once it's wide again; while narrow, the corresponding column menu items are disabled with a note that they return when the graph is wider ([#5500](https://github.com/gitkraken/vscode-gitlens/issues/5500), [#5391](https://github.com/gitkraken/vscode-gitlens/issues/5391))

### Removed

Expand Down
21 changes: 19 additions & 2 deletions contributions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3016,7 +3016,7 @@
},
"gitlens.graph.columnChangesOff": {
"label": "Hide Changes Column",
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/",
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/ && !(webviewItemValue =~ /\\bcolumns:narrow\\b/)",
"menus": {
"webview/context": [
{
Expand All @@ -3029,6 +3029,7 @@
},
"gitlens.graph.columnChangesOn": {
"label": "Show Changes Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)",
"menus": {
"webview/context": [
{
Expand Down Expand Up @@ -3066,6 +3067,7 @@
},
"gitlens.graph.columnGraphCompact": {
"label": "Use Compact Graph Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)",
"menus": {
"webview/context": [
{
Expand All @@ -3078,6 +3080,7 @@
},
"gitlens.graph.columnGraphDefault": {
"label": "Use Expanded Graph Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)",
"menus": {
"webview/context": [
{
Expand Down Expand Up @@ -3165,7 +3168,7 @@
},
"gitlens.graph.columnShaOff": {
"label": "Hide SHA Column",
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/",
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/ && !(webviewItemValue =~ /\\bcolumns:narrow\\b/)",
"menus": {
"webview/context": [
{
Expand All @@ -3178,6 +3181,7 @@
},
"gitlens.graph.columnShaOn": {
"label": "Show SHA Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)",
"menus": {
"webview/context": [
{
Expand All @@ -3188,6 +3192,19 @@
]
}
},
"gitlens.graph.columnsNarrowInfo": {
"label": "Some Options Return When the Graph Is Wider",
"enablement": "false",
"menus": {
"webview/context": [
{
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumns:narrow\\b/",
"group": "1_columns",
"order": 0
}
]
}
},
"gitlens.graph.commitViaSCM": {
"label": "Commit via Source Control..."
},
Expand Down
130 changes: 74 additions & 56 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7809,11 +7809,12 @@
{
"command": "gitlens.graph.columnChangesOff",
"title": "Hide Changes Column",
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/"
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/ && !(webviewItemValue =~ /\\bcolumns:narrow\\b/)"
},
{
"command": "gitlens.graph.columnChangesOn",
"title": "Show Changes Column"
"title": "Show Changes Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)"
},
{
"command": "gitlens.graph.columnDateTimeOff",
Expand All @@ -7826,11 +7827,13 @@
},
{
"command": "gitlens.graph.columnGraphCompact",
"title": "Use Compact Graph Column"
"title": "Use Compact Graph Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)"
},
{
"command": "gitlens.graph.columnGraphDefault",
"title": "Use Expanded Graph Column"
"title": "Use Expanded Graph Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)"
},
{
"command": "gitlens.graph.columnGraphOff",
Expand Down Expand Up @@ -7862,11 +7865,17 @@
{
"command": "gitlens.graph.columnShaOff",
"title": "Hide SHA Column",
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/"
"enablement": "webviewItemValue =~ /\\bcolumns:canHide\\b/ && !(webviewItemValue =~ /\\bcolumns:narrow\\b/)"
},
{
"command": "gitlens.graph.columnShaOn",
"title": "Show SHA Column"
"title": "Show SHA Column",
"enablement": "!(webviewItemValue =~ /\\bcolumns:narrow\\b/)"
},
{
"command": "gitlens.graph.columnsNarrowInfo",
"title": "Some Options Return When the Graph Is Wider",
"enablement": "false"
},
{
"command": "gitlens.graph.commitViaSCM",
Expand Down Expand Up @@ -13611,6 +13620,10 @@
"command": "gitlens.graph.columnShaOn",
"when": "false"
},
{
"command": "gitlens.graph.columnsNarrowInfo",
"when": "false"
},
{
"command": "gitlens.graph.commitViaSCM",
"when": "false"
Expand Down Expand Up @@ -27183,11 +27196,6 @@
"when": "webviewItem =~ /gitlens:commit\\b/ && !listMultiSelection && !gitlens:readonly && !gitlens:untrusted && gitlens:ai:allowed",
"group": "1_gitlens_ai@10"
},
{
"submenu": "gitlens/graph/commit/changes",
"when": "webviewItem =~ /gitlens:(commit|stash|wip)\\b/ && !listMultiSelection",
"group": "2_gitlens_quickopen@1"
},
{
"command": "gitlens.graph.openCommitOnRemote",
"when": "webviewItem =~ /gitlens:commit\\b/ && !listMultiSelection && gitlens:repos:withRemotes",
Expand Down Expand Up @@ -27313,6 +27321,11 @@
"when": "webviewItem =~ /gitlens:(branch|commit|stash|tag|file\\b(?=.*?\\b\\+(committed|staged|unstaged)\\b))\\b/",
"group": "7_gitlens_a_share@1"
},
{
"submenu": "gitlens/graph/commit/changes",
"when": "webviewItem =~ /gitlens:(commit|stash|wip)\\b/ && !listMultiSelection",
"group": "2_gitlens_quickopen@1"
},
{
"command": "gitlens.discardChanges:commitDetails",
"when": "webviewItem =~ /gitlens:file\\b(?=.*?\\b\\+(staged|unstaged|conflict)\\b)/ && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webview == gitlens.views.commitDetails",
Expand Down Expand Up @@ -27503,6 +27516,11 @@
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/",
"group": "0_markers@0"
},
{
"command": "gitlens.graph.columnsNarrowInfo",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumns:narrow\\b/",
"group": "1_columns@0"
},
{
"command": "gitlens.graph.columnAuthorOff",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:author:visible\\b/",
Expand Down Expand Up @@ -27563,51 +27581,6 @@
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:sha:hidden\\b/",
"group": "1_columns@7"
},
{
"command": "gitlens.graph.columnGraphCompact",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:graph:visible(?![^,]*\\+compact\\b)/",
"group": "2_columns@2"
},
{
"command": "gitlens.graph.columnGraphDefault",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:graph:visible[^,]*\\+compact\\b/",
"group": "2_columns@2"
},
{
"command": "gitlens.fetchRemote:graph",
"when": "webviewItem =~ /gitlens:remote\\b/ && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders",
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.discardChanges.multi:commitDetails",
"when": "listMultiSelection && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webview == gitlens.views.commitDetails && webviewItemsUnion =~ /gitlens:file\\b(?=.*?\\b\\+(staged|unstaged|conflict)\\b)(?!.*?\\b\\+(committed|stashed)\\b)/",
"group": "1_gitlens_actions@3"
},
{
"command": "gitlens.discardChanges.multi:graphDetails",
"when": "webviewItemsUnion =~ /gitlens:file\\b(?=.*?\\b\\+(staged|unstaged|conflict)\\b)(?!.*?\\b\\+(committed|stashed)\\b)/ && listMultiSelection && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && (webview == gitlens.graph || webview == gitlens.views.graph)",
"group": "1_gitlens_actions@3"
},
{
"command": "gitlens.copyRelativePathToClipboard:commitDetails",
"when": "webviewItem =~ /gitlens:(file|folder)\\b/ && webview == gitlens.views.commitDetails",
"group": "7_gitlens_cutcopypaste@2"
},
{
"command": "gitlens.copyRelativePathToClipboard:graphDetails",
"when": "webviewItem =~ /gitlens:(file|folder)\\b/ && (webview == gitlens.graph || webview == gitlens.views.graph)",
"group": "7_gitlens_cutcopypaste@2"
},
{
"command": "gitlens.graph.columnAuthorOn",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:author:hidden\\b/",
"group": "1_columns@1"
},
{
"command": "gitlens.graph.columnChangesOff",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:changes:visible\\b/",
"group": "1_columns@3"
},
{
"command": "gitlens.graph.setStyleAuto",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && config.gitlens.graph.experimental.useNewEngine",
Expand All @@ -27623,6 +27596,16 @@
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && config.gitlens.graph.experimental.useNewEngine",
"group": "2_columns@1"
},
{
"command": "gitlens.graph.columnGraphCompact",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:graph:visible(?![^,]*\\+compact\\b)/",
"group": "2_columns@2"
},
{
"command": "gitlens.graph.columnGraphDefault",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:graph:visible[^,]*\\+compact\\b/",
"group": "2_columns@2"
},
{
"command": "gitlens.graph.setLaneDensityToCompact",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && config.gitlens.graph.experimental.useNewEngine && webviewItemValue =~ /lanes:density:expanded\\b/",
Expand Down Expand Up @@ -27673,11 +27656,46 @@
"when": "webviewItem =~ /gitlens:rebase:conflict\\+file\\b(?=.*?\\+canStageIncoming\\b)/ && webview == gitlens.rebase",
"group": "1_conflict@2"
},
{
"command": "gitlens.fetchRemote:graph",
"when": "webviewItem =~ /gitlens:remote\\b/ && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders",
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.pruneRemote:graph",
"when": "webviewItem =~ /gitlens:remote\\b/ && !gitlens:readonly && !gitlens:untrusted",
"group": "1_gitlens_actions@2"
},
{
"command": "gitlens.discardChanges.multi:commitDetails",
"when": "listMultiSelection && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webview == gitlens.views.commitDetails && webviewItemsUnion =~ /gitlens:file\\b(?=.*?\\b\\+(staged|unstaged|conflict)\\b)(?!.*?\\b\\+(committed|stashed)\\b)/",
"group": "1_gitlens_actions@3"
},
{
"command": "gitlens.discardChanges.multi:graphDetails",
"when": "webviewItemsUnion =~ /gitlens:file\\b(?=.*?\\b\\+(staged|unstaged|conflict)\\b)(?!.*?\\b\\+(committed|stashed)\\b)/ && listMultiSelection && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && (webview == gitlens.graph || webview == gitlens.views.graph)",
"group": "1_gitlens_actions@3"
},
{
"command": "gitlens.copyRelativePathToClipboard:commitDetails",
"when": "webviewItem =~ /gitlens:(file|folder)\\b/ && webview == gitlens.views.commitDetails",
"group": "7_gitlens_cutcopypaste@2"
},
{
"command": "gitlens.copyRelativePathToClipboard:graphDetails",
"when": "webviewItem =~ /gitlens:(file|folder)\\b/ && (webview == gitlens.graph || webview == gitlens.views.graph)",
"group": "7_gitlens_cutcopypaste@2"
},
{
"command": "gitlens.graph.columnAuthorOn",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:author:hidden\\b/",
"group": "1_columns@1"
},
{
"command": "gitlens.graph.columnChangesOff",
"when": "webviewItem =~ /gitlens:graph:(columns|settings)\\b/ && webviewItemValue =~ /\\bcolumn:changes:visible\\b/",
"group": "1_columns@3"
},
{
"command": "gitlens.openRepoOnRemote:graph",
"when": "webviewItem =~ /gitlens:remote\\b/",
Expand Down
1 change: 1 addition & 0 deletions src/constants.commands.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export type ContributedCommands =
| 'gitlens.graph.columnRefOn'
| 'gitlens.graph.columnShaOff'
| 'gitlens.graph.columnShaOn'
| 'gitlens.graph.columnsNarrowInfo'
| 'gitlens.graph.compareAncestryWithWorking'
| 'gitlens.graph.compareBranchWithHead'
| 'gitlens.graph.compareSelectedCommits.multi'
Expand Down
10 changes: 10 additions & 0 deletions src/webviews/apps/plus/graph/graph-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,7 @@ export class GraphApp extends SignalWatcher(LitElement) {
: nothing}
<gl-graph-wrapper
.anchorShas=${this.activeAnchorShas}
.narrow=${this.isGraphViewNarrow}
@gl-graph-change-selection=${this.handleGraphSelectionChanged}
@gl-graph-change-visible-days=${this.handleGraphVisibleDaysChanged}
@gl-graph-filter-column=${this.handleGraphFilterColumn}
Expand Down Expand Up @@ -2174,6 +2175,15 @@ export class GraphApp extends SignalWatcher(LitElement) {
return configured === 'auto' ? this._autoEffectiveLocation : configured;
}

/** Whether the graph view is horizontally narrow — drives the graph-wrapper's compact-column /
* hidden-SHA overrides. Keyed off the width-driven `_autoEffectiveLocation`, which is tracked from
* the overall graph-view width (with hysteresis) regardless of where the details panel is pinned —
* so an explicit details-on-bottom pin on a wide editor is NOT treated as narrow, and a genuinely
* narrow view IS, whatever the pin. Reuses the same width breakpoint as the `auto` details decision. */
private get isGraphViewNarrow(): boolean {
return this._autoEffectiveLocation === 'bottom';
}

private get detailsPositionKey(): 'position' | 'bottomPosition' {
return this.effectiveDetailsLocation === 'bottom' ? 'bottomPosition' : 'position';
}
Expand Down
Loading
Loading