Skip to content

Commit 4155991

Browse files
committed
🤖 fix: prevent Escape in image preview from canceling stream
When viewing an image preview (lightbox), pressing Escape should only close the preview dialog, not also interrupt the active AI stream. Added stopPropagation() on the Escape keydown event in the DialogContent to prevent it from bubbling to the global stream interrupt handler.
1 parent e9d5a93 commit 4155991

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/browser/components/tools/shared/ToolResultImages.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ export const ToolResultImages: React.FC<ToolResultImagesProps> = ({ result }) =>
118118
{/* Lightbox modal for full-size image viewing */}
119119
<Dialog open={selectedImage !== null} onOpenChange={() => setSelectedImage(null)}>
120120
<DialogContent
121+
onKeyDown={(e) => {
122+
// Prevent Escape from propagating to global handlers (stream interrupt)
123+
if (e.key === "Escape") {
124+
e.stopPropagation();
125+
}
126+
}}
121127
maxWidth="90vw"
122128
maxHeight="90vh"
123129
className="flex items-center justify-center bg-black/90 p-2"

0 commit comments

Comments
 (0)