From 96e3805568240134887119da4efadf2acd0f617f Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Tue, 4 Aug 2026 21:17:04 +0200 Subject: [PATCH] fix(dialog): improve escape key handling for dialogs 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 --- src/App.svelte | 4 ++-- src/app.css | 1 + src/lib/components/CompareDialog.svelte | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 0fea306..c554e42 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -3967,10 +3967,10 @@ helpOpen = false; 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" && pendingDiscard && !isBusy) closeDiscardConfirm(); - else if (event.key === "Escape" && compareDialogOpen) closeCompareDialog(); else if (event.key === "Escape" && newBranchCommit) newBranchCommit = null; else if (event.key === "Escape" && renameBranchTarget) renameBranchTarget = null; else if (event.key === "Escape" && deleteBranchTarget) closeDeleteBranchDialog(); diff --git a/src/app.css b/src/app.css index a419a10..a7f9b4b 100644 --- a/src/app.css +++ b/src/app.css @@ -2882,6 +2882,7 @@ overflow: hidden; } .file-history-dialog-backdrop { z-index: 70; } + .compare-dialog-backdrop { z-index: 80; } .file-history-dialog { display: grid; grid-template-rows: auto minmax(0, 1fr); diff --git a/src/lib/components/CompareDialog.svelte b/src/lib/components/CompareDialog.svelte index 6ee8e36..3aa3e36 100644 --- a/src/lib/components/CompareDialog.svelte +++ b/src/lib/components/CompareDialog.svelte @@ -216,7 +216,7 @@