From a881d0c175cba215b0e7becb1af1c2fb093c6991 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 25 Aug 2023 11:40:57 -0400 Subject: [PATCH] Fixes #2885 commit files missing in Folder History --- CHANGELOG.md | 4 + package.json | 64 +++++++++++++- src/config.ts | 5 ++ src/views/nodes/commitNode.ts | 10 +-- src/views/viewBase.ts | 2 +- .../apps/settings/partials/views.file-history.html | 99 ++++++++++++++++++++++ 6 files changed, 174 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc00d2f..6e02660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Adds an _Open Changes_ button to commits in the file history quick pick menu — closes [#2641](https://github.com/gitkraken/vscode-gitlens/issues/2641) thanks to [PR #2800](https://github.com/gitkraken/vscode-gitlens/pull/2800) by Omar Ghazi ([@omarfesal](https://github.com/omarfesal)) +### Fixed + +- Fixes [#2885](https://github.com/gitkraken/vscode-gitlens/issues/2885) - Folder History not show changed files of commit + ## [14.2.1] - 2023-08-10 ### Added diff --git a/package.json b/package.json index 50b9ac6..731ad80 100644 --- a/package.json +++ b/package.json @@ -739,14 +739,14 @@ "default": true, "markdownDescription": "Specifies whether to show pull requests (if any) associated with the current branch in the _Commits_ view. Requires a connection to a supported remote service (e.g. GitHub)", "scope": "window", - "order": 21 + "order": 22 }, "gitlens.views.commits.pullRequests.showForCommits": { "type": "boolean", "default": true, "markdownDescription": "Specifies whether to show pull requests (if any) associated with commits in the _Commits_ view. Requires a connection to a supported remote service (e.g. GitHub)", "scope": "window", - "order": 22 + "order": 23 }, "gitlens.views.commits.files.layout": { "type": "string", @@ -1125,6 +1125,66 @@ "title": "File History View", "order": 24, "properties": { + "gitlens.views.fileHistory.pullRequests.enabled": { + "type": "boolean", + "default": true, + "markdownDescription": "Specifies whether to query for pull requests associated with commits in the _File History_ view. Requires a connection to a supported remote service (e.g. GitHub)", + "scope": "window", + "order": 21 + }, + "gitlens.views.fileHistory.pullRequests.showForCommits": { + "type": "boolean", + "default": true, + "markdownDescription": "Specifies whether to show pull requests (if any) associated with commits in the _File History_ view. Requires a connection to a supported remote service (e.g. GitHub)", + "scope": "window", + "order": 22 + }, + "gitlens.views.fileHistory.files.layout": { + "type": "string", + "default": "auto", + "enum": [ + "auto", + "list", + "tree" + ], + "enumDescriptions": [ + "Automatically switches between displaying files as a `tree` or `list` based on the `#gitlens.views.fileHistory.files.threshold#` value and the number of files at each nesting level", + "Displays files as a list", + "Displays files as a tree" + ], + "markdownDescription": "Specifies how the _File History_ view will display files", + "scope": "window", + "order": 30 + }, + "gitlens.views.fileHistory.files.threshold": { + "type": "number", + "default": 5, + "markdownDescription": "Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _File History_ view. Only applies when `#gitlens.views.fileHistory.files.layout#` is set to `auto`", + "scope": "window", + "order": 31 + }, + "gitlens.views.fileHistory.files.compact": { + "type": "boolean", + "default": true, + "markdownDescription": "Specifies whether to compact (flatten) unnecessary file nesting in the _File History_ view. Only applies when `#gitlens.views.fileHistory.files.layout#` is set to `tree` or `auto`", + "scope": "window", + "order": 32 + }, + "gitlens.views.fileHistory.files.icon": { + "type": "string", + "default": "type", + "enum": [ + "status", + "type" + ], + "enumDescriptions": [ + "Shows the file's status as the icon", + "Shows the file's type (theme icon) as the icon" + ], + "markdownDescription": "Specifies how the _File History_ view will display file icons", + "scope": "window", + "order": 33 + }, "gitlens.views.fileHistory.avatars": { "type": "boolean", "default": true, diff --git a/src/config.ts b/src/config.ts index c12afdb..867cfc6 100644 --- a/src/config.ts +++ b/src/config.ts @@ -733,6 +733,11 @@ export interface ContributorsViewConfig { export interface FileHistoryViewConfig { avatars: boolean; + files: ViewsFilesConfig; + pullRequests: { + enabled: boolean; + showForCommits: boolean; + }; } export interface LineHistoryViewConfig { diff --git a/src/views/nodes/commitNode.ts b/src/views/nodes/commitNode.ts index 041dd2f..bf4ab76 100644 --- a/src/views/nodes/commitNode.ts +++ b/src/views/nodes/commitNode.ts @@ -19,7 +19,7 @@ import { joinPaths, normalizePath } from '../../system/path'; import type { Deferred } from '../../system/promise'; import { defer, getSettledValue } from '../../system/promise'; import { sortCompare } from '../../system/string'; -import { FileHistoryView } from '../fileHistoryView'; +import type { FileHistoryView } from '../fileHistoryView'; import { TagsView } from '../tagsView'; import type { ViewsWithCommits } from '../viewBase'; import { CommitFileNode } from './commitFileNode'; @@ -69,8 +69,6 @@ export class CommitNode extends ViewRefNode { - if (this.view instanceof FileHistoryView) return []; - if (this._children == null) { const commit = this.commit; @@ -105,9 +103,7 @@ export class CommitNode extends ViewRefNode; +export type ViewsWithCommits = Exclude; export type ViewsWithContributors = ContributorsView | RepositoriesView | WorkspacesView; export type ViewsWithContributorsNode = ContributorsView | RepositoriesView | WorkspacesView; export type ViewsWithRemotes = RemotesView | RepositoriesView | WorkspacesView; diff --git a/src/webviews/apps/settings/partials/views.file-history.html b/src/webviews/apps/settings/partials/views.file-history.html index f580516..e8c5583 100644 --- a/src/webviews/apps/settings/partials/views.file-history.html +++ b/src/webviews/apps/settings/partials/views.file-history.html @@ -39,6 +39,105 @@ + +
+
+ +
+
+ +
+
+
+
+
+
+ + +
+

+ Requires a connection to a supported remote service (e.g. GitHub) +

+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ +
+ +
+
+

+ Chooses the best layout based on the number of files at each nesting level +

+
+ +
+
+ +
+ +
+
+
+ +
+
+ + +
+

+ Compacts (flattens) unnecessary nesting when using a tree layouts +

+
+