Browse Source

💄prettiers

main
Eric Amodio 1 year ago
parent
commit
fbccf2428f
28 changed files with 190 additions and 186 deletions
  1. +0
    -4
      .prettierrc
  2. +4
    -4
      src/annotations/blameAnnotationProvider.ts
  3. +2
    -2
      src/annotations/gutterChangesAnnotationProvider.ts
  4. +8
    -8
      src/commands/git/push.ts
  5. +8
    -8
      src/commands/quickCommand.ts
  6. +2
    -2
      src/errors.ts
  7. +2
    -2
      src/extension.ts
  8. +16
    -16
      src/plus/github/github.ts
  9. +4
    -4
      src/plus/github/githubGitProvider.ts
  10. +2
    -2
      src/plus/gk/checkin.ts
  11. +4
    -4
      src/quickpicks/referencePicker.ts
  12. +2
    -2
      src/system/configuration.ts
  13. +10
    -10
      src/system/serialize.ts
  14. +34
    -34
      src/views/nodes/abstract/viewNode.ts
  15. +6
    -6
      src/views/nodes/autolinkedItemNode.ts
  16. +9
    -5
      src/views/nodes/branchNode.ts
  17. +4
    -4
      src/views/nodes/commitNode.ts
  18. +6
    -6
      src/views/nodes/fileHistoryNode.ts
  19. +2
    -2
      src/views/nodes/fileRevisionAsCommitNode.ts
  20. +9
    -5
      src/views/nodes/remoteNode.ts
  21. +2
    -2
      src/views/nodes/resultsCommitsNode.ts
  22. +2
    -2
      src/views/nodes/resultsFilesNode.ts
  23. +6
    -6
      src/views/nodes/worktreeNode.ts
  24. +4
    -4
      src/views/viewCommands.ts
  25. +4
    -4
      src/webviews/apps/plus/focus/components/gk-pull-request-row.ts
  26. +2
    -2
      src/webviews/apps/plus/timeline/chart.ts
  27. +34
    -34
      src/webviews/apps/shared/components/list/file-change-list-item.ts
  28. +2
    -2
      src/webviews/webviewController.ts

+ 0
- 4
.prettierrc View File

@ -14,10 +14,6 @@
{ {
"files": "*.md", "files": "*.md",
"options": { "tabWidth": 2 } "options": { "tabWidth": 2 }
},
{
"files": "*.svg",
"options": { "parser": "html" }
} }
] ]
} }

+ 4
- 4
src/annotations/blameAnnotationProvider.ts View File

@ -107,10 +107,10 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase
Array.isArray(lookupTable) Array.isArray(lookupTable)
? lookupTable ? lookupTable
: unified : unified
? lookupTable.hot.concat(lookupTable.cold)
: date.getTime() < coldThresholdTimestamp
? lookupTable.cold
: lookupTable.hot;
? lookupTable.hot.concat(lookupTable.cold)
: date.getTime() < coldThresholdTimestamp
? lookupTable.cold
: lookupTable.hot;
const computeRelativeAge = (date: Date, lookup: number[]) => { const computeRelativeAge = (date: Date, lookup: number[]) => {
const time = date.getTime(); const time = date.getTime();

+ 2
- 2
src/annotations/gutterChangesAnnotationProvider.ts View File

@ -211,8 +211,8 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase
decorationType: (hunkLine.state === 'added' decorationType: (hunkLine.state === 'added'
? Decorations.changesLineAddedAnnotation ? Decorations.changesLineAddedAnnotation
: hunkLine.state === 'removed' : hunkLine.state === 'removed'
? Decorations.changesLineDeletedAnnotation
: Decorations.changesLineChangedAnnotation)!,
? Decorations.changesLineDeletedAnnotation
: Decorations.changesLineChangedAnnotation)!,
rangesOrOptions: [{ range: range }], rangesOrOptions: [{ range: range }],
}; };
decorationsMap.set(hunkLine.state, decoration); decorationsMap.set(hunkLine.state, decoration);

+ 8
- 8
src/commands/git/push.ts View File

@ -242,8 +242,8 @@ export class PushGitCommand extends QuickCommand {
useForceIfIncludes useForceIfIncludes
? ' (with lease and if includes)' ? ' (with lease and if includes)'
: useForceWithLease : useForceWithLease
? ' (with lease)'
: ''
? ' (with lease)'
: ''
}`, }`,
description: `--force${ description: `--force${
useForceWithLease useForceWithLease
@ -254,8 +254,8 @@ export class PushGitCommand extends QuickCommand {
useForceIfIncludes useForceIfIncludes
? ' (with lease and if includes)' ? ' (with lease and if includes)'
: useForceWithLease : useForceWithLease
? ' (with lease)'
: ''
? ' (with lease)'
: ''
} ${branch?.state.ahead ? ` ${pluralize('commit', branch.state.ahead)}` : ''}${ } ${branch?.state.ahead ? ` ${pluralize('commit', branch.state.ahead)}` : ''}${
branch.getRemoteName() ? ` to ${branch.getRemoteName()}` : '' branch.getRemoteName() ? ` to ${branch.getRemoteName()}` : ''
}${ }${
@ -406,8 +406,8 @@ export class PushGitCommand extends QuickCommand {
useForceIfIncludes useForceIfIncludes
? ' (with lease and if includes)' ? ' (with lease and if includes)'
: useForceWithLease : useForceWithLease
? ' (with lease)'
: ''
? ' (with lease)'
: ''
}`, }`,
description: `--force${ description: `--force${
useForceWithLease useForceWithLease
@ -418,8 +418,8 @@ export class PushGitCommand extends QuickCommand {
useForceIfIncludes useForceIfIncludes
? ' (with lease and if includes)' ? ' (with lease and if includes)'
: useForceWithLease : useForceWithLease
? ' (with lease)'
: ''
? ' (with lease)'
: ''
} ${pushDetails}${ } ${pushDetails}${
status != null && status.state.behind > 0 status != null && status.state.behind > 0
? `, overwriting ${pluralize('commit', status.state.behind)}${ ? `, overwriting ${pluralize('commit', status.state.behind)}${

+ 8
- 8
src/commands/quickCommand.ts View File

@ -88,10 +88,10 @@ export type StepGenerator =
export type StepItemType<T> = T extends CustomStep<infer U> export type StepItemType<T> = T extends CustomStep<infer U>
? U ? U
: T extends QuickPickStep<infer U> : T extends QuickPickStep<infer U>
? U[]
: T extends QuickInputStep
? string
: never;
? U[]
: T extends QuickInputStep
? string
: never;
export type StepNavigationKeys = Exclude<Keys, 'left' | 'alt+left' | 'ctrl+left'>; export type StepNavigationKeys = Exclude<Keys, 'left' | 'alt+left' | 'ctrl+left'>;
export const StepResultBreak = Symbol('BreakStep'); export const StepResultBreak = Symbol('BreakStep');
export type StepResult<T> = typeof StepResultBreak | T; export type StepResult<T> = typeof StepResultBreak | T;
@ -112,10 +112,10 @@ export type AsyncStepResultGenerator = AsyncGenerator<
export type StepSelection<T> = T extends CustomStep<infer U> export type StepSelection<T> = T extends CustomStep<infer U>
? U | Directive ? U | Directive
: T extends QuickPickStep<infer U> : T extends QuickPickStep<infer U>
? U[] | Directive
: T extends QuickInputStep
? string | Directive
: never;
? U[] | Directive
: T extends QuickInputStep
? string | Directive
: never;
export type PartialStepState<T = unknown> = Partial<T> & { counter: number; confirm?: boolean; startingStep?: number }; export type PartialStepState<T = unknown> = Partial<T> & { counter: number; confirm?: boolean; startingStep?: number };
export type StepState<T = Record<string, unknown>> = T & { counter: number; confirm?: boolean; startingStep?: number }; export type StepState<T = Record<string, unknown>> = T & { counter: number; confirm?: boolean; startingStep?: number };

+ 2
- 2
src/errors.ts View File

@ -192,8 +192,8 @@ export class ProviderNotFoundError extends Error {
pathOrUri == null pathOrUri == null
? String(pathOrUri) ? String(pathOrUri)
: typeof pathOrUri === 'string' : typeof pathOrUri === 'string'
? pathOrUri
: pathOrUri.toString(true)
? pathOrUri
: pathOrUri.toString(true)
}'`, }'`,
); );

+ 2
- 2
src/extension.ts View File

@ -273,8 +273,8 @@ function registerBuiltInActionRunners(container: Container): void {
compare: ctx.branch.isRemote compare: ctx.branch.isRemote
? getBranchNameWithoutRemote(ctx.branch.name) ? getBranchNameWithoutRemote(ctx.branch.name)
: ctx.branch.upstream : ctx.branch.upstream
? getBranchNameWithoutRemote(ctx.branch.upstream)
: ctx.branch.name,
? getBranchNameWithoutRemote(ctx.branch.upstream)
: ctx.branch.name,
remote: ctx.remote?.name ?? '', remote: ctx.remote?.name ?? '',
repoPath: ctx.repoPath, repoPath: ctx.repoPath,
})); }));

+ 16
- 16
src/plus/github/github.ts View File

@ -298,14 +298,14 @@ export class GitHubApi implements Disposable {
!author.avatarUrl || isGitHubDotCom(options) !author.avatarUrl || isGitHubDotCom(options)
? author.avatarUrl ?? undefined ? author.avatarUrl ?? undefined
: author.email && options?.baseUrl != null : author.email && options?.baseUrl != null
? await this.createEnterpriseAvatarUrl(
provider,
token,
options.baseUrl,
author.email,
options.avatarSize,
)
: undefined,
? await this.createEnterpriseAvatarUrl(
provider,
token,
options.baseUrl,
author.email,
options.avatarSize,
)
: undefined,
}; };
} catch (ex) { } catch (ex) {
if (ex instanceof ProviderRequestNotFoundError) return undefined; if (ex instanceof ProviderRequestNotFoundError) return undefined;
@ -385,14 +385,14 @@ export class GitHubApi implements Disposable {
!author.avatarUrl || isGitHubDotCom(options) !author.avatarUrl || isGitHubDotCom(options)
? author.avatarUrl ?? undefined ? author.avatarUrl ?? undefined
: author.email && options?.baseUrl != null : author.email && options?.baseUrl != null
? await this.createEnterpriseAvatarUrl(
provider,
token,
options.baseUrl,
author.email,
options.avatarSize,
)
: undefined,
? await this.createEnterpriseAvatarUrl(
provider,
token,
options.baseUrl,
author.email,
options.avatarSize,
)
: undefined,
}; };
} catch (ex) { } catch (ex) {
if (ex instanceof ProviderRequestNotFoundError) return undefined; if (ex instanceof ProviderRequestNotFoundError) return undefined;

+ 4
- 4
src/plus/github/githubGitProvider.ts View File

@ -2924,8 +2924,8 @@ export class GitHubGitProvider implements GitProvider, Disposable {
options?.ordering === 'date' options?.ordering === 'date'
? 'committer-date' ? 'committer-date'
: options?.ordering === 'author-date' : options?.ordering === 'author-date'
? 'author-date'
: undefined,
? 'author-date'
: undefined,
}); });
if (result == null) return undefined; if (result == null) return undefined;
@ -3116,8 +3116,8 @@ export class GitHubGitProvider implements GitProvider, Disposable {
options?.ordering === 'date' options?.ordering === 'date'
? 'committer-date' ? 'committer-date'
: options?.ordering === 'author-date' : options?.ordering === 'author-date'
? 'author-date'
: undefined,
? 'author-date'
: undefined,
}); });
if (result == null || options?.cancellation?.isCancellationRequested) { if (result == null || options?.cancellation?.isCancellationRequested) {

+ 2
- 2
src/plus/gk/checkin.ts View File

@ -90,8 +90,8 @@ export function getSubscriptionFromCheckIn(data: GKCheckInResponse): Partial
data.user.firstGitLensCheckIn != null data.user.firstGitLensCheckIn != null
? new Date(data.user.firstGitLensCheckIn) ? new Date(data.user.firstGitLensCheckIn)
: data.user.createdDate != null : data.user.createdDate != null
? new Date(data.user.createdDate)
: undefined,
? new Date(data.user.createdDate)
: undefined,
); );
} }

+ 4
- 4
src/quickpicks/referencePicker.ts View File

@ -173,10 +173,10 @@ async function getItems(
include && ReferencesQuickPickIncludes.BranchesAndTags include && ReferencesQuickPickIncludes.BranchesAndTags
? ['branches', 'tags'] ? ['branches', 'tags']
: include && ReferencesQuickPickIncludes.Branches : include && ReferencesQuickPickIncludes.Branches
? ['branches']
: include && ReferencesQuickPickIncludes.Tags
? ['tags']
: [],
? ['branches']
: include && ReferencesQuickPickIncludes.Tags
? ['tags']
: [],
{ {
buttons: [RevealInSideBarQuickInputButton], buttons: [RevealInSideBarQuickInputButton],
filter: filter, filter: filter,

+ 2
- 2
src/system/configuration.ts View File

@ -338,8 +338,8 @@ export type PathValue> = P extends `${infer Key}.${infer Re
: never : never
: never : never
: P extends keyof T : P extends keyof T
? T[P]
: never;
? T[P]
: never;
export type ConfigPath = Path<Config>; export type ConfigPath = Path<Config>;
export type ConfigPathValue<P extends ConfigPath> = PathValue<Config, P>; export type ConfigPathValue<P extends ConfigPath> = PathValue<Config, P>;

+ 10
- 10
src/system/serialize.ts View File

@ -3,16 +3,16 @@ import type { Branded } from './brand';
export type Serialized<T> = T extends Function export type Serialized<T> = T extends Function
? never ? never
: T extends Date : T extends Date
? number
: T extends Branded<infer U, any>
? U
: T extends any[]
? Serialized<T[number]>[]
: T extends object
? {
[K in keyof T]: T[K] extends Date ? number : Serialized<T[K]>;
}
: T;
? number
: T extends Branded<infer U, any>
? U
: T extends any[]
? Serialized<T[number]>[]
: T extends object
? {
[K in keyof T]: T[K] extends Date ? number : Serialized<T[K]>;
}
: T;
export function serialize<T extends object>(obj: T): Serialized<T>; export function serialize<T extends object>(obj: T): Serialized<T>;
export function serialize<T extends object>(obj: T | undefined): Serialized<T> | undefined; export function serialize<T extends object>(obj: T | undefined): Serialized<T> | undefined;

+ 34
- 34
src/views/nodes/abstract/viewNode.ts View File

@ -370,40 +370,40 @@ type TreeViewNodesByType = {
[T in TreeViewNodeTypes]: T extends 'branch' [T in TreeViewNodeTypes]: T extends 'branch'
? BranchNode ? BranchNode
: T extends 'commit' : T extends 'commit'
? CommitNode
: T extends 'commit-file'
? CommitFileNode
: T extends 'compare-branch'
? CompareBranchNode
: T extends 'compare-results'
? CompareResultsNode
: T extends 'conflict-file'
? MergeConflictFileNode
: T extends 'file-commit'
? FileRevisionAsCommitNode
: T extends 'folder'
? FolderNode
: T extends 'line-history-tracker'
? LineHistoryTrackerNode
: T extends 'repository'
? RepositoryNode
: T extends 'repo-folder'
? RepositoryFolderNode
: T extends 'results-commits'
? ResultsCommitsNode
: T extends 'results-file'
? ResultsFileNode
: T extends 'stash'
? StashNode
: T extends 'stash-file'
? StashFileNode
: T extends 'status-file'
? StatusFileNode
: T extends 'tag'
? TagNode
: T extends 'uncommitted-file'
? UncommittedFileNode
: ViewNode<T>;
? CommitNode
: T extends 'commit-file'
? CommitFileNode
: T extends 'compare-branch'
? CompareBranchNode
: T extends 'compare-results'
? CompareResultsNode
: T extends 'conflict-file'
? MergeConflictFileNode
: T extends 'file-commit'
? FileRevisionAsCommitNode
: T extends 'folder'
? FolderNode
: T extends 'line-history-tracker'
? LineHistoryTrackerNode
: T extends 'repository'
? RepositoryNode
: T extends 'repo-folder'
? RepositoryFolderNode
: T extends 'results-commits'
? ResultsCommitsNode
: T extends 'results-file'
? ResultsFileNode
: T extends 'stash'
? StashNode
: T extends 'stash-file'
? StashFileNode
: T extends 'status-file'
? StatusFileNode
: T extends 'tag'
? TagNode
: T extends 'uncommitted-file'
? UncommittedFileNode
: ViewNode<T>;
}; };
export function isViewNode(node: unknown): node is ViewNode; export function isViewNode(node: unknown): node is ViewNode;

+ 6
- 6
src/views/nodes/autolinkedItemNode.ts View File

@ -56,10 +56,10 @@ export class AutolinkedItemNode extends ViewNode<'autolink', ViewsWithCommits> {
pending pending
? 'loading~spin' ? 'loading~spin'
: autolink.type == null : autolink.type == null
? 'link'
: autolink.type === 'pullrequest'
? 'git-pull-request'
: 'issues',
? 'link'
: autolink.type === 'pullrequest'
? 'git-pull-request'
: 'issues',
); );
item.contextValue = ContextValues.AutolinkedItem; item.contextValue = ContextValues.AutolinkedItem;
item.tooltip = new MarkdownString( item.tooltip = new MarkdownString(
@ -70,8 +70,8 @@ export class AutolinkedItemNode extends ViewNode<'autolink', ViewsWithCommits> {
autolink.type == null autolink.type == null
? 'Autolinked' ? 'Autolinked'
: autolink.type === 'pullrequest' : autolink.type === 'pullrequest'
? 'Autolinked Pull Request'
: 'Autolinked Issue'
? 'Autolinked Pull Request'
: 'Autolinked Issue'
} ${autolink.prefix}${autolink.id}` } ${autolink.prefix}${autolink.id}`
} \\\n[${autolink.url}](${autolink.url}${autolink.title != null ? ` "${autolink.title}"` : ''})`, } \\\n[${autolink.url}](${autolink.url}${autolink.title != null ? ` "${autolink.title}"` : ''})`,
); );

+ 9
- 5
src/views/nodes/branchNode.ts View File

@ -500,11 +500,15 @@ export class BranchNode
pendingPullRequest != null pendingPullRequest != null
? new ThemeIcon('loading~spin') ? new ThemeIcon('loading~spin')
: this.options.showAsCommits : this.options.showAsCommits
? new ThemeIcon('git-commit', color)
: {
dark: this.view.container.context.asAbsolutePath(`images/dark/icon-branch${iconSuffix}.svg`),
light: this.view.container.context.asAbsolutePath(`images/light/icon-branch${iconSuffix}.svg`),
};
? new ThemeIcon('git-commit', color)
: {
dark: this.view.container.context.asAbsolutePath(
`images/dark/icon-branch${iconSuffix}.svg`,
),
light: this.view.container.context.asAbsolutePath(
`images/light/icon-branch${iconSuffix}.svg`,
),
};
item.tooltip = tooltip; item.tooltip = tooltip;
item.resourceUri = Uri.parse( item.resourceUri = Uri.parse(
`gitlens-view://branch/status/${await this.branch.getStatus()}${ `gitlens-view://branch/status/${await this.branch.getStatus()}${

+ 4
- 4
src/views/nodes/commitNode.ts View File

@ -188,10 +188,10 @@ export class CommitNode extends ViewRefNode<'commit', ViewsWithCommits | FileHis
pendingPullRequest != null pendingPullRequest != null
? new ThemeIcon('loading~spin') ? new ThemeIcon('loading~spin')
: this.unpublished : this.unpublished
? new ThemeIcon('arrow-up', new ThemeColor('gitlens.unpublishedCommitIconColor' satisfies Colors))
: this.view.config.avatars
? await this.commit.getAvatarUri({ defaultStyle: configuration.get('defaultGravatarsStyle') })
: undefined;
? new ThemeIcon('arrow-up', new ThemeColor('gitlens.unpublishedCommitIconColor' satisfies Colors))
: this.view.config.avatars
? await this.commit.getAvatarUri({ defaultStyle: configuration.get('defaultGravatarsStyle') })
: undefined;
// item.tooltip = this.tooltip; // item.tooltip = this.tooltip;
return item; return item;

+ 6
- 6
src/views/nodes/fileHistoryNode.ts View File

@ -129,12 +129,12 @@ export class FileHistoryNode
}, },
) )
: c.file != null : c.file != null
? new FileRevisionAsCommitNode(this.view, this, c.file, c, {
branch: this.branch,
getBranchAndTagTips: getBranchAndTagTips,
unpublished: unpublishedCommits?.has(c.ref),
})
: undefined,
? new FileRevisionAsCommitNode(this.view, this, c.file, c, {
branch: this.branch,
getBranchAndTagTips: getBranchAndTagTips,
unpublished: unpublishedCommits?.has(c.ref),
})
: undefined,
), ),
this, this,
), ),

+ 2
- 2
src/views/nodes/fileRevisionAsCommitNode.ts View File

@ -139,8 +139,8 @@ export class FileRevisionAsCommitNode extends ViewRefFileNode<
return this.commit.file?.hasConflicts return this.commit.file?.hasConflicts
? `${ContextValues.File}+conflicted` ? `${ContextValues.File}+conflicted`
: this.commit.isUncommittedStaged : this.commit.isUncommittedStaged
? `${ContextValues.File}+staged`
: `${ContextValues.File}+unstaged`;
? `${ContextValues.File}+staged`
: `${ContextValues.File}+unstaged`;
} }
override getCommand(): Command | undefined { override getCommand(): Command | undefined {

+ 9
- 5
src/views/nodes/remoteNode.ts View File

@ -92,11 +92,15 @@ export class RemoteNode extends ViewNode<'remote', ViewsWithRemotes> {
provider.avatarUri != null && this.view.config.avatars provider.avatarUri != null && this.view.config.avatars
? provider.avatarUri ? provider.avatarUri
: provider.icon === 'remote' : provider.icon === 'remote'
? new ThemeIcon('cloud')
: {
dark: this.view.container.context.asAbsolutePath(`images/dark/icon-${provider.icon}.svg`),
light: this.view.container.context.asAbsolutePath(`images/light/icon-${provider.icon}.svg`),
};
? new ThemeIcon('cloud')
: {
dark: this.view.container.context.asAbsolutePath(
`images/dark/icon-${provider.icon}.svg`,
),
light: this.view.container.context.asAbsolutePath(
`images/light/icon-${provider.icon}.svg`,
),
};
if (provider.hasRichIntegration()) { if (provider.hasRichIntegration()) {
const connected = provider.maybeConnected ?? (await provider.isConnected()); const connected = provider.maybeConnected ?? (await provider.isConnected());

+ 2
- 2
src/views/nodes/resultsCommitsNode.ts View File

@ -156,8 +156,8 @@ export class ResultsCommitsNode
log == null || log.count === 0 log == null || log.count === 0
? TreeItemCollapsibleState.None ? TreeItemCollapsibleState.None
: this._options.expand || log.count === 1 : this._options.expand || log.count === 1
? TreeItemCollapsibleState.Expanded
: TreeItemCollapsibleState.Collapsed;
? TreeItemCollapsibleState.Expanded
: TreeItemCollapsibleState.Collapsed;
} catch (ex) { } catch (ex) {
if (ex instanceof PromiseCancelledError) { if (ex instanceof PromiseCancelledError) {
setTimeout(async () => { setTimeout(async () => {

+ 2
- 2
src/views/nodes/resultsFilesNode.ts View File

@ -156,8 +156,8 @@ export class ResultsFilesNode extends ViewNode<'results-files', ViewsWithCommits
files == null || files.length === 0 files == null || files.length === 0
? TreeItemCollapsibleState.None ? TreeItemCollapsibleState.None
: this._options.expand : this._options.expand
? TreeItemCollapsibleState.Expanded
: TreeItemCollapsibleState.Collapsed;
? TreeItemCollapsibleState.Expanded
: TreeItemCollapsibleState.Collapsed;
} }
} catch (ex) { } catch (ex) {
if (ex instanceof PromiseCancelledError) { if (ex instanceof PromiseCancelledError) {

+ 6
- 6
src/views/nodes/worktreeNode.ts View File

@ -202,8 +202,8 @@ export class WorktreeNode extends CacheableChildrenViewNode<'worktree', ViewsWit
this.worktree.main this.worktree.main
? `_Main${this.worktree.opened ? ', Active_' : '_'}` ? `_Main${this.worktree.opened ? ', Active_' : '_'}`
: this.worktree.opened : this.worktree.opened
? '_Active_'
: ''
? '_Active_'
: ''
} ` } `
: ''; : '';
@ -367,14 +367,14 @@ export class WorktreeNode extends CacheableChildrenViewNode<'worktree', ViewsWit
pendingPullRequest != null pendingPullRequest != null
? new ThemeIcon('loading~spin') ? new ThemeIcon('loading~spin')
: this.worktree.opened : this.worktree.opened
? new ThemeIcon('check')
: icon;
? new ThemeIcon('check')
: icon;
item.tooltip = tooltip; item.tooltip = tooltip;
item.resourceUri = missing item.resourceUri = missing
? Uri.parse('gitlens-view://worktree/missing') ? Uri.parse('gitlens-view://worktree/missing')
: hasChanges : hasChanges
? Uri.parse('gitlens-view://worktree/changes')
: undefined;
? Uri.parse('gitlens-view://worktree/changes')
: undefined;
return item; return item;
} }

+ 4
- 4
src/views/viewCommands.ts View File

@ -417,8 +417,8 @@ export class ViewCommands {
node instanceof ViewRefNode || node instanceof ViewRefFileNode node instanceof ViewRefNode || node instanceof ViewRefFileNode
? node?.ref ? node?.ref
: node instanceof BranchTrackingStatusNode : node instanceof BranchTrackingStatusNode
? node.branch
: undefined;
? node.branch
: undefined;
if (from == null) { if (from == null) {
const branch = await this.container.git.getBranch( const branch = await this.container.git.getBranch(
node?.repoPath ?? this.container.git.getBestRepository()?.uri, node?.repoPath ?? this.container.git.getBestRepository()?.uri,
@ -467,8 +467,8 @@ export class ViewCommands {
node instanceof ViewRefNode || node instanceof ViewRefFileNode node instanceof ViewRefNode || node instanceof ViewRefFileNode
? node?.ref ? node?.ref
: node instanceof BranchTrackingStatusNode : node instanceof BranchTrackingStatusNode
? node.branch
: undefined;
? node.branch
: undefined;
if (from == null) { if (from == null) {
const branch = await this.container.git.getBranch( const branch = await this.container.git.getBranch(
node?.repoPath ?? this.container.git.getBestRepository()?.uri, node?.repoPath ?? this.container.git.getBestRepository()?.uri,

+ 4
- 4
src/webviews/apps/plus/focus/components/gk-pull-request-row.ts View File

@ -264,8 +264,8 @@ export class GkPullRequestRow extends LitElement {
aria-label="${this.isCurrentBranch aria-label="${this.isCurrentBranch
? 'Already on this branch' ? 'Already on this branch'
: this.hasWorktree : this.hasWorktree
? 'This branch has a worktree'
: 'Switch to Branch...'}"
? 'This branch has a worktree'
: 'Switch to Branch...'}"
@click="${this.onSwitchBranchClick}" @click="${this.onSwitchBranchClick}"
><code-icon icon="gl-switch"></code-icon ><code-icon icon="gl-switch"></code-icon
></a> ></a>
@ -273,8 +273,8 @@ export class GkPullRequestRow extends LitElement {
>${this.isCurrentBranch >${this.isCurrentBranch
? 'Already on this branch' ? 'Already on this branch'
: this.hasWorktree : this.hasWorktree
? 'This branch has a worktree'
: 'Switch to Branch...'}</span
? 'This branch has a worktree'
: 'Switch to Branch...'}</span
> >
</gk-tooltip> </gk-tooltip>
</nav> </nav>

+ 2
- 2
src/webviews/apps/plus/timeline/chart.ts View File

@ -339,8 +339,8 @@ export class TimelineChart implements Disposable {
this.compact this.compact
? '' ? ''
: typeof x === 'number' : typeof x === 'number'
? x
: formatDate(x, this._shortDateFormat ?? 'short'),
? x
: formatDate(x, this._shortDateFormat ?? 'short'),
multiline: false, multiline: false,
show: false, show: false,
outer: !this.compact, outer: !this.compact,

+ 34
- 34
src/webviews/apps/shared/components/list/file-change-list-item.ts View File

@ -169,40 +169,40 @@ export class FileChangeListItem extends LitElement {
</a> </a>
` `
: !this.uncommitted : !this.uncommitted
? html`
<a
class="change-list__action"
@click=${this.onCompareWorking}
href="#"
title="Open Changes with Working File"
aria-label="Open Changes with Working File"
>
<code-icon icon="git-compare"></code-icon>
</a>
${this.stash
? nothing
: html`
<a
class="change-list__action"
@click=${this.onOpenFileOnRemote}
href="#"
title="Open on remote"
aria-label="Open on remote"
>
<code-icon icon="globe"></code-icon>
</a>
<a
class="change-list__action"
@click=${this.onMoreActions}
href="#"
title="Show more actions"
aria-label="Show more actions"
>
<code-icon icon="ellipsis"></code-icon>
</a>
`}
`
: nothing}
? html`
<a
class="change-list__action"
@click=${this.onCompareWorking}
href="#"
title="Open Changes with Working File"
aria-label="Open Changes with Working File"
>
<code-icon icon="git-compare"></code-icon>
</a>
${this.stash
? nothing
: html`
<a
class="change-list__action"
@click=${this.onOpenFileOnRemote}
href="#"
title="Open on remote"
aria-label="Open on remote"
>
<code-icon icon="globe"></code-icon>
</a>
<a
class="change-list__action"
@click=${this.onMoreActions}
href="#"
title="Show more actions"
aria-label="Show more actions"
>
<code-icon icon="ellipsis"></code-icon>
</a>
`}
`
: nothing}
</span> </span>
</list-item> </list-item>
`; `;

+ 2
- 2
src/webviews/webviewController.ts View File

@ -40,8 +40,8 @@ function nextIpcId() {
type GetParentType<T extends WebviewPanelDescriptor | WebviewViewDescriptor> = T extends WebviewPanelDescriptor type GetParentType<T extends WebviewPanelDescriptor | WebviewViewDescriptor> = T extends WebviewPanelDescriptor
? WebviewPanel ? WebviewPanel
: T extends WebviewViewDescriptor : T extends WebviewViewDescriptor
? WebviewView
: never;
? WebviewView
: never;
export type WebviewShowingArgs<T extends unknown[], SerializedState> = T | [{ state: Partial<SerializedState> }] | []; export type WebviewShowingArgs<T extends unknown[], SerializedState> = T | [{ state: Partial<SerializedState> }] | [];

Loading…
Cancel
Save