# Theme editor IME Escape proof

Environment: macOS 26.6.2, Apple silicon; headed Google Chrome for Testing 156.0.8078.4; 1400×650 page viewport, dark appearance. Recordings show the 1400×650 browser viewport receiving native macOS keystrokes. Native candidate screenshots are cropped from the 1440×900 desktop to the app region (origin 0,120; 1400×647 crop). The operating-system candidate popup is visible in those stills, rather than the browser viewport recording. Each commit runs its own real server and Vite app against a fresh, isolated database. No production data is copied. A synthetic project named demo is added through the app CLI.

Base: 8261b23226ce96fac30221c16ee9b05933a6f367.
Head: 1a516b1a4d62f344d7a2b0a2004c623bf8f9bad2.

The driver uses Playwright for UI navigation and macOS System Events physical key codes for the native IME interaction. It selects Japanese–Romaji Hiragana with Carbon TIS APIs, ensures Hiragana mode with the native Kana key, types k/a/n/a, checks that the page received a composition update containing かな, captures the native candidate window, then sends the physical Escape key. A capture is retained only after two browser screenshots 500 ms apart are byte-identical. Browser video includes the same scripted native interactions on each commit.

For each native case, open Settings → Appearance → Create theme and enter Aurora. Focus (1) Theme name; (2) Theme name after enabling Inspect app colors; (3) Custom CSS after expanding it and entering /* unsaved CSS */; (4) Accent picker hex after changing it to #e11d48. Type kana with Japanese–Romaji and press Escape once. Retain the resulting app state. Finish any remaining marked text with Return and switch to U.S. before the next case.

Repeat from fresh editors on the U.S. layout with ordinary Escape. The controls should close the editor, end inspection while keeping the editor, disable CSS Tab indentation while keeping the editor, and close the picker while reverting Accent to its dark-theme starting value #346bf1.

Finally, replay key=Escape, keyCode=229, isComposing=false into the focused CSS and picker fields. These last two cases are explicitly synthetic browser-event replays of the Safari-shaped event, not native Safari evidence.

Input source setting: initially selected U.S.; temporarily selected Japanese–Romaji Hiragana; restored U.S. afterward. The original enabled-source list is restored as well.

## Setup

Use separate base and head checkouts with vp i in each. Set MAC_WORK to a private scratch folder containing those checkouts as base/ and head/. For each side, choose a free loopback web port and write it to $MAC_WORK/<side>-port. Start the checkout's own runner:

    T3CODE_DEV_SEED=0 node scripts/scenarios/start-app.ts web "$MAC_WORK/home-<side>" 127.0.0.1 <port>

Add synthetic state through the CLI:

    node apps/server/src/bin.ts project add "$MAC_WORK/<side>" --title demo --base-dir "$MAC_WORK/home-<side>"

Compile input-source.swift with swiftc, placing the executable at $MAC_WORK/input-source. Enable the Japanese–Romaji parent input method before selecting its Hiragana mode. The driver reads only each fresh server's reusable dev credential to sign its own browser context in. Install Playwright Chromium under $MAC_WORK/browsers and run:

    PLAYWRIGHT_BROWSERS_PATH="$MAC_WORK/browsers" node native-driver.mjs <base|head>

The additional one-test scenario uses the repository's scenarios:prove runner on Linux Chromium and replays the exact composing event. It is supplemental to the native Mac proof.
