Skip to content

fix(terminal): preserve touch input while dragging selection handles - #341

Merged
shihuili1218 merged 2 commits into
mainfrom
fix/android-selection-handle-context-menu
Nov 14, 2026
Merged

shihuili1218 merged 2 commits into
mainfrom
fix/android-selection-handle-context-menu

Conversation

@shihuili1218

Copy link
Copy Markdown
Collaborator

旧版 Android WebView 在拖动原生选区手柄时不会发送新的 DOM pointerdown,却可能把后续 contextmenu 标记为 mouse。现有判断让这个标记覆盖此前记录的触摸来源,导致 RSSH 自定义菜单或右键复制/粘贴动作介入选字。

保留最近一次真实 touch/pen 输入,直到实际鼠标按下或键盘输入切换来源;仅收到合成的 mouse contextmenu 不再覆盖触摸状态。系统选字手柄及“复制/粘贴/打开 Chrome”等原生工具条继续保留,Tab 长按菜单独立保留。

对应上游问题:Chromium #41487195。Chromium 的修复提交也确认了原生手柄合成菜单的 pointerType 问题;此处兼容尚未包含该修复的 WebView。

入口影响:

  • 桌面 GUI:鼠标右键和键盘菜单入口保持可用;触屏/笔选字延续原生行为。
  • 移动 GUI:连续调整选区时不误弹 RSSH 菜单,也不触发右键复制/粘贴动作;外接鼠标和键盘仍可切换输入来源。
  • CLI:不涉及,纯前端输入判断。
  • Headless / JetBrains:共用前端逻辑,无新增后端接口。

验证:

  • 新增 7 项回归测试,修复前失败、修复后通过,覆盖连续拖动、缺失/null/false 的 sourceCapabilities、三种终端右键设置,以及真实鼠标和键盘切换。
  • npm test:123 个文件、1422 项测试通过。
  • npm run build、git diff --check 通过。
  • 完整前端和真实 Chromium/xterm(仅模拟 Tauri IPC)重放事件序列:修复前会出现 RSSH DOM 菜单并清空选区;修复后 21 个场景通过,选区保留,鼠标/键盘和 Tab 菜单仍可用。

浏览器验证重放的是已知的 WebView 事件序列,未模拟 Android 原生蓝色手柄或系统工具条。当前环境缺少 Rust/Cargo,未完成原生客户端启动及 Android 真机验证。

Copilot AI balanced review requested due to automatic review settings November 14, 2026 04:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T04:52:59.804563Z a792b5e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shihuili1218
shihuili1218 merged commit 29a9122 into main Nov 14, 2026
7 of 8 checks passed
@shihuili1218
shihuili1218 deleted the fix/android-selection-handle-context-menu branch November 14, 2026 06:40
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.

2 participants