@devries-cameron20 / t3code Mirror · read-only / commits / 729687e23c
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 19:45 UTC

fix(web): device tab rename no longer saves on the Enter that confirms an IME candidate (#35468)

Julius Marminge committed Nov 12, 2026 at 10:59 UTC 729687e23c67bf96256fb4915f1847122307d46a
2 files changed +40
apps/web/src/components/RightPanelTabs.browser.test.tsx
+39
@@ -2,6 +2,7 @@ import "~/index.css";
2
3 import { EnvironmentId } from "@t3tools/contracts";
4 import { describe, expect, it, vi } from "vite-plus/test";
5 +import { userEvent } from "vite-plus/test/browser";
6
7 import { InputGroup, InputGroupAddon, InputGroupInput } from "~/components/ui/input-group";
8 import type { RightPanelSurface } from "~/rightPanelStore";
@@ -249,3 +250,41 @@ describe("right panel thumb buttons", () => {
250 expect(actions).toEqual(["back", "forward", "back"]);
251 });
252 });
253 +
254 +const DEVICE_SURFACE: RightPanelSurface = {
255 + id: "device:host:phone",
256 + kind: "device",
257 + target: { hostId: "host", deviceId: "phone", platform: "ios", name: "Phone" },
258 +};
259 +
260 +describe("device tab rename", () => {
261 + it("keeps the editor open on an Enter that confirms an IME candidate", async () => {
262 + const onRenameDevice = vi.fn();
263 + const props = panel(DEVICE_SURFACE).props as RightPanelTabsProps;
264 + await using screen = await render(
265 + <RightPanelTabs {...props} surfaces={[DEVICE_SURFACE]} onRenameDevice={onRenameDevice}>
266 + {null}
267 + </RightPanelTabs>,
268 + );
269 + await userEvent.dblClick(screen.getByRole("button", { name: "Phone", exact: true }));
270 + const input = screen.getByRole("textbox", { name: "Device tab name" });
271 + await userEvent.fill(input, "にほん");
272 +
273 + for (const shape of [
274 + { isComposing: true, keyCode: 13 },
275 + { isComposing: false, keyCode: 229 },
276 + ]) {
277 + input
278 + .element()
279 + .dispatchEvent(
280 + new KeyboardEvent("keydown", { key: "Enter", bubbles: true, cancelable: true, ...shape }),
281 + );
282 + }
283 +
284 + await expect.element(input).toHaveFocus();
285 + expect(onRenameDevice).not.toHaveBeenCalled();
286 + await userEvent.fill(input, "日本語");
287 + await userEvent.keyboard("{Enter}");
288 + expect(onRenameDevice).toHaveBeenCalledExactlyOnceWith(DEVICE_SURFACE.id, "日本語");
289 + });
290 +});
apps/web/src/components/RightPanelTabs.tsx
+1
@@ -965,6 +965,7 @@ function RightPanelTab(
965 onBlur={(event) => onFinishRename(surface.id, event.currentTarget.value)}
966 onKeyDown={(event) => {
967 event.stopPropagation();
968 + if (event.nativeEvent.isComposing || event.keyCode === 229) return;
969 if (event.key === "Enter") event.currentTarget.blur();
970 if (event.key === "Escape") {
971 event.currentTarget.value = title;