Skip to content

fix(browser): restore IME input and editing keys - #970

Merged
liukewia merged 1 commit into
TencentCloud:developfrom
fabianxagent:feature/browser-ime-keyboard
Oct 21, 2026
Merged

liukewia merged 1 commit into
TencentCloud:developfrom
fabianxagent:feature/browser-ime-keyboard

Conversation

@fabianxagent

@fabianxagent fabianxagent commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Typing Chinese in the browser workbench currently sends the individual Pinyin keys to the remote page without opening the local IME. Backspace, Delete and navigation keys are ignored by the backend, and preview frames wait an additional 250 ms after each capture.

  • Focus a real text control in the shared browser viewer so the local IME can compose normally. Send only committed text, including whole pasted strings, through CDP Input.insertText; avoid duplicate commits around compositionend.
  • Forward editing keys and modifiers with matching key-down/key-up events. Dispatch Enter as a real keypress and support both Ctrl+A and Cmd+A across client/server platforms. Remove the duplicate page-level keyboard handlers so address-bar input stays local.
  • Target 12 preview frames per second, accounting for capture time, while polling session/tab metadata once per second.

The IME candidate window stays anchored near the viewer's top-left. Tracking the remote text caret is outside this change. The stream continues to use JPEG polling; the frame-rate target depends on capture and network latency.

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Visual verification

Screenshot from an isolated Octop instance built from dfe5d616, using the actual workbench → WebSocket → remote Chromium path:

  1. Paste 中文输入 abcXYZ into the remote field.
  2. Press Backspace, Left, Delete, Backspace, then Enter.
  3. The remote page shows and submits 中文输入 abc, as captured below. Cmd+A followed by Chinese replacement and Enter was also verified.

Remote workbench after Unicode paste, editing keys and Enter submission

This screenshot comes from automated interaction with the running product. It does not show or claim a fresh manual test of the native macOS IME candidate popup. The reporter previously confirmed that popup in the Chrome-installed Octop app; composition event ordering and duplicate-commit prevention are covered by the regression tests.

Test plan

Validated on macOS against develop at 6055fddb (2026-10-21). The shared send_json / is_connected stream interface, Bridge support and upstream browser-page changes are preserved.

  • UV_NO_SYNC=1 make all PYTEST_JOBS=4 — passed, including Ruff, mypy and 5,091 tests passed / 35 skipped.
  • cd dashboard && npm test -- src/hooks/useBrowserKeyboard.test.tsx src/hooks/useBrowserCanvasInteraction.test.ts src/hooks/useCanvasRemotePointer.test.ts — 15 passed.
  • cd dashboard && npm run build — passed, including TypeScript checking.
  • cd dashboard && npm run format:check — passed.
  • Running-workbench check — Unicode paste, Backspace, Delete, arrow navigation, Cmd+A replacement and Enter submission passed.
  • Full-dashboard tests and ESLint are green — see the baseline findings below.
  • All GitHub CI workflows passed — the current run requires maintainer approval before its jobs can run.
Full-dashboard findings and upstream comparison

npm test reported 1,402 passed / 18 failed, with 10 failing files (including three suites that fail during collection). Re-running those 10 files with --maxWorkers=4 gave 32 passed / 7 failed on this branch and 31 passed / 8 failed in a clean git archive of 6055fddb, using the same installed dependencies.

The stable failures reproduced upstream concern PDF/skill-preview collection (DOMMatrix), missing mock exports in knowledge-base and chat-input tests, and the published-expert API expectation. The runs also contain timing-sensitive failures: the AuthGuard navigation assertion failed in the grouped PR runs but passed in isolated runs on both trees; channel tests timed out in the upstream comparison. The original grouped run also failed memory/history tests that passed in the reduced rerun. These results are disclosed rather than treated as a green full-dashboard suite.

npm run lint reports 2 errors, both reproduced against the pristine upstream files: the unused DEFAULT_CHANNEL_DISPLAY_CONFIG import in pages/Agent/Channels/components/constants.test.ts, and a redundant Boolean call in pages/Chat/hooks/chatStore.ts. Neither file is changed by this PR. The browser files have no ESLint errors.

Scope and review

The agreed scope is browser text input, editing keys and preview responsiveness. The candidate popup remains near the viewer's top-left; remote-caret tracking is outside this fix. Review covered both composition event orders, candidate-confirm Enter, paste, modifiers, key release, read-only mode and address-bar isolation. Existing stream error handling and shared callbacks are retained. No new dependencies or unrelated refactors were added.

PR Checklist

  • 📸 UI screenshot / feature demonstration provided
  • 🧪 Regression tests added and passing
  • ✅ All CI workflows passing — awaiting maintainer approval
  • 🤖 Requirements aligned with the reporter
  • 🎯 Minimal change scope and clear structure
  • 📝 Optimization, edge cases and redundant handlers reviewed
  • Updated CHANGELOG.md
  • Setup / public API documentation reviewed; no additional changes needed

@jubaoliang

Copy link
Copy Markdown
Collaborator

对照最新 develop 评估:远程浏览器 IME / 编辑键不可用,中文输入是真缺口,值得合。

现在冲突不止 CHANGELOG,还有 dashboard/src/locales/{en,zh}.json 和 RemoteBrowser/index.tsx。请 rebase 最新 develop,保留 CDP insertText / 编辑键,不要回退近期的浏览器页改动。

@fabianxagent

Copy link
Copy Markdown
Contributor Author

@jubaoliang 已按此前建议重新 rebase 到最新 develop(f043a38c),当前提交为 1b7ee760,GitHub 已显示无冲突。

这次解决了 CHANGELOG.md 和 browser/stream.py 的冲突,保留上游本地 WebSocket / Bridge 共用的回调接口及近期页面、文案改动,同时保留 CDP Input.insertText、编辑键和预览刷新修复;帧率回归测试已适配新接口。

验证结果:浏览器后端 44 项、前端 15 项测试通过,生产构建、Ruff、mypy 和格式检查通过。完整后端测试为 4,524 passed / 18 skipped / 2 failed;两项失败均为依赖 Linux /proc 的 FnOS 测试在 macOS 上运行造成,已在纯上游 f043a38c 副本复现。全仓库前端 lint 的 3 个既有错误也已对照上游复现,详细结果已更新到 PR 的 Test plan。

本次 CI 仍显示 action_required、等待维护者批准。麻烦批准本次 CI 运行,并在 Linux / Windows 检查通过后继续审查合入。

@fabianxagent
fabianxagent force-pushed the feature/browser-ime-keyboard branch from 1b7ee76 to dfe5d61 Compare October 21, 2026 03:36
@fabianxagent

Copy link
Copy Markdown
Contributor Author

@jubaoliang 已重新 rebase 到最新 develop(6055fddb),当前提交 dfe5d616,GitHub 已确认无冲突。本次仅需解决 CHANGELOG 冲突,原有浏览器输入修复及上游页面、Bridge 接口均保留。

已按新增的 PR 规范补充实际工作台截图、操作步骤和检查清单。make all 全部通过(5,091 passed / 35 skipped),浏览器前端 15 项回归测试、生产构建和格式检查通过;中文粘贴、退格、Delete、方向键、Cmd+A 和回车已在实际工作台验证。截图属于自动化操作验证,原生输入法候选框的人工确认记录与本次验证范围已分开说明。

全仓库前端测试和 ESLint 的失败及纯上游对照结果也已写入描述,没有将其标记为全绿。

本次 CI 仍为 action_required,需要维护者批准才能启动。麻烦批准这次 CI,并在 Linux / Windows 检查通过后继续审查合入,谢谢。

@liukewia
liukewia merged commit 18fcda4 into TencentCloud:develop Oct 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants