add new Context Menu for file Explorer
fix blocking UI when select the file in Status also select in the file History
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
hasRepository: boolean;
|
||||
isBusy: boolean;
|
||||
status: GitStatus | null;
|
||||
selectedFilePath: string;
|
||||
onSelectFile: (file: GitFileStatus) => void;
|
||||
onStage: (file: GitFileStatus) => void;
|
||||
onUnstage: (file: GitFileStatus) => void;
|
||||
onDiscard: (file: GitFileStatus, staged: boolean) => void;
|
||||
@@ -24,6 +26,8 @@
|
||||
hasRepository = false,
|
||||
isBusy = false,
|
||||
status = null,
|
||||
selectedFilePath = "",
|
||||
onSelectFile = () => {},
|
||||
onStage = () => {},
|
||||
onUnstage = () => {},
|
||||
onDiscard = () => {},
|
||||
@@ -102,9 +106,19 @@
|
||||
{:else}
|
||||
<div class="overflow-auto p-2">
|
||||
{#each changedFiles as file (`${file.old_path ?? ""}:${file.path}`)}
|
||||
<article class="file-row">
|
||||
<article
|
||||
class="file-row"
|
||||
class:selected={selectedFilePath === file.path}
|
||||
>
|
||||
<div class="file-title">
|
||||
<strong title={displayPath(file)}>{fileName(file)}</strong>
|
||||
<button
|
||||
class="file-title-button"
|
||||
type="button"
|
||||
onclick={() => onSelectFile(file)}
|
||||
title={`Select ${displayPath(file)} in Explorer`}
|
||||
>
|
||||
<strong>{fileName(file)}</strong>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="change-lanes">
|
||||
|
||||
Reference in New Issue
Block a user