Browse Source

Fixes #2885 commit files missing in Folder History

main
Eric Amodio 1 year ago
parent
commit
a881d0c175
6 changed files with 174 additions and 10 deletions
  1. +4
    -0
      CHANGELOG.md
  2. +62
    -2
      package.json
  3. +5
    -0
      src/config.ts
  4. +3
    -7
      src/views/nodes/commitNode.ts
  5. +1
    -1
      src/views/viewBase.ts
  6. +99
    -0
      src/webviews/apps/settings/partials/views.file-history.html

+ 4
- 0
CHANGELOG.md View File

@ -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

+ 62
- 2
package.json View File

@ -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,

+ 5
- 0
src/config.ts View File

@ -733,6 +733,11 @@ export interface ContributorsViewConfig {
export interface FileHistoryViewConfig {
avatars: boolean;
files: ViewsFilesConfig;
pullRequests: {
enabled: boolean;
showForCommits: boolean;
};
}
export interface LineHistoryViewConfig {

+ 3
- 7
src/views/nodes/commitNode.ts View File

@ -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
private _children: (PullRequestNode | FileNode)[] | undefined;
async getChildren(): Promise<ViewNode[]> {
if (this.view instanceof FileHistoryView) return [];
if (this._children == null) {
const commit = this.commit;
@ -105,9 +103,7 @@ export class CommitNode extends ViewRefNode
// If we found a pull request, insert it into the children cache (if loaded) and refresh the node
if (pr != null && this._children != null) {
this._children.unshift(
new PullRequestNode(this.view as ViewsWithCommits, this, pr, commit),
);
this._children.unshift(new PullRequestNode(this.view, this, pr, commit));
}
// Refresh this node to add the pull request node or remove the spinner
@ -138,7 +134,7 @@ export class CommitNode extends ViewRefNode
}
if (pullRequest != null) {
children.unshift(new PullRequestNode(this.view as ViewsWithCommits, this, pullRequest, commit));
children.unshift(new PullRequestNode(this.view, this, pullRequest, commit));
}
this._children = children;

+ 1
- 1
src/views/viewBase.ts View File

@ -69,7 +69,7 @@ export type View =
export type ViewsWithBranches = BranchesView | CommitsView | RemotesView | RepositoriesView | WorkspacesView;
export type ViewsWithBranchesNode = BranchesView | RepositoriesView | WorkspacesView;
export type ViewsWithCommits = Exclude<View, FileHistoryView | LineHistoryView | StashesView>;
export type ViewsWithCommits = Exclude<View, LineHistoryView | StashesView>;
export type ViewsWithContributors = ContributorsView | RepositoriesView | WorkspacesView;
export type ViewsWithContributorsNode = ContributorsView | RepositoriesView | WorkspacesView;
export type ViewsWithRemotes = RemotesView | RepositoriesView | WorkspacesView;

+ 99
- 0
src/webviews/apps/settings/partials/views.file-history.html View File

@ -39,6 +39,105 @@
<label for="views.fileHistory.avatars">Use author avatars</label>
</div>
</div>
<div class="setting">
<div class="setting__input">
<label class="non-interactive">Applies only when showing folder history:</label>
</div>
</div>
<div class="settings ml-2">
<div class="section__group">
<div class="section__content">
<div class="settings settings--fixed">
<div class="setting">
<div class="setting__input">
<input
id="views.fileHistory.pullRequests.enabled"
name="views.fileHistory.pullRequests.enabled"
type="checkbox"
data-setting
/>
<label for="views.fileHistory.pullRequests.enabled"
>Show associated pull requests</label
>
</div>
<p class="setting__hint">
Requires a connection to a supported remote service (e.g. GitHub)
</p>
</div>
<div class="settings settings--fixed ml-2">
<div class="setting" data-enablement="views.fileHistory.pullRequests.enabled">
<div class="setting__input">
<input
id="views.fileHistory.pullRequests.showForCommits"
name="views.fileHistory.pullRequests.showForCommits"
type="checkbox"
data-setting
disabled
/>
<label for="views.fileHistory.pullRequests.showForCommits"
>Show the pull request that introduced each commit</label
>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="setting">
<div class="setting__input">
<label for="views.fileHistory.files.layout">Layout files</label>
<div class="select-container">
<select
id="views.fileHistory.files.layout"
name="views.fileHistory.files.layout"
data-setting
>
<option value="auto">automatically</option>
<option value="list">as a list</option>
<option value="tree">as a tree</option>
</select>
</div>
</div>
<p class="setting__hint" data-visibility="views.fileHistory.files.layout =auto">
Chooses the best layout based on the number of files at each nesting level
</p>
</div>
<div class="setting">
<div class="setting__input">
<label for="views.fileHistory.files.icon">File icons</label>
<div class="select-container">
<select
id="views.fileHistory.files.icon"
name="views.fileHistory.files.icon"
data-setting
>
<option value="type">show file type (default)</option>
<option value="status">show file status</option>
</select>
</div>
</div>
</div>
<div class="setting">
<div class="setting__input">
<input
id="views.fileHistory.files.compact"
name="views.fileHistory.files.compact"
type="checkbox"
data-setting
/>
<label for="views.fileHistory.files.compact">Use compact file layout</label>
</div>
<p class="setting__hint">
Compacts (flattens) unnecessary nesting when using a tree layouts
</p>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save