The best way to control Claude Code, Codex and more from any computer or phone
fix(desktop): Escape during IME composition no longer cancels a preview annotation (#35645)
Julius Marminge committed
Nov 12, 2026 at 14:52 UTC
a6b8f714439b47812cf5bce18ecf572caa5b1462
2 files changed
+22
-1
apps/desktop/src/preview/PickPreload.test.ts
+21
@@ -84,3 +84,24 @@ it("keeps comment keystrokes away from the page's capture-phase shortcuts", () =
84
expect(pageShortcut).not.toHaveBeenCalled();
85
expect(space.defaultPrevented).toBe(false);
86
});
87
+
88
+it("keeps the annotation when Escape dismisses an IME candidate in the comment", () => {
89
+ const shadowRoot = startAnnotation();
90
+ const comment = shadowRoot.querySelector("textarea");
91
+ if (!comment) throw new Error("comment textarea not found");
92
+
93
+ comment.value = "draft";
94
+ comment.focus();
95
+ comment.dispatchEvent(
96
+ new KeyboardEvent("keydown", {
97
+ key: "Escape",
98
+ isComposing: true,
99
+ bubbles: true,
100
+ cancelable: true,
101
+ composed: true,
102
+ }),
103
+ );
104
+
105
+ expect(shadowRoot.host.isConnected).toBe(true);
106
+ expect(comment.value).toBe("draft");
107
+});
apps/desktop/src/preview/PickPreload.ts
+1
-1
@@ -1677,7 +1677,7 @@ function startAnnotation(
1677
return;
1678
}
1679
}
1680
- if (event.key === "Escape") {
1680
+ if (event.key === "Escape" && !event.isComposing) {
1681
event.preventDefault();
1682
event.stopPropagation();
1683
teardown(true);