Skip to content

fix(selection): 完整保留选区原文并安全回填原控件 - #1506

Merged
appergb merged 11 commits into
betafrom
appergb/delivery-p4-selection-originals
Nov 27, 2026
Merged

appergb merged 11 commits into
betafrom
appergb/delivery-p4-selection-originals

Conversation

@appergb

@appergb appergb commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

摘要

对应 NextTodo #8:完整保留选区原文并安全回填原控件。长选区从原生捕获、历史到兼容渠道/Omni 文字请求保留全文和边界空白;处理中切换输入框时,不把结果写到另一个控件。

基线为 beta 401b5e5999d0fb80bb0c90a6e15afd35aa2e62c2,本 PR 精确 head 为 3b973b222cf688ae6faf13fc58bfc3e19c07e977。范围仅四个后端提交与两条 GPT-6.2 Sol 历史 UI 提交,六条相对已审候选的 patch-id / range-diff 全部等价。

修复 / 新增 / 改进

  • Windows 显式选区读取与复核使用完整原文;选区请求使用专用无截断信封,渠道容量不足时明确失败并保留原文,不以删减文本重试。
  • 处理前先保存独立原文历史,再复制原文一次。成功通过原生 API 写入冻结原控件,不模拟粘贴或二次写剪贴板;失败结果复制须仍持有原文复制时的 revision,不能覆盖用户后续复制的内容。
  • macOS 拟写对象与回读对象直接来自冻结的原 AX 控件/窗口;核验对象身份、安全门、选区与完整原文。写入已提交但无法确认时保持 OutcomeUnknown 和历史,不重新开放确认重试。
  • Core 以每次会话独有的撤销标记控制宿主锁内准入,避免取消 A 后迟到的 A 捕获清掉 B;缺失或未准备好的目标不能产生原文保护副作用。
  • 历史支持 selection_polish、selection_voice_edit 两类来源的单条和批量原文取回。复制直接读取 rawTranscript,保留列表顺序及原始空白,原文不与结果或摘要混用。

兼容

  • 保留 P3 菜单拥有者、两个热键来源及 Windows MTA owner 入口;菜单身份与选区写入校验各自保持原有作用域。
  • 原文与结果沿用现有历史字段,旧格式继续读取;通用上下文预算和实际 IPC 协议未改。iOS patch 和 Harmony audit 无需刷新。
  • 新的 Core capture 方法提供默认兼容实现;共享注册表的原子准入保证由 Tauri 覆盖实现提供,不能据默认方法推断其他宿主具有相同证明。
  • 本 PR 不包含 P5/P6、网页采集或 focus/tab 连续性实现,也不修改构建流程或减少 CI 门禁。

测试计划

  • 精确 head 的四项静态 Node 契约:历史原文、P3 菜单宿主、skip-auto-style UI、shared backend wire。
  • Harmony audit --check;隔离归档 Core 的 iOS patch check/apply;261 个 canonical Core 源文件校验未变。
  • 六提交 patch-id / range-diff 等价和 git diff --check。
  • 本 PR 现有自动 CI 的 macOS/Windows 宿主类型与运行门禁,Core selection/history、native binding、取消准入及 UI 双来源定向回归。
  • Dev 包验证真实长选区、同应用不同控件及 A→B→A、成功/失败 clipboard revision、未知写入不重发、原文/结果取回和多语言缩放画面。

没有本机编译或运行编译型测试。静态契约和 HTTP/native 对象夹具不代表真实模型、真实焦点、AX/剪贴板时序或 React 画面已经验收;这些仍需在锁定提交的云端和 Dev 环境验证。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

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-27T20:14:24.587407Z 77b8faf New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b973b222c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8b35a0b39

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@appergb
appergb merged commit b471f2a into beta Nov 27, 2026
20 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