Skip to content

fix: shifted punctuation and the wubi-code hint (ADR-337) - #274

Merged
wangzhizhou merged 1 commit into
mainfrom
dev
Nov 12, 2026
Merged

wangzhizhou merged 1 commit into
mainfrom
dev

Conversation

@wangzhizhou

Copy link
Copy Markdown
Contributor

背景

用户在候选 3e428b7 上的实机反馈:

  1. 中文状态下打 12:30 得到 12;30。
  2. 混输下用拼音打出字词后,光标旁没有出现五笔码提示。

改动

  • Shift 标点:宿主新增 typedScalar,用 characters(byApplyingModifiers:) 按键码 + Shift 计算本次按键的字符,不再直接用 charactersIgnoringModifiers。: ? < 等到达核心时就是它们自己。
  • 五笔码提示:判定数据改为上屏前取的本页候选快照,删除跨调用状态 shownCandidates;提示路径每个分支在诊断开关打开时写日志(hint skip=… / hint show=…)。
  • 真机样本新增 3 条(数字后冒号、Shift 问号、Shift 冒号),共 26 条。

需要说明的不确定性

  • 提示不出现的根因没有定位:探针复现属实,但同一判定逻辑用真实数据在进程内重放是通过的。本次改动去掉了最可疑的状态并让失败可观测,不保证已修好;装机后以诊断日志为准。
  • 冒号问题的直接机制(事件的 charactersIgnoringModifiers 为何是未加 Shift 的字符)没有在真机上单独验证,修复方式对两种情况都成立。

验证

  • make verify PASS
  • make macos-offline-tests:62 文件 / 328 例 PASS(test-controller-menu.py 新增 6 条 Shift 取字符断言)
  • 预览冒烟 PASS;build.sh --strict PASS
  • 未装机:两项修复都待新包实机确认。

…-code hint (ADR-337)

Typing 12:30 produced 12;30 because the core received ; instead of :. The host now computes the typed character from the key code with Shift applied. The wubi-code hint did not appear on a real device; it now judges against a snapshot taken before the commit and logs every branch to the HUD diagnostic log, since the root cause is not yet known.

Signed-off-by: wangzhizhou <824219521@qq.com>
@wangzhizhou
wangzhizhou merged commit 2610d1f into main Nov 12, 2026
6 of 7 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.

1 participant