Skip to content

fix(bridge): 多 Bot 平台状态灯改为任一连接即显示绿色 【已审核 PR】#359

Merged
ErlichLiu merged 1 commit intoErlichLiu:mainfrom
Andreaseszhang:fix/bridge-status-multi-bot
Apr 30, 2026
Merged

fix(bridge): 多 Bot 平台状态灯改为任一连接即显示绿色 【已审核 PR】#359
ErlichLiu merged 1 commit intoErlichLiu:mainfrom
Andreaseszhang:fix/bridge-status-multi-bot

Conversation

@Andreaseszhang
Copy link
Copy Markdown
Contributor

Overview

修复「设置 → 远程连接」页中飞书/钉钉的平台级状态灯在多 Bot 场景下的显示问题。

此前 PlatformStatusDot 使用了只取第一个 Bot 状态的 atom(feishuBridgeStateAtom / dingtalkBridgeStateAtom),导致只要第一个 Bot 未启动,即使其他 Bot 正常运行,平台级指示灯也变灰。

修复后:读取所有 Bot 的状态(feishuBotStatesAtom / dingtalkBotStatesAtom),按优先级推导平台级状态——只要任一 Bot 已连接,就显示绿色

Changes

  • apps/electron/src/renderer/components/settings/BotHubSettings.tsx — 核心改动
    • 导入从 feishuBridgeStateAtom / dingtalkBridgeStateAtom 改为 feishuBotStatesAtom / dingtalkBotStatesAtom
    • PlatformStatusDot 组件改为读取多 Bot 状态映射,而非取第一个
    • 新增 getPlatformStatus() 辅助函数,按优先级推导平台级状态

Status 优先级

任一 connected  → 绿色 (connected)
否则 任一 error     → 红色 (error)
否则 任一 connecting → 黄色 (connecting)
否则 None/全部 disconnected → 灰色 (disconnected)

Notes

  • 飞书和钉钉均有此问题,一并修复
  • WeChat 只有单 Bot 支持,不涉及此问题,无需修改
  • feishuBridgeStateAtom / dingtalkBridgeStateAtom 本身未改动,不影响其他向后兼容的使用方

🤖 Generated with Claude Code

PlatformStatusDot 改用 feishuBotStatesAtom / dingtalkBotStatesAtom 读取
所有 Bot 状态,新增 getPlatformStatus() 按优先级推导平台级状态:
只要任一 Bot 已连接就显示绿色,不再受第一个 Bot 状态影响。
飞书和钉钉均有此问题,已一并修复。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Andreaseszhang Andreaseszhang changed the title fix(bridge): 多 Bot 平台状态灯改为任一连接即显示绿色 fix(bridge): 多 Bot 平台状态灯改为任一连接即显示绿色 【已审核 PR】 Apr 29, 2026
@ErlichLiu ErlichLiu merged commit 30e62c7 into ErlichLiu:main Apr 30, 2026
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.

2 participants