Skip to content

fix(macos): 修复中文组合输入层透出原文字的重影 - #1010

Merged
1lck merged 2 commits into
previewfrom
fix/editor-input-ghosting
Oct 1, 2026
Merged

1lck merged 2 commits into
previewfrom
fix/editor-input-ghosting

Conversation

@1lck

@1lck 1lck commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

macOS 中文候选输入时,Monaco 的临时输入框直接使用只有约 3.5% 不透明度的当前行高亮色,导致下方已渲染文字透出,形成整行重影。本次为组合输入层提供不透明底色,并在其上叠加编辑器背景和当前行高亮;输入结束后恢复普通输入样式。

  • 样式只由 macOS 前端加载,适用于同一工作台中的主编辑器与分屏。
  • 明暗主题保留主题配色;背景图模式仅在候选输入的临时矩形内使用实体底色。
  • 保留 Monaco 原有输入法、文本编辑和候选事件处理,不修改上游依赖。
  • 新增真实 Monaco 组合事件回归,覆盖明暗主题、背景图开关和组合输入结束后的样式恢复,接入现有 WebKit 工作台测试入口。
  • 测试从生产入口加载样式,避免测试专用 CSS 导入掩盖生产入口遗漏。
  • 同步更新 Agent Note、跨平台功能矩阵和生成的 Markdown/CSV;macOS 实机验证状态保持 pending。

验证:

  • bun macos/EditorFrontend/build.ts 与 bun macos/Experiments/Monaco/build.ts frontend/editor/node_modules/monaco-editor --workbench-tests 成功。
  • Linux Chromium + Monaco 0.55.1 的四项受控组合事件测试通过,最慢约 45ms;移除修复样式后四项均因输入层透明而失败。已生成逐项 HTML/JUnit 报告。
  • 测试稳定性、运行时 bundle 只读、功能矩阵及变更门禁、Agent Notes、服务边界、Windows 边界检查通过。

验证限制:当前机器是 Linux,未运行 macOS AppKit/WebKit 原生宿主或系统输入法。仍需在 macOS 使用系统拼音/微信输入法验证候选输入、候选删减、上屏后删除、撤销和分屏;本 PR 不声称已实机复现并消除全部删除重影。

按仓库 lithe-code-review Skill 完成自审:修正上述测试入口覆盖缺口,最终未发现需要阻塞合并的问题。原生输入法与 WebKit 绘制验证仍保留为信息缺口,不以 Chromium 结果替代。

@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Oct 1, 2026
@1lck
1lck merged commit 5f5bbca into preview Oct 1, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant