fix(dialog): improve escape key handling for dialogs
publish / Build and publish Windows installer (release) Successful in 23m4s
publish / Build and publish Ubuntu AppImage (release) Successful in 44m12s
publish / Build and publish gitty-desktop to AUR (release) Failing after 54m38s

The handling of the Escape key has been refined to ensure that it
closes the correct dialog based on the current state. Additionally,
the z-index for the compare dialog backdrop has been updated to
ensure proper layering with other dialogs.

- Enhanced Escape key functionality for better user experience
- Updated z-index for compare dialog backdrop to avoid overlap
This commit is contained in:
2026-08-04 21:17:04 +02:00
parent 2d9a10e85c
commit 96e3805568
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -3967,10 +3967,10 @@
helpOpen = false; helpOpen = false;
return; return;
} }
if (event.key === "Escape" && fileHistoryDialogOpen && !isBusy) closeFileHistoryDialog(); if (event.key === "Escape" && compareDialogOpen) closeCompareDialog();
else if (event.key === "Escape" && fileHistoryDialogOpen && !isBusy) closeFileHistoryDialog();
else if (event.key === "Escape" && repoTabContextMenu) closeRepoTabContextMenu(); else if (event.key === "Escape" && repoTabContextMenu) closeRepoTabContextMenu();
else if (event.key === "Escape" && pendingDiscard && !isBusy) closeDiscardConfirm(); else if (event.key === "Escape" && pendingDiscard && !isBusy) closeDiscardConfirm();
else if (event.key === "Escape" && compareDialogOpen) closeCompareDialog();
else if (event.key === "Escape" && newBranchCommit) newBranchCommit = null; else if (event.key === "Escape" && newBranchCommit) newBranchCommit = null;
else if (event.key === "Escape" && renameBranchTarget) renameBranchTarget = null; else if (event.key === "Escape" && renameBranchTarget) renameBranchTarget = null;
else if (event.key === "Escape" && deleteBranchTarget) closeDeleteBranchDialog(); else if (event.key === "Escape" && deleteBranchTarget) closeDeleteBranchDialog();
+1
View File
@@ -2882,6 +2882,7 @@
overflow: hidden; overflow: hidden;
} }
.file-history-dialog-backdrop { z-index: 70; } .file-history-dialog-backdrop { z-index: 70; }
.compare-dialog-backdrop { z-index: 80; }
.file-history-dialog { .file-history-dialog {
display: grid; display: grid;
grid-template-rows: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
+1 -1
View File
@@ -216,7 +216,7 @@
</script> </script>
<div <div
class="dialog-backdrop" class="dialog-backdrop compare-dialog-backdrop"
role="presentation" role="presentation"
> >
<div class="dialog compare-dialog" role="dialog" aria-modal="true" aria-label="Commit comparison" tabindex="-1"> <div class="dialog compare-dialog" role="dialog" aria-modal="true" aria-label="Commit comparison" tabindex="-1">