Confirm a composed character with Enter in the web app's text fields, instead of saving or moving on - #576
Open
kevin9327 wants to merge 1 commit into
Open
Confirm a composed character with Enter in the web app's text fields, instead of saving or moving on#576kevin9327 wants to merge 1 commit into
kevin9327 wants to merge 1 commit into
Conversation
… instead of saving or moving on Japanese, Chinese and Korean are typed through an input method, and Enter is how the character being built is confirmed. That press is still a keydown with `key === "Enter"`: Chromium marks it `isComposing`, and WebKit sends it after `compositionend` with key code 229. Three fields acted on it with the text still unconfirmed: - a coworker's name or title, edited in place, was saved; - the new-coworker wizard moved on to its next step. Its handler runs ahead of the questionnaire primitive and prevents default, which also skipped the primitive's own `isComposing || keyCode === 229` check; - a boundary rule was saved into the policy in force. The chat composer already skips this Enter through `prompt-area`. The two checks now live in one helper, `isComposing`, and each of the three handlers asks it. An ordinary Enter acts as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 16, 2026 10:35
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Japanese, Chinese and Korean are typed through an input method (IME), and Enter is how the character being built is confirmed. That press is still a
keydownwithkey === "Enter":isComposing: true;compositionend, soisComposingis already false, but withkeyCode === 229.Three fields in the web app act on Enter without checking either one, so they act on text the person has not finished typing:
EditableTextIteminagent-dialog.tsx)create-agent-dialog.tsx)admin/boundaries.tsx)contains(element.name, "送信")The libraries under the app already skip this Enter:
prompt-area, which draws the chat composer, checksisComposing.onKeyDownstarts withif (n.defaultPrevented || n.nativeEvent.isComposing || n.keyCode === 229 || …) return;. The wizard's own handler runs ahead of the primitive and callspreventDefault(), so the wizard also skipped the primitive's check.Both checks now live in one helper,
app/src/lib/composing.ts→isComposing(event), and each of the three handlers asks it. An ordinary Enter behaves exactly as before. The Role textarea has no Enter handler and is unchanged.This is the same fix as #507, which was closed only because it was in
desktop/. These three are in the web app.Where it runs
Boundary and audit
Changelog
CHANGELOG.mdunderUnreleased.Proof
New
app/tests/composing-enter.test.tsx. It draws each real component:AgentDialog,CreateAgentDialog, and the Boundaries route's component inside a one-route router. It types withuserEvent, then fires both confirming shapes at the field:{ key: "Enter", isComposing: true }, then{ key: "Enter", keyCode: 229 }.fetchrecords every write. After that it presses an ordinary Enter to pin that the field still acts, once.On
main(only the test file added):Every write came from a confirming Enter. Each shape triggers it on its own, which is why there are two.
With the fix:
bun test app/tests/composing-enter.test.tsx: 3 pass, 0 fail. Each case covers both shapes (both halves ofisComposing) and an ordinary Enter.bun test app/: 853 pass, 29 fail. Onmainit is 850 pass with the same 29 failures, all from this Windows machine:serve.test.tsport and websocket cases, Windows path separators, and a relative-time assertion reading a Korean locale.bun run typecheck(app, server, worker): exit 0.bunx biome checkon the changed files: clean.This PR adds its line at the top of
## Unreleased, the same place other open PRs add theirs, so the changelog may conflict. I'm happy to rebase.🤖 Generated with Claude Code