Skip to content

Fix Control UI CJK IME composition#86036

Closed
Zhaoqj2016 wants to merge 1 commit into
openclaw:mainfrom
Zhaoqj2016:fix-control-ui-ime-composition
Closed

Fix Control UI CJK IME composition#86036
Zhaoqj2016 wants to merge 1 commit into
openclaw:mainfrom
Zhaoqj2016:fix-control-ui-ime-composition

Conversation

@Zhaoqj2016

@Zhaoqj2016 Zhaoqj2016 commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • defer chat composer draft synchronization while browser IME composition is active
  • sync the committed composer value on compositionend
  • add a regression test for composing pinyin and committing Chinese text

Fixes #86035

Real behavior proof

  • Behavior or issue addressed: Control UI chat composer no longer overwrites the browser/macOS IME composition buffer while CJK text is being composed. The textarea now defers draft synchronization during composition and syncs the committed value on compositionend.
  • Real environment tested: Local OpenClaw gateway on macOS, OpenClaw 2026.5.22 (a374c3a) with this patch applied to the deployed Control UI bundle, Google Chrome, http://127.0.0.1:18790/chat, macOS Chinese/CJK input path.
  • Exact steps or command run after this patch: Opened http://127.0.0.1:18790/chat in Google Chrome via Computer Use, focused .agent-chat__composer-combobox > textarea, entered committed Chinese text in the chat composer, and confirmed the composer retained the Chinese text instead of raw pinyin. Also verified the running local gateway and deployed bundle from the terminal.
  • Evidence after fix: Browser evidence: a local screenshot captured with Computer Use/screencapture shows the OpenClaw Control UI composer containing 当前输入法验证:中文候选已提交到聊天输入框 at 127.0.0.1:18790/chat. Terminal live output from the same setup:
COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    86905  zqj   18u  IPv4 ... TCP 127.0.0.1:18790 (LISTEN)
node    86905  zqj   19u  IPv6 ... TCP [::1]:18790 (LISTEN)
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Date: Wed, 03 Jun 2026 03:26:35 GMT

index-BtIuF4zW.js
composerComposing true
compositionstart true
compositionend true
  • Observed result after fix: In the live Chrome Control UI, the chat composer kept the committed Chinese string 当前输入法验证:中文候选已提交到聊天输入框; the running bundle contains the composition guard state and both compositionstart/compositionend handlers, and /chat was served successfully by the local gateway.
  • What was not tested: I did not run a full multilingual matrix for Japanese and Korean IMEs; the code path is the same browser composition event handling used by CJK IMEs.

Test plan

  • corepack pnpm --dir ui exec vitest run --config vitest.config.ts src/ui/views/chat.test.ts
  • corepack pnpm --dir ui build

Notes

I also tried corepack pnpm --dir ui test -- ui/src/ui/views/chat.test.ts, but that script invocation ran the full UI suite instead of only the target file and hit unrelated local setup failures: missing Playwright browser binaries and path/import issues outside this change. The direct Vitest command above was used for the targeted test run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed. Reviewed June 7, 2026, 12:24 AM ET / 04:24 UTC.

Summary
The PR changes the Control UI chat composer to defer draft synchronization during IME composition, force-commit the final value on composition end, and add CJK composition regression tests.

PR surface: Source +28, Tests +60. Total +88 across 2 files.

Reproducibility: yes. with source-backed confidence rather than a rerun: the linked report gives concrete macOS/Chrome Chinese IME steps, and current main lacks the composition-specific guard this PR adds. I did not run a live IME session in this read-only pass.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair lane is needed; the PR has no actionable findings and should proceed through the existing automerge and required-check gates.

Security
Cleared: The diff only changes Control UI textarea event handling and adjacent tests, with no dependency, workflow, secret, package, or supply-chain surface added.

Review details

Best possible solution:

Land the focused composer composition guard with the added regression tests once required merge and CI gates are satisfied, and keep the separate IME resize-lag report on its own follow-up path.

Do we have a high-confidence way to reproduce the issue?

Yes, with source-backed confidence rather than a rerun: the linked report gives concrete macOS/Chrome Chinese IME steps, and current main lacks the composition-specific guard this PR adds. I did not run a live IME session in this read-only pass.

Is this the best way to solve the issue?

Yes. The fix is at the right textarea event boundary: defer host/slash synchronization while composition is active, then commit the final value once composition ends without changing the normal send/blur draft contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 9b1c0dac6877.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: The PR addresses a user-facing Control UI chat input regression that can make CJK IME typing unusable for affected users.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Sufficient (terminal): The PR body supplies after-fix live Control UI proof from macOS Chrome with a local gateway, committed Chinese text retained in the composer, and terminal output showing the composition guard in the running bundle.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies after-fix live Control UI proof from macOS Chrome with a local gateway, committed Chinese text retained in the composer, and terminal output showing the composition guard in the running bundle.
Evidence reviewed

PR surface:

Source +28, Tests +60. Total +88 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 31 3 +28
Tests 1 60 0 +60
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 91 3 +88

What I checked:

  • Current main composer behavior: Current main handles textarea input by resizing, updating the draft mirror, conditionally committing host draft for busy/slash-menu states, and updating slash-menu state; the textarea has keydown/input/blur/paste handlers but no compositionstart/compositionend handlers. (ui/src/ui/views/chat.ts:1936, 9b1c0dac6877)
  • PR composition guard: The PR adds composerComposing state, skips host/slash-menu synchronization while composition is active, and force-commits once on compositionend. (ui/src/ui/views/chat.ts:457, 6dca70915d9e)
  • Regression tests: The PR adds tests that assert draft changes are deferred during active composition and that composing text survives a stale host rerender before the final committed value is synced. (ui/src/ui/views/chat.test.ts:1650, 6dca70915d9e)
  • Adjacent draft behavior checked: Existing chat tests cover the normal local-draft policy: plain input stays local until send, active sends commit host draft, and unrelated rerenders preserve local input. (ui/src/ui/views/chat.test.ts:1426, 9b1c0dac6877)
  • Proof supplied: The PR body reports live macOS Chrome testing against the local Control UI gateway, with the composer retaining committed Chinese text and terminal output showing the served bundle contains composerComposing plus compositionstart/compositionend handlers. (6dca70915d9e)
  • CI annotations reviewed: Failed check annotations available through the GitHub API point at unrelated extension, architecture, and build lanes rather than the touched Control UI files, so they do not create a PR-line finding here. (6dca70915d9e)

Likely related people:

  • vincentkoc: Recent current-main history includes chat draft locality, composer controls, slash-menu rerender, and transcript render performance work in the same view file. (role: recent area contributor; confidence: high; commits: 61574eb50bd4, 6627b4fbdd31, bff66a3e4992; files: ui/src/ui/views/chat.ts, ui/src/ui/views/chat.test.ts)
  • steipete: Recent history shows Control UI source documentation and adjacent composer/attachment UI work touching the same chat view area. (role: recent area contributor; confidence: medium; commits: 12a56d4d46dd, d328a0d7a0da, a03a8d91f636; files: ui/src/ui/views/chat.ts, ui/src/ui/views/chat.test.ts)
  • BunsDev: Merged WebChat send/reconnect work recently touched the same renderChat surface and chat view tests, including queue and composer-adjacent behavior. (role: adjacent owner; confidence: medium; commits: 96635c7c27e3; files: ui/src/ui/views/chat.ts, ui/src/ui/views/chat.test.ts)
  • sallyom: Recent current-main history includes the chat composer clear-after-send fix in the same file, which is part of the draft synchronization surface this PR updates. (role: adjacent contributor; confidence: medium; commits: c1ce51546e5f; files: ui/src/ui/views/chat.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@omarshahine

Copy link
Copy Markdown
Contributor

Thanks for the PR. Before this can move forward, please add live proof from the affected surface, not just unit tests, mocked tests, or source inspection.

A useful proof update should include:

  • the exact build/SHA tested
  • the real environment used
  • the command, UI flow, channel flow, provider request, or other live path exercised
  • before/after symptom evidence where applicable
  • the observed result after the patch
  • any remaining proof gaps

Please redact secrets, tokens, phone numbers, and private message content from logs or screenshots.

@BingqingLyu

This comment was marked as spam.

@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 3, 2026
@Zhaoqj2016
Zhaoqj2016 force-pushed the fix-control-ui-ime-composition branch from a2215d9 to a14c7ff Compare June 5, 2026 09:38
@Zhaoqj2016

Copy link
Copy Markdown
Contributor Author

Updated the branch against current main and addressed the stale-draft rerender review request.

Changes in this update:

  • During IME composition, input now only resizes the textarea and updates the local draft mirror. It skips slash-menu updates, host draft commits, and requestUpdate, so a parent rerender with stale draft props cannot wipe the composing text.
  • On compositionend, the final committed value is force-committed once and slash-menu state is updated after composition has ended.
  • Added a regression test covering stale host rerender during active composition.

Verification:

  • corepack pnpm --dir ui exec vitest run --config vitest.config.ts src/ui/views/chat.test.ts
  • corepack pnpm --dir ui build

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 5, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper saw the passing review, but the PR needs another repair pass before merge.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=6dca70915d9e88bdb87be7cc83f28df7f9b992fb); current checks are failing: build-artifacts:FAILURE, check-lint:FAILURE, check-test-types:FAILURE, check-additional-extension-bundled:FAILURE, check-additional-runtime-topology-architecture:FAILURE
Action: repair worker queued. Run: https://github.com/openclaw/clawsweeper/actions/runs/27082594530
Model: gpt-5.5

I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow CI fix.

Automerge progress:

  • 2026-06-06 02:11:00 UTC review queued a14c7ff53278 (queued)
  • 2026-06-07 04:24:59 UTC review passed 6dca70915d9e (structured ClawSweeper verdict: pass (sha=6dca70915d9e88bdb87be7cc83f28df7f9b99...)

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label Jun 6, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Jun 6, 2026
@clawsweeper

clawsweeper Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - No automated repair is needed; the remaining action is ordinary maintainer review and merge gating for a small external PR with sufficient proof.; Cleared: The diff only changes Control UI chat input handling and adjacent tests; it does not touch dependencies, workflows, secrets, permissions, package metadata, or executable supply-chain surfaces. (sha=a14c7ff532789ac23d9b205f41a1644e679e80aa)

Why human review is needed:
This item has security-sensitive risk. ClawSweeper is pausing instead of making an autonomous change that could affect trust, credentials, permissions, or exposure.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If the security-sensitive detail still needs changes, describe the safe path or push the fix, then comment @clawsweeper automerge. If the risk should not be automated, keep the PR paused for manual review or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 6, 2026
@Zhaoqj2016
Zhaoqj2016 force-pushed the fix-control-ui-ime-composition branch from a14c7ff to 6dca709 Compare June 7, 2026 04:16
@Zhaoqj2016

Copy link
Copy Markdown
Contributor Author

Addressed the latest ClawSweeper request about duplicate textarea resize work.

Change:

  • handleInput now calls adjustTextareaHeight only for the composing early-return path.
  • Non-composition input falls through to syncComposerValue, which remains the single owner of normal input resizing.
  • IME composition behavior and compositionend force-commit behavior are unchanged.

Verification:

  • node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts
  • git diff --check

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:human-review Needs maintainer review before ClawSweeper can continue labels Jun 7, 2026
@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper 🐠 reef update

Thanks for the work on this. ClawSweeper could not push to this branch with the permissions available, so it opened a narrow replacement PR to keep the fix swimming forward without losing the contributor trail. not your fault, just GitHub branch-permission tides.

Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
Replacement PR: #91087
Why close: this run explicitly closes the superseded source PR after the credited replacement PR is open, so review continues in one place.
This source PR is being closed only under the explicit source-close setting for this ClawSweeper run.
Attribution is preserved in the replacement PR body and release-note trail.
Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against e1e7ee5.

@clawsweeper clawsweeper Bot closed this Jun 7, 2026
@Zhaoqj2016

Copy link
Copy Markdown
Contributor Author

CI follow-up after the latest run.

The current required proof/dependency checks for this PR are green:

  • Real behavior proof: pass
  • dependency-guard: pass

There are still several failing jobs in workflow run 27082428561, but the concrete failure I could inspect appears unrelated to this Control UI IME patch. For example, check-test-types fails in extensions/memory-core/doctor-contract-api.test.ts because a test object has config: unknown where OpenClawConfig is expected:

extensions/memory-core/doctor-contract-api.test.ts(...): error TS2345:
Argument of type `{ config: unknown; ... }` is not assignable to parameter of type `{ config: OpenClawConfig; ... }`.

This PR only changes:

  • ui/src/ui/views/chat.ts
  • ui/src/ui/views/chat.test.ts

Local validation for the IME change remains green:

  • node scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts
  • git diff --check

Could a maintainer rerun the failed workflow or confirm whether the branch should be rebased after the unrelated memory-core type-check issue is fixed on main?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Control UI chat composer breaks CJK IME composition

5 participants