refine ui

restore in a Dialog
This commit is contained in:
Christoph Brandau
2026-06-29 17:53:02 +02:00
parent b0491d1479
commit 8d56c3f39f
8 changed files with 293 additions and 97 deletions
+4 -4
View File
@@ -27,7 +27,7 @@
isBusy: boolean;
expandedCommitHashes: Set<string>;
onRestoreCommit: (commit: GitCommit) => void;
onRestoreCommitFile: (commit: GitCommit, file: GitCommitFile) => void;
onPreviewCommitFile: (commit: GitCommit, file: GitCommitFile) => void;
onToggleCommitFiles: (hash: string) => void;
}
@@ -37,7 +37,7 @@
isBusy = false,
expandedCommitHashes = new Set(),
onRestoreCommit = () => {},
onRestoreCommitFile = () => {},
onPreviewCommitFile = () => {},
onToggleCommitFiles = () => {},
}: Props = $props();
@@ -204,9 +204,9 @@
<button
class="commit-file-button"
type="button"
onclick={() => onRestoreCommitFile(item, file)}
onclick={() => onPreviewCommitFile(item, file)}
disabled={isBusy}
title="Restore this file from this commit"
title="Show differences before restoring"
>
<span class={`status-badge ${file.status}`}>{statusLabel(file.status)}</span>
<strong>{displayCommitFile(file)}</strong>