Skip to content

fix(macos): 同时识别 WorkBuddy 的两个 bundle id (#44) - #67

Merged
Hiwoniu merged 1 commit into
mainfrom
fix/workbuddy-bundle-id
Nov 22, 2026
Merged

Hiwoniu merged 1 commit into
mainfrom
fix/workbuddy-bundle-id

Conversation

@Hiwoniu

@Hiwoniu Hiwoniu commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

问题

WorkBuddy 有两种发行版,bundle id 不同:

  • 微信渠道分发版:com.tencent.workbuddy.mac(原代码只认这个)
  • 官网公开下载版:com.workbuddy.workbuddy

装的是公开版的用户,「发给 WorkBuddy」会显示「未安装」,转发时找不到这个 App,最后只能退回到剪贴板。

改动

  • ShareAction.targetBundleIdentifiers 和 AgentID.bundleIdentifiers 改为 id 列表,WorkBuddy 两个 id 都列进去。targetBundleIdentifier 和 bundleIdentifier 仍然返回主 id,保持兼容。
  • AgentID.matching(bundleIdentifier:) 改为在列表里匹配,用任意一个 id 都能找到对应的 Agent,场景的兼容判断也跟着生效。
  • App 层新增 ShareAction.installedTargetBundleIdentifier,取本机实际装了的那个 id。入口状态、图标、激活粘贴、汇总投递的可选目标都改用它。
  • ShareEntryProbe.installationFailure:两个 id 装了任意一个,就允许开启入口。
  • 新增回归测试 testWorkBuddyIsKnownUnderBothBundleIdentifiers。

验证

  • swift build 编译通过,swift test 共 187 个测试,0 失败。
  • 本机装的 WorkBuddy 是 com.tencent.workbuddy.mac,这个 id 的行为不变。
  • 公开版 com.workbuddy.workbuddy 没有在真机上装来验证,只覆盖了单元测试。

Fixes #44

🤖 Generated with Claude Code

WorkBuddy ships as com.tencent.workbuddy.mac (WeChat-distributed build)
and com.workbuddy.workbuddy (public download). Only the first was known,
so the public build read as 未安装 and forwarding fell back to the clipboard.

ShareAction and AgentID now carry a list of bundle ids; the app resolves
whichever one is installed for the entry status, icon, activation and
collection targets.

Fixes #44

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Hiwoniu
Hiwoniu merged commit f825b15 into main Nov 22, 2026
2 checks passed
@Hiwoniu
Hiwoniu deleted the fix/workbuddy-bundle-id branch November 22, 2026 17:22
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.

内置「发给 WorkBuddy」入口因 bundle id 写错而显示"未安装"

2 participants