fix(desktop): 清除伙伴消息的灵动岛未读状态 - #4054
Conversation
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/components/layout/MainLayout.tsx | 接入伙伴路由解析并在通知跳转时立即上报 session;已调查的上报值与目标路由一致。 |
| apps/desktop/src/renderer/lib/agentIslandVisibleSessionRoute.ts | 新增伙伴主路由和 session 路由解析,但未覆盖合法的 history 会话路由。 |
Prompt To Fix All With AI
### Issue 1
apps/desktop/src/renderer/lib/agentIslandVisibleSessionRoute.ts:25-28
**遗漏伙伴历史会话**
新解析器只识别 `/bots/:botId/session/:sessionId` 和伙伴主路由,但合法的 `/bots/:botId/history/:sessionId` 同样会渲染真实的只读会话。用户打开伙伴历史会话时,这里会返回 `null`,MainLayout 随后清空可见任务,而不是上报正在查看的 `sessionId`,导致该入口仍可能保留错误的灵动岛未读状态。请覆盖 history 路由,并为伙伴各类会话路由补充解析测试。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(desktop): clear Agent Island unread ..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cdcacdf6f
ℹ️ 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".
|
@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(apps/desktop/src/renderer/lib/agentIslandVisibleSessionRoute.ts / apps/desktop/src/renderer/components/layout/MainLayout.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
命中 UI 路径(apps/desktop/src/renderer/components/layout/MainLayout.tsx / apps/desktop/src/renderer/lib/agentIslandVisibleSessionRoute.ts)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范。 |
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
MagicLizi
left a comment
There was a problem hiding this comment.
独立审查未通过(P1×3)。伙伴消息进灵动岛可见集合后,未读会被过宽的可见会话集合清掉。
-
[P1]
apps/desktop/src/renderer/components/layout/MainLayout.tsx:427—routeSessionId在/bots/...上已是伙伴会话,但splitVisibleSessionIds仍把全局splitGroupStore里 ≥2 个分栏并进去。SplitGroup只挂在/cc-agent,离开任务页并不清 store。打开伙伴对话时会setVisibleSession([botSession, ...splitIds]),main 把这些 id 当成被动已读,岛上未读被清、卡片被藏——那些任务并不在屏幕上。请只在 cc-agent 路由上合并分栏 id(与resolveAgentIslandVisibleSessionIdFromPath同一谓词)。 -
[P1]
apps/desktop/src/renderer/lib/agentIslandVisibleSessionRoute.ts:28—matchPath('/bots/:botId', pathname)把短链当成规范任务已可见。该路径也是设置(?settings=1)、邀请和非对话 spinner;侧栏进设置走/bots/:id?settings=1,没有挂聊天。结果:打开伙伴设置就会清规范任务的岛未读。短链可留给通知交接 spinner,但settings=1时不要上报会话(或只认/session/与/history/,短暂/bots/:id仍用现有通知里的setVisibleSession(sessionId))。 -
[P1]
apps/desktop/src/renderer/__tests__/agentIslandVisibleSessionRoute.test.ts:6— 新 resolver 未 import、未测;现有 8 例仍是旧路径。请补伙伴 session/history/短链、settings=1、以及分栏合并不得作用在 bot 路由上的回归。
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
|
已在 7d22182 按本轮三项反馈统一收窄可见集合。 不变量:被动已读只包含当前路由展示的聊天。MainLayout 通过同一个纯函数计算集合:普通任务页才能合并分栏;伙伴 session/history 只包含自身;伙伴短链、设置入口、邀请和跳转等待页不从 profile 推断 canonical ID。短链完成既有跳转后由 session 路由上报,通知交接保持原有逻辑,无新增状态或重试机制。 回归覆盖从普通分栏 → 伙伴短链 → 设置 → session → history → 普通分栏的连续切换,验证残留分栏 ID 不跨页面清未读。区分短链设置页与 session 上的设置抽屉:后者仍挂载聊天。 验证:15 个定向测试、根 test:unit:related、Desktop typecheck、git diff --check 均通过。真实 macOS 灵动岛以及 Light/Dark 实机效果未验证。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d2218287f
ℹ️ 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".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
|
已在 3e3795a 补齐设计台账生成结果:新增 useBotIslandVisibleSession 后 desktop.bots 可达文件数发生变化,导致 verify-checks、Windows 1/2 和 Git integration 在同一 design-inventory CLI 检查失败。生成后仅变更台账日期与新增 hook 记录,人工维护区未变。47 个台账测试、504 个 runner 检查及 Desktop 相关单测均通过。f2e96728b 的两组 Linux 单测已通过,之前的 PI fixture 竞态本轮未复现;不修改业务代码。 |
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
|
已推送 9c92686,同步 main 并重新生成设计台账,解决唯一的生成区块冲突;人工维护区与 main 一致,GitHub 已确认 MERGEABLE。 同步后验证:47 个台账测试与 Desktop typecheck 通过。 |
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
|
本轮 CI 收敛:不变量仍是「伙伴已通过归属校验、且窗口在前台时,才上报被动已读」;唯一上报 owner 是视图复用的 hook。当前用例覆盖查询等待/失败、迟到结果、路由切换、后台完成、重新聚焦与卸载清理。 已修复本 PR 的 Windows 测试竞态: 另外两族失败与当前 main 同代码:PI stop 测试分别异步写 approval/stop,不能保证同一扫描批次,日志最终为 completed 而非 stopped;botSkillStore 容量测试先超过 20s,未结束循环继而污染后续 fixture 并引发 ENOTEMPTY。未将无关模块修复混入本 PR,也未盲重跑旧任务;新提交 CI 将重新验证。Windows 本机及真实 macOS/Light/Dark 实机尚未验证。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4c52f14e6
ℹ️ 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".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
这些问题已在当前 head 的后续 commit 中修复(格式门/安全门已通过),自动 dismiss 旧的 CHANGES_REQUESTED 以解除合并阻塞。
MagicLizi
left a comment
There was a problem hiding this comment.
独立审查通过:当前 head 无 P0/P1。伙伴短链/设置不再误清分栏未读;聊天与历史在归属校验后再上报。
|
合了。打开伙伴设置或短链时,旁边任务岛不再被误清未读。 |
这次改了什么
摘要
修复阅读伙伴消息后灵动岛仍保留未读的问题,同时防止伙伴设置入口误清主任务未读、伙伴页面误清此前分栏任务的未读。
变更类型
fix缺陷修复范围
UI 变化
怎么验证的
自动验证
手工验证
已核对 BotsHomeView 的短链跳转、设置入口及 BotSettingsDrawer 保留聊天的源码路径。未启动客户端目检。
未执行的验证
真实 macOS 灵动岛行为与 Light/Dark 实机效果未验证。
风险
风险分类
影响与回滚
提交前检查