Repository navigation
增加剪贴板覆盖取词:单次确认与默认关闭选项 - #5
Draft
Stellar-He wants to merge 1 commit into
Draft
Stellar-He wants to merge 1 commit into
Stellar-He wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
某些 Steam 文本窗口已能确认文本上下文,却不提供 UIA 选区接口,只能使用受保护的剪贴板回退。剪贴板中已有截图或私有格式、无法完整备份时,旧流程会报“当前应用暂时无法读取选区”。本 PR 细分失败原因,并在用户明确允许后提供覆盖取词兜底。
能通过 UIA 直接取得选区的应用仍不需要复制或备份剪贴板;因此截图占据剪贴板时,不同应用可能表现不同。新流程按文本接口能力判断,没有按 Steam 进程名强行复制。
行为与风险
AllowClipboardOverwrite(“取词优先,允许覆盖”)。开启前显示风险确认,保存后才生效;拒绝确认、确认框失败、取消或保存失败均不启用,旧配置缺失该字段时保持关闭。范围
基于已合并 Index PR #4 的当前
main(841c310720986964361190566f15ce1d0239c3d1)。只包含本轮覆盖流程、必要配置、界面、测试与说明;Index 实现、现有翻译源、托盘绘制及选区辅助程序保持不变。未夹带此前两处本地 Chromium 兼容补丁、用户配置、词典、运行日志、本机路径或密钥。本机已实测的安装版未被本次 PR 整理替换或重启。验证
本提交的 Windows CI 已全部通过,fork 的 push 构建也已通过。
Windows x64/.NET Framework 构建通过。
test-overwrite.ps1:模拟剪贴板覆盖失败分类、默认拒绝、完整备份优先、明确覆盖且不恢复、复制发送失败/无变化/空结果、有界轮询、源归属与序列号竞争、取消/失焦、并发复制、重叠操作、许可过期与不可重放、按钮取消/重复点击、配置默认关闭及确认/保存/回填/取消/失败回滚。原剪贴板流程、窗口手势、非文本上下文、翻译源与 Index/DeepL 模拟 HTTP、完整离线自测、真实选区辅助程序集成均通过;WPF 设置、覆盖浮层和风险确认框已离屏渲染检查。
原生剪贴板测试仅在独立 window station 和 desktop 的私有剪贴板内使用合成数据。覆盖未知格式默认零复制、明确允许后真实 TextBox.Copy 留下新文字,以及复制无变化时不返回旧文字;不通过读写用户剪贴板来“保存再恢复”实现隔离。
用户已反馈本机候选在 Steam 中实测正常。该反馈限于已试用场景,不代表所有 Steam 窗口或其他应用均已验证。此次 PR 本地测试未执行真实用户剪贴板的破坏性操作,也未重复联网翻译。
本地词典复用现存固定版本,未在本机执行下载脚本。CI 增加独立的覆盖确认与竞争回归步骤,原完整离线及私有窗口站测试继续运行。
限制
没有覆盖全部第三方剪贴板管理器、所有应用、不同 DPI、全部系统竞态或长时间稳定性。Windows 原生延迟渲染调用仍可能阻塞,轮询次数上限不是所有提供方的绝对执行时限保证;序列号与应用归属检查也不构成多格式剪贴板事务或任意第三方写入的来源证明。此 PR 保持草稿状态,不合并、不启用自动合并。