@devries-cameron20 / t3code-1 / commits / 91a76cf5a6
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): voice dictionary keeps the draft when Enter confirms an IME candidate (#35467)

Julius Marminge committed Nov 12, 2026 at 10:58 UTC 91a76cf5a6a406343f88727d26570914528c5a96
2 files changed +29
apps/web/src/components/settings/VoiceSettingsPanel.browser.test.tsx
+27
@@ -599,6 +599,33 @@ it("keeps punctuation in a saved dictionary term and its alias", async () => {
599 ]);
600 });
601
602 +it("keeps a dictionary term and alias draft on the Enter that confirms an IME candidate", async () => {
603 + const previous = getClientSettings();
604 + using cleanup = new DisposableStack();
605 + cleanup.defer(() => __setClientSettingsForTests(previous));
606 + __setClientSettingsForTests({
607 + ...previous,
608 + speechCustomWords: [{ term: "日本語", aliases: [] }],
609 + });
610 + await using screen = await render(
611 + <SettingsScopeProvider search={{}} onChange={() => {}}>
612 + <VoiceSettingsPanel />
613 + </SettingsScopeProvider>,
614 + );
615 + const composingEnter = () =>
616 + new KeyboardEvent("keydown", { key: "Enter", isComposing: true, bubbles: true });
617 + const term = screen.getByRole("textbox", { name: "Add a word or phrase to the dictionary" });
618 + await userEvent.fill(term, "にほん");
619 + term.element().dispatchEvent(composingEnter());
620 + await expect.element(term).toHaveValue("にほん");
621 + await userEvent.click(screen.getByRole("button", { name: "Add an alias for 日本語" }));
622 + const alias = screen.getByRole("textbox", { name: "Alias for 日本語" });
623 + await userEvent.fill(alias, "にほん");
624 + alias.element().dispatchEvent(composingEnter());
625 + expect(getClientSettings().speechCustomWords).toEqual([{ term: "日本語", aliases: [] }]);
626 + await expect.element(alias).toHaveValue("にほん");
627 +});
628 +
629 it("records from the first connected microphone in the saved order", async () => {
630 const previous = getClientSettings();
631 using cleanup = new DisposableStack();
apps/web/src/components/settings/VoiceSettingsPanel.tsx
+2
@@ -391,6 +391,7 @@ function DictionaryEditor(props: {
391 aria-label={`Add a word or phrase to the ${label}`}
392 onChange={(event) => setTermDraft(event.target.value)}
393 onKeyDown={(event) => {
394 + if (event.nativeEvent.isComposing || event.keyCode === 229) return;
395 if (event.key !== "Enter" || event.shiftKey) return;
396 event.preventDefault();
397 addTerm();
@@ -427,6 +428,7 @@ function DictionaryEditor(props: {
428 onChange={(event) => setAliasDraft({ term, value: event.target.value })}
429 onBlur={() => setAliasDraft(null)}
430 onKeyDown={(event) => {
431 + if (event.nativeEvent.isComposing || event.keyCode === 229) return;
432 if (event.key === "Escape") setAliasDraft(null);
433 if (event.key !== "Enter") return;
434 event.preventDefault();