Kaynağa Gözat

Changes to use file theme icons for many views

main
Eric Amodio 1 yıl önce
ebeveyn
işleme
ab5b228e1d
23 değiştirilmiş dosya ile 346 ekleme ve 100 silme
  1. +10
    -0
      CHANGELOG.md
  2. +150
    -31
      package.json
  3. +18
    -0
      src/@types/vscode.git.uri.ts
  4. +1
    -1
      src/config.ts
  5. +2
    -5
      src/git/gitUri.ts
  6. +26
    -12
      src/views/nodes/commitFileNode.ts
  7. +2
    -1
      src/views/nodes/commitNode.ts
  8. +2
    -3
      src/views/nodes/folderNode.ts
  9. +2
    -8
      src/views/nodes/stashFileNode.ts
  10. +12
    -3
      src/views/viewDecorationProvider.ts
  11. +1
    -0
      src/webviews/apps/commitDetails/commitDetails.ts
  12. +12
    -0
      src/webviews/apps/settings/partials/views.branches.html
  13. +12
    -0
      src/webviews/apps/settings/partials/views.commits.html
  14. +16
    -0
      src/webviews/apps/settings/partials/views.contributors.html
  15. +0
    -35
      src/webviews/apps/settings/partials/views.file-history.html
  16. +0
    -1
      src/webviews/apps/settings/partials/views.line-history.html
  17. +12
    -0
      src/webviews/apps/settings/partials/views.remotes.html
  18. +12
    -0
      src/webviews/apps/settings/partials/views.repositories.html
  19. +16
    -0
      src/webviews/apps/settings/partials/views.searchAndCompare.html
  20. +12
    -0
      src/webviews/apps/settings/partials/views.stashes.html
  21. +12
    -0
      src/webviews/apps/settings/partials/views.tags.html
  22. +12
    -0
      src/webviews/apps/settings/partials/views.worktrees.html
  23. +4
    -0
      src/webviews/commitDetails/commitDetailsWebview.ts

+ 10
- 0
CHANGELOG.md Dosyayı Görüntüle

@ -35,6 +35,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Moves _Open \* on Remote_ commands into _Open on Remote (Web)_ submenu
- Renames the _Commit Changes_ submenu to _Open Changes_
- Renames _Show Commit_ command to _Quick Show Commit_ and _Show Line Commit_ command to _Quick Show Line Commit_ for better clarity as it opens a quick pick menu
- Changes the file icons shown in many GitLens views to use the file type's theme icon (by default) rather than the status icon
- Adds a `gitlens.views.commits.files.icon` setting to specify how the _Commits_ view will display file icons
- Adds a `gitlens.views.repositories.files.icon` setting to specify how the _Repositories_ view will display file icons
- Adds a `gitlens.views.branches.files.icon` setting to specify how the _Branches_ view will display file icons
- Adds a `gitlens.views.remotes.files.icon` setting to specify how the _Remotes_ view will display file icons
- Adds a `gitlens.views.stashes.files.icon` setting to specify how the _Stashes_ view will display file icons
- Adds a `gitlens.views.tags.files.icon` setting to specify how the _Tags_ view will display file icons
- Adds a `gitlens.views.worktrees.files.icon` setting to specify how the _Worktrees_ view will display file icons
- Adds a `gitlens.views.contributors.files.icon` setting to specify how the _Contributors_ view will display file icons
- Adds a `gitlens.views.searchAndCompare.files.icon` setting to specify how the _Search & Compare_ view will display file icons
- Renames _Delete Stash..._ command to _Drop Stash..._ in the _Stashes_ view
- Removes the commit icon when hiding avatars in the _Commits_ view to allow for a more compact layout
- Limits Git CodeLens on docker files — closes [#2153](https://github.com/gitkraken/vscode-gitlens/issues/2153)

+ 150
- 31
package.json Dosyayı Görüntüle

@ -779,6 +779,21 @@
"scope": "window",
"order": 32
},
"gitlens.views.commits.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 _Commits_ view will display file icons",
"scope": "window",
"order": 33
},
"gitlens.views.commits.avatars": {
"type": "boolean",
"default": true,
@ -852,6 +867,21 @@
"scope": "window",
"order": 32
},
"gitlens.views.commitDetails.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 _Commit Details_ view will display file icons",
"scope": "window",
"order": 33
},
"gitlens.views.commitDetails.avatars": {
"type": "boolean",
"default": true,
@ -1044,6 +1074,21 @@
"scope": "window",
"order": 82
},
"gitlens.views.repositories.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 _Repositories_ view will display file icons",
"scope": "window",
"order": 83
},
"gitlens.views.repositories.compact": {
"type": "boolean",
"default": false,
@ -1080,37 +1125,6 @@
"title": "File History View",
"order": 24,
"properties": {
"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 when showing the history of a folder",
"scope": "window",
"order": 10
},
"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 to folder history and when `#gitlens.views.fileHistory.files.layout#` is set to `auto`",
"scope": "window",
"order": 11
},
"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 to folder history and when `#gitlens.views.fileHistory.files.layout#` is set to `tree` or `auto`",
"scope": "window",
"order": 12
},
"gitlens.views.fileHistory.avatars": {
"type": "boolean",
"default": true,
@ -1261,6 +1275,21 @@
"scope": "window",
"order": 52
},
"gitlens.views.branches.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 _Branches_ view will display file icons",
"scope": "window",
"order": 53
},
"gitlens.views.branches.avatars": {
"type": "boolean",
"default": true,
@ -1349,6 +1378,21 @@
"scope": "window",
"order": 32
},
"gitlens.views.remotes.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 _Remotes_ view will display file icons",
"scope": "window",
"order": 33
},
"gitlens.views.remotes.avatars": {
"type": "boolean",
"default": true,
@ -1401,6 +1445,21 @@
"scope": "window",
"order": 12
},
"gitlens.views.stashes.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 _Stashes_ view will display file icons",
"scope": "window",
"order": 13
},
"gitlens.views.stashes.reveal": {
"type": "boolean",
"default": true,
@ -1480,6 +1539,21 @@
"scope": "window",
"order": 32
},
"gitlens.views.tags.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 _Tags_ view will display file icons",
"scope": "window",
"order": 33
},
"gitlens.views.tags.avatars": {
"type": "boolean",
"default": true,
@ -1606,6 +1680,21 @@
"scope": "window",
"order": 42
},
"gitlens.views.worktrees.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 _Worktrees_ view will display file icons",
"scope": "window",
"order": 43
},
"gitlens.views.worktrees.avatars": {
"type": "boolean",
"default": true,
@ -1709,6 +1798,21 @@
"scope": "window",
"order": 52
},
"gitlens.views.contributors.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 _Contributors_ view will display file icons",
"scope": "window",
"order": 53
},
"gitlens.views.contributors.avatars": {
"type": "boolean",
"default": true,
@ -1775,6 +1879,21 @@
"scope": "window",
"order": 22
},
"gitlens.views.searchAndCompare.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 _Search & Compare_ view will display file icons",
"scope": "window",
"order": 33
},
"gitlens.views.searchAndCompare.avatars": {
"type": "boolean",
"default": true,

+ 18
- 0
src/@types/vscode.git.uri.ts Dosyayı Görüntüle

@ -0,0 +1,18 @@
import { Uri } from 'vscode';
import { Schemes } from '../constants';
export interface GitUriQuery {
path: string;
ref: string;
decoration?: string;
}
export function getQueryDataFromScmGitUri(uri: Uri): GitUriQuery | undefined {
if (uri.scheme === Schemes.Git) {
try {
return JSON.parse(uri.query) as GitUriQuery;
} catch {}
}
return undefined;
}

+ 1
- 1
src/config.ts Dosyayı Görüntüle

@ -735,7 +735,6 @@ export interface ContributorsViewConfig {
export interface FileHistoryViewConfig {
avatars: boolean;
files: ViewsFilesConfig;
}
export interface LineHistoryViewConfig {
@ -821,6 +820,7 @@ export interface WorktreesViewConfig {
export interface ViewsFilesConfig {
compact: boolean;
icon: 'status' | 'type';
layout: ViewFilesLayout;
threshold: number;
}

+ 2
- 5
src/git/gitUri.ts Dosyayı Görüntüle

@ -1,5 +1,6 @@
import { Uri } from 'vscode';
import { decodeUtf8Hex, encodeUtf8Hex } from '@env/hex';
import { getQueryDataFromScmGitUri } from '../@types/vscode.git.uri';
import { Schemes } from '../constants';
import { Container } from '../container';
import type { GitHubAuthorityMetadata } from '../plus/remotehub';
@ -253,11 +254,7 @@ export class GitUri extends (Uri as any as UriEx) {
// If this is a git uri, find its repoPath
if (uri.scheme === Schemes.Git) {
let data: { path: string; ref: string } | undefined;
try {
data = JSON.parse(uri.query);
} catch {}
const data = getQueryDataFromScmGitUri(uri);
if (data?.path) {
const repository = await Container.instance.git.getOrOpenRepository(Uri.file(data.path));
if (repository == null) {

+ 26
- 12
src/views/nodes/commitFileNode.ts Dosyayı Görüntüle

@ -1,7 +1,7 @@
import type { Command, Selection } from 'vscode';
import { MarkdownString, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode';
import type { DiffWithPreviousCommandArgs } from '../../commands';
import { Commands } from '../../constants';
import { Commands, Schemes } from '../../constants';
import { StatusFileFormatter } from '../../git/formatters/statusFormatter';
import { GitUri } from '../../git/gitUri';
import type { GitBranch } from '../../git/models/branch';
@ -10,12 +10,14 @@ import type { GitFile } from '../../git/models/file';
import { getGitFileStatusIcon } from '../../git/models/file';
import type { GitRevisionReference } from '../../git/models/reference';
import { joinPaths, relativeDir } from '../../system/path';
import type { FileHistoryView } from '../fileHistoryView';
import type { View, ViewsWithCommits } from '../viewBase';
import type { StashesView } from '../stashesView';
import type { ViewsWithCommits } from '../viewBase';
import type { ViewNode } from './viewNode';
import { ContextValues, ViewRefFileNode } from './viewNode';
export class CommitFileNode<TView extends View = ViewsWithCommits | FileHistoryView> extends ViewRefFileNode<TView> {
export class CommitFileNode<
TView extends ViewsWithCommits | StashesView = ViewsWithCommits | StashesView,
> extends ViewRefFileNode<TView> {
static key = ':file';
static getId(parent: ViewNode, path: string): string {
return `${parent.id}${this.key}(${path})`;
@ -76,15 +78,27 @@ export class CommitFileNode
item.id = this.id;
item.contextValue = this.contextValue;
item.description = this.description;
item.resourceUri = Uri.parse(`gitlens-view://commit-file/status/${this.file.status}`);
if (this.view.config.files.icon === 'type') {
item.resourceUri = Uri.from({
scheme: Schemes.Git,
authority: 'gitlens-view',
path: this.uri.path,
query: JSON.stringify({
// Ensure we use the fsPath here, otherwise the url won't open properly
path: this.uri.fsPath,
ref: this.uri.sha,
decoration: `gitlens-view://commit-file/status/${this.file.status}`,
}),
});
} else {
item.resourceUri = Uri.parse(`gitlens-view://commit-file/status/${this.file.status}`);
const icon = getGitFileStatusIcon(this.file.status);
item.iconPath = {
dark: this.view.container.context.asAbsolutePath(joinPaths('images', 'dark', icon)),
light: this.view.container.context.asAbsolutePath(joinPaths('images', 'light', icon)),
};
}
item.tooltip = this.tooltip;
const icon = getGitFileStatusIcon(this.file.status);
item.iconPath = {
dark: this.view.container.context.asAbsolutePath(joinPaths('images', 'dark', icon)),
light: this.view.container.context.asAbsolutePath(joinPaths('images', 'light', icon)),
};
item.command = this.getCommand();
// Only cache the label for a single refresh (its only cached because it is used externally for sorting)

+ 2
- 1
src/views/nodes/commitNode.ts Dosyayı Görüntüle

@ -71,6 +71,8 @@ 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;
@ -80,7 +82,6 @@ export class CommitNode extends ViewRefNode
if (
!(this.view instanceof TagsView) &&
!(this.view instanceof FileHistoryView) &&
!this.unpublished &&
getContext('gitlens:hasConnectedRemotes') &&
this.view.config.pullRequests.enabled &&

+ 2
- 3
src/views/nodes/folderNode.ts Dosyayı Görüntüle

@ -4,7 +4,6 @@ import { ViewFilesLayout } from '../../config';
import { GitUri } from '../../git/gitUri';
import type { HierarchicalItem } from '../../system/array';
import { sortCompare } from '../../system/string';
import type { FileHistoryView } from '../fileHistoryView';
import type { StashesView } from '../stashesView';
import type { ViewsWithCommits } from '../viewBase';
import type { ViewFileNode } from './viewNode';
@ -20,7 +19,7 @@ export interface FileNode extends ViewFileNode {
// root?: HierarchicalItem<FileNode>;
}
export class FolderNode extends ViewNode<ViewsWithCommits | FileHistoryView | StashesView> {
export class FolderNode extends ViewNode<ViewsWithCommits | StashesView> {
static key = ':folder';
static getId(parent: ViewNode, path: string): string {
return `${parent.id}${this.key}(${path})`;
@ -29,7 +28,7 @@ export class FolderNode extends ViewNode
readonly priority: number = 1;
constructor(
view: ViewsWithCommits | FileHistoryView | StashesView,
view: ViewsWithCommits | StashesView,
protected override parent: ViewNode,
public readonly repoPath: string,
public readonly folderName: string,

+ 2
- 8
src/views/nodes/stashFileNode.ts Dosyayı Görüntüle

@ -1,20 +1,14 @@
import type { GitStashCommit } from '../../git/models/commit';
import type { GitFile } from '../../git/models/file';
import type { RepositoriesView } from '../repositoriesView';
import type { StashesView } from '../stashesView';
import type { ViewsWithCommits } from '../viewBase';
import { CommitFileNode } from './commitFileNode';
import type { ViewNode } from './viewNode';
import { ContextValues } from './viewNode';
export class StashFileNode extends CommitFileNode<ViewsWithCommits | StashesView | RepositoriesView> {
export class StashFileNode extends CommitFileNode {
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor(
view: ViewsWithCommits | StashesView | RepositoriesView,
parent: ViewNode,
file: GitFile,
commit: GitStashCommit,
) {
constructor(view: ViewsWithCommits | StashesView, parent: ViewNode, file: GitFile, commit: GitStashCommit) {
super(view, parent, file, commit);
}

+ 12
- 3
src/views/viewDecorationProvider.ts Dosyayı Görüntüle

@ -1,7 +1,8 @@
import type { CancellationToken, Event, FileDecoration, FileDecorationProvider, Uri } from 'vscode';
import { Disposable, EventEmitter, ThemeColor, window } from 'vscode';
import type { CancellationToken, Event, FileDecoration, FileDecorationProvider } from 'vscode';
import { Disposable, EventEmitter, ThemeColor, Uri, window } from 'vscode';
import { getQueryDataFromScmGitUri } from '../@types/vscode.git.uri';
import type { Colors } from '../constants';
import { GlyphChars } from '../constants';
import { GlyphChars, Schemes } from '../constants';
import { GitBranchStatus } from '../git/models/branch';
export class ViewFileDecorationProvider implements FileDecorationProvider, Disposable {
@ -38,6 +39,12 @@ export class ViewFileDecorationProvider implements FileDecorationProvider, Dispo
}
provideFileDecoration(uri: Uri, token: CancellationToken): FileDecoration | undefined {
if (uri.scheme === Schemes.Git) {
const data = getQueryDataFromScmGitUri(uri);
if (data?.decoration != null) {
uri = Uri.parse(data?.decoration);
}
}
if (uri.scheme !== 'gitlens-view') return undefined;
switch (uri.authority) {
@ -87,6 +94,8 @@ export class ViewFileDecorationProvider implements FileDecorationProvider, Dispo
case 'M':
return {
badge: 'M',
// Commented out until we can control the color to only apply to the badge, as the color is applied to the entire decoration and its too much
// https://github.com/microsoft/vscode/issues/182098
// color: new ThemeColor('gitlens.decorations.modifiedForegroundColor' satisfies Colors),
tooltip: 'Modified',
};

+ 1
- 0
src/webviews/apps/commitDetails/commitDetails.ts Dosyayı Görüntüle

@ -193,6 +193,7 @@ export class CommitDetailsApp extends App> {
layout: layout ?? ViewFilesLayout.Auto,
compact: this.state.preferences?.files?.compact ?? true,
threshold: this.state.preferences?.files?.threshold ?? 5,
icon: this.state.preferences?.files?.icon ?? 'type',
};
this.state.preferences = {

+ 12
- 0
src/webviews/apps/settings/partials/views.branches.html Dosyayı Görüntüle

@ -146,6 +146,18 @@
<div class="setting">
<div class="setting__input">
<label for="views.branches.files.icon">File icons</label>
<div class="select-container">
<select id="views.branches.files.icon" name="views.branches.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.branches.files.compact"
name="views.branches.files.compact"

+ 12
- 0
src/webviews/apps/settings/partials/views.commits.html Dosyayı Görüntüle

@ -124,6 +124,18 @@
<div class="setting">
<div class="setting__input">
<label for="views.commits.files.icon">File icons</label>
<div class="select-container">
<select id="views.commits.files.icon" name="views.commits.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.commits.files.compact"
name="views.commits.files.compact"

+ 16
- 0
src/webviews/apps/settings/partials/views.contributors.html Dosyayı Görüntüle

@ -116,6 +116,22 @@
<div class="setting">
<div class="setting__input">
<label for="views.contributors.files.icon">File icons</label>
<div class="select-container">
<select
id="views.contributors.files.icon"
name="views.contributors.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.contributors.files.compact"
name="views.contributors.files.compact"

+ 0
- 35
src/webviews/apps/settings/partials/views.file-history.html Dosyayı Görüntüle

@ -30,41 +30,6 @@
<div class="settings settings--fixed ml-1">
<div class="setting">
<div class="setting__input">
<label for="views.fileHistory.files.layout"
>Layout files (when showing folder history)</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">
<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 class="setting">
<div class="setting__input">
<input
id="views.fileHistory.avatars"
name="views.fileHistory.avatars"

+ 0
- 1
src/webviews/apps/settings/partials/views.line-history.html Dosyayı Görüntüle

@ -34,7 +34,6 @@
name="views.lineHistory.avatars"
type="checkbox"
data-setting
disabled
/>
<label for="views.lineHistory.avatars">Use author avatars</label>
</div>

+ 12
- 0
src/webviews/apps/settings/partials/views.remotes.html Dosyayı Görüntüle

@ -127,6 +127,18 @@
<div class="setting">
<div class="setting__input">
<label for="views.remotes.files.icon">File icons</label>
<div class="select-container">
<select id="views.remotes.files.icon" name="views.remotes.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.remotes.files.compact"
name="views.remotes.files.compact"

+ 12
- 0
src/webviews/apps/settings/partials/views.repositories.html Dosyayı Görüntüle

@ -304,6 +304,18 @@
<div class="setting">
<div class="setting__input">
<label for="views.repositories.files.icon">File icons</label>
<div class="select-container">
<select id="views.repositories.files.icon" name="views.repositories.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.repositories.files.compact"
name="views.repositories.files.compact"

+ 16
- 0
src/webviews/apps/settings/partials/views.searchAndCompare.html Dosyayı Görüntüle

@ -87,6 +87,22 @@
<div class="setting">
<div class="setting__input">
<label for="views.searchAndCompare.files.icon">File icons</label>
<div class="select-container">
<select
id="views.searchAndCompare.files.icon"
name="views.searchAndCompare.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.searchAndCompare.files.compact"
name="views.searchAndCompare.files.compact"

+ 12
- 0
src/webviews/apps/settings/partials/views.stashes.html Dosyayı Görüntüle

@ -42,6 +42,18 @@
<div class="setting">
<div class="setting__input">
<label for="views.stashes.files.icon">File icons</label>
<div class="select-container">
<select id="views.stashes.files.icon" name="views.stashes.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.stashes.files.compact"
name="views.stashes.files.compact"

+ 12
- 0
src/webviews/apps/settings/partials/views.tags.html Dosyayı Görüntüle

@ -68,6 +68,18 @@
<div class="setting">
<div class="setting__input">
<label for="views.tags.files.icon">File icons</label>
<div class="select-container">
<select id="views.tags.files.icon" name="views.tags.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.tags.files.compact"
name="views.tags.files.compact"

+ 12
- 0
src/webviews/apps/settings/partials/views.worktrees.html Dosyayı Görüntüle

@ -145,6 +145,18 @@
<div class="setting">
<div class="setting__input">
<label for="views.worktrees.files.icon">File icons</label>
<div class="select-container">
<select id="views.worktrees.files.icon" name="views.worktrees.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.worktrees.files.compact"
name="views.worktrees.files.compact"

+ 4
- 0
src/webviews/commitDetails/commitDetailsWebview.ts Dosyayı Görüntüle

@ -599,6 +599,7 @@ export class CommitDetailsWebviewProvider implements WebviewProvider
this._context.preferences?.dismissed === preferences.dismissed &&
this._context.preferences?.files === preferences.files &&
this._context.preferences?.files?.compact === preferences.files?.compact &&
this._context.preferences?.files?.icon === preferences.files?.icon &&
this._context.preferences?.files?.layout === preferences.files?.layout &&
this._context.preferences?.files?.threshold === preferences.files?.threshold
) {
@ -638,6 +639,9 @@ export class CommitDetailsWebviewProvider implements WebviewProvider
if (this._context.preferences?.files?.compact !== preferences.files?.compact) {
void configuration.updateEffective('views.commitDetails.files.compact', preferences.files?.compact);
}
if (this._context.preferences?.files?.icon !== preferences.files?.icon) {
void configuration.updateEffective('views.commitDetails.files.icon', preferences.files?.icon);
}
if (this._context.preferences?.files?.layout !== preferences.files?.layout) {
void configuration.updateEffective('views.commitDetails.files.layout', preferences.files?.layout);
}

Yükleniyor…
İptal
Kaydet