Skip to content

Commit 295745f

Browse files
authored
🤖 fix: prevent Escape in image preview from canceling stream (#1221)
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. --- _Generated with `mux` • Model: `mux-gateway:anthropic/claude-opus-4-5` • Thinking: `high`_
1 parent 6dea256 commit 295745f

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)