Skip to content

1.0.0 build 32: switching language/mode/width no longer eats the code - #212

Merged
wangzhizhou merged 2 commits into
mainfrom
dev
Oct 29, 2026
Merged

wangzhizhou merged 2 commits into
mainfrom
dev

Conversation

@wangzhizhou

Copy link
Copy Markdown
Contributor

按用户报告的行为做的一批输入连续性改进(ADR-302,报告 221)。

问题

编码已出现候选框时,按 Shift / ⌥M / ⌥F 会立刻把编码和候选窗一起清掉,而 ⌥T/⌥P 是在候选窗内联反馈。根因:前三个在 ime-core 里主动 cancel()。

判断

  • ⌥F(全角)取消组合不合理:全角只影响之后提交的标点/数字,与当前编码无关。
  • ⌥M(模式)取消不合理但可理解:保留编码并按新模式重算更贴近「换个思路继续打」。
  • Shift 切英文丢字最刺眼:按 Shift 的动机通常是「这段想打英文」,应把字母留下。

改法

快捷键 新行为
Shift → 英文(组合中) 先把编码原样上屏(nihao → nihao),再切英文(宿主用已有 insertText,无 ABI 变更)
⌥M 模式 保留缓冲区,按新模式 recompute_with_commit(false) 重算候选,不自动上屏;无候选也保留编码
⌥F 全角 保留缓冲区
⌥T / ⌥P 不变

验证

  • core 新增 3 个单测(全角保留组合与候选 / 切模式保留缓冲并重算 / 新模式无候选保留编码且 Esc 仍可取消)
  • ime-ffi 的 candidates_expose_source_codes 改为先 Esc 再切模式(旧用例依赖了被删除的取消语义)
  • make verify PASS;make macos-offline-tests 56 文件 / 303 例 PASS
  • 构建号 31 → 32

装机后请复验

打字出候选 → 按 Shift(编码应原样上屏为 nihao)→ 再按 ⌥M / ⌥F(候选框与编码应保留)。

The third "HUD did not appear" turned out not to be a defect: after the
file-based switch and branch logging shipped in build 31, the user
retested and both the HUD and the candidate window behaved normally — the
earlier symptom came from a host process still running the previous
binary after a package swap.

Adds the check that catches this to the iterate-macos-ime closing list
(lsof must not report a deleted executable for the running host), records
the build-31 baseline on both machines, and notes why 30 was replaced.

Signed-off-by: wangzhizhou <824219521@qq.com>
Typing nihao and pressing Shift used to delete the code and the candidate
window, because toggle_english, toggle_width and set_mode all called
cancel() in the core, while the variant and punctuation switches only
wrote configuration and kept the composition.

Shift now commits the raw code (nihao stays nihao) before switching to
English, which matches why people press it; mode and width switches keep
the buffer, and mode re-converts under the new setting without auto
committing. Escape still cancels a buffer that has no candidates.

Three core tests cover it; the FFI source-code test now escapes before
changing mode instead of relying on the removed cancel. Build 32.

Signed-off-by: wangzhizhou <824219521@qq.com>
@wangzhizhou
wangzhizhou merged commit c9951fa into main Oct 29, 2026
4 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