Repository navigation
Conversation
This branch has not been deployed
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.
动机 / Motivation
为 macOS 端新增原生 「发给 Antigravity」(
com.google.antigravity)分享入口,让用户可以在微信里多选含图文的聊天记录并「合并转发 → 发给 Antigravity」,直接在 Antigravity 对话输入框内收到整理好的聊天文本和图片附件。主要改动 / Summary
ShareAntigravityShareAction、ForwardTargets、ShareEntryList、BatchState、AppModel中加入.antigravity(目标 Bundle ID:com.google.antigravity);shared/AppLogos/08-antigravity.png及中英文显示名(发给 Antigravity/Send to Antigravity),同步更新macos/Scripts/share-slots.sh、macos/Scripts/check-release-config.sh与shared/AppLogos/README.md。AntigravityPayload)WeChatBridgeCore新增AntigravityPayload.buildPlan(...):针对微信导出的聊天.zip归档,安全解压到/tmp/wxbridge/extracted/(自动清理超过 24 小时的旧目录);聊天记录.txt正文(若有匹配场景提示词则拼在最前面)并按聊天记录出现顺序排列原图,生成两步粘贴计划(先文本,再图片文件列表),直接粘贴进 Antigravity 输入框且不自动回车发送;AutoPaste.focusTextInput)AXTextArea/AXTextField;若用户光标已在聊天框内,直接保留现有焦点,避免 IDE 类应用将焦点切到底部终端面板。macos/Tests/WeChatBridgeCoreTests/AntigravityPayloadTests.swift(5 项单元测试,覆盖单图解包、按聊天顺序列图、纯文本归档、超限附件提示与超长文本截断);ShareActionTests.swift与SceneTests.swift。验证 / Verification
1. 本地校验与测试
swift Scripts/check-localizations.swift:通过(zh-Hans, en)macos/Scripts/check-release-config.sh:通过(13 share entries)swift test --filter 'AntigravityPayloadTests|ShareActionTests|WeChatBridgeAppTests':AntigravityPayloadTests:5/5 passedShareActionTests:9/9 passedWeChatBridgeAppTests:18/18 passed(1 项 UI 快照测试按环境变量默认跳过)2. macOS 真机端到端实测(WeChat 4.2.1 → 微信流 → Antigravity)