Repository navigation
feat(mobile): mark task rows with the teammate looking after them - #7066
Conversation
The teammate roster row now links the open local tasks the teammate started or took over (rel 'following', same scope as the desktop sidebar mark, at most 200). Mobile task rows show the first follower's 16pt avatar beside the title and read every follower's name to screen readers. Responsibility and delegation changes invalidate the roster so the mark stays current. Signed-off-by: Chris <4436110+zqchris@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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c796d9dc52
ℹ️ 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".
[Medium impact] The changes reach teammate roster updates and mobile task lists. 可以合并,但建议修复跟进头像在电脑页、冷启动和任务恢复后的更新问题。 FindingsFix with agent prompt### Issue 1
apps/mobile/src/session/TaskFollowMark.tsx:19-20
`useTaskFollowers` 只读缓存,但电脑详情页没有加载或刷新伙伴名册。直接打开电脑页时,空缓存会让跟进头像缺失。即使先访问过首页,进入电脑页后发生的接手或解除也不会刷新头像,因为首页的名册订阅只在首页获得焦点时运行。
建议让电脑页也读取名册并订阅变化,或把读取放到两个页面共享的位置。
### Issue 2
apps/mobile/src/device-link/remoteResourceCache.ts:188-190
`followIndex` 只按账号和 `revision` 重建,但从磁盘加载名册时不会增加 `revision`。冷启动时,任务行可以先把空名册建成索引,随后 `readRemoteResourceSnapshot` 才加载已有的 `following` 链接。如果后续写入内容没有变化,也不会发通知,头像就要等其他缓存内容变化后才会出现。
建议在磁盘数据首次装入后使索引失效并通知订阅者,并补上先查询、后加载磁盘缓存的测试。
### Issue 3
apps/desktop/src/main/localDb/ipc/bots.ts:1451-1452
`following` 链接现在取决于任务是否为 `active`,但归档和恢复任务只广播任务变化,不会让负责伙伴的名册重读。先在任务已归档时读取名册,再恢复任务,手机就会显示恢复后的任务,却仍缺少跟进头像,直到其他事件触发名册重读。
现有 `scheduleBotRemoteResourceChangedForSession` 只查 `botSessionLinks`,不能覆盖普通任务的明确接手关系。建议在归档和恢复时通知负责该任务的伙伴名册重读。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
|
…r pages and cold start - Refresh the teammates following a task when it is archived or restored - Keep the teammate roster current on the standalone computer task page - Notify rows that read before the saved roster loaded from disk - Regenerate the design inventory Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
…mate-mark Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
MagicLizi
left a comment
There was a problem hiding this comment.
PR #7066 独立代码审查报告(standard 档)
PR: #7066
head=c9fff2960db8013c36ee1e3fe3bac8d5faa0fb0a,base=4af715d21fbe5a031f6d4d37310a784327527967(main),diffHash=3c92ab8c4cdbd9cff892b3c40b03f81d89b23cd89b0f36b3b0edb8c8cd2a10b5
Findings
没有 P0/P1。以下为不阻断的观察(P2,仅记录):
scheduleBotRemoteResourceChangedForFollowedSession对已解除(responsible:false)的责任记录也会广播一次名册失效(Object.hasOwn不区分 responsible),属于过量失效,多一次无害重读,不影响正确性。- 每次任务状态 patch 都会读一遍全部在用伙伴的责任记录文件;归档/恢复是低频操作、在用伙伴数量有限,量级可接受。
Rule coverage
AGENTS.md/docs/dev-rules/development-workflow.md:只做一件事(手机任务行「在跟进」标记);PR 描述、diff、测试一致;DCO 三 commit 均签名(git log逐一核过)。docs/dev-rules/protocol-compatibility.md(PR head 原文,含本次新增「伙伴名册的跟进任务链接」节):wire 协议只在既有 Remote Resourcelinks上新增可选 relfollowing,旧端按未知 rel 忽略、conversation仍是首条链接;降级与发布顺序在正文写明;未在packages/device-link之外造协议;未改 relay / IPC allowlist。合规。docs/dev-rules/mobile-development.md「冷更边界」:未触碰app.json/app.config.js/eas.json/apps/mobile/package.json/plugins//modules/等任何 fingerprint 输入(diff 文件清单逐一核对),不触发冷更。合规。docs/dev-rules/remote-and-mobile-adaptation.md:无新增 IPC channel、push 类型、请求参数;失效沿用既有maker:remote-resources:changed名册失效链路;恢复路径(归档/恢复后标记刷新)的失效广播只多不少、失败关闭。合规。docs/dev-rules/architecture-invariants.md:无 package 依赖方向变化(sessions.ts 通过setSessionStatusPatchedListener注入,避免 sessions 模块加载伙伴依赖)、无运行时动态 import、布局树未动。合规。docs/dev-rules/engineering-conventions.md:无console.log(createLogger);无新 IPC handler;main 侧新逻辑(readFollowedTaskIds、schedule…ForDelegation/ForFollowedSession)带主路径与错误路径测试;测试无外网/固定端口;改动平台无关;UI 文案走t()、5 语齐全、pnpm check:i18n与pnpm check:i18n-glossary通过;新函数均有职责注释。合规。DESIGN.md/docs/design-rules/cindy-design-system.md:TaskFollowMark复用设计系统组件RemoteCompanionAvatar(framed+radius.pill圆形),尺寸走iconSize.md(16),不自造组件、无硬编码颜色、纯主题 token(双模式安全;浅/深实机截图已附)。合规。docs/product-rules/cindy-bots-runtime.md(PR head 原文 6.3.5):手机标记与桌面侧栏「在跟进」同一口径(委派子任务 ∪ 明确接手 − 解除;在用、未归档、本机、普通来源、非 Orca worker),并与桌面useSessionFollowers/isWorkbenchTaskSource逐条比对一致(DBsourcenotNull,无 null 分歧;remoteHostId IS NULL与桌面「本机」判据一致)。多伙伴取名字排序第一位、读屏列出全部、归档不标、自动化分组行不标,均已落实。docs/dev-rules/database-and-migrations.md:无 schema / migration 改动,只读查询(inArray500 分批)。合规。.github/PULL_REQUEST_TEMPLATE.md:三大段齐、验证区分已跑/未跑、风险分类与回滚写明(协议兼容 + revert)。合规。
Verification
在审查 worktree(PR head)实际执行,均完整落盘并保留命令退出码:
| 命令 | 结果 |
|---|---|
pnpm --filter desktop exec vitest run botRemoteResourceProjection / botTaskResponsibilityAuthority / botRemoteResourceInvalidation |
EXIT=0,3 files / 23 tests passed |
pnpm --filter mobile exec vitest run src/__tests__/remoteResourceCache.test.ts |
EXIT=0,10 tests passed |
pnpm --filter mobile test(全量) |
EXIT=0,769 files / 10770 tests passed |
pnpm --filter desktop exec vitest run src/main/localDb/ipc/__tests__ src/main/maker-ipc/__tests__ |
EXIT=1:322/325 files、8681 tests 全过;3 个文件收集期失败(sessionAutoTitlePersist / sessionsHiddenTasks / sessionsRestoreIfArchived,electron mock 缺 app 导出,报错栈在 worktree/WorktreeManager.ts → workdir-probe-host)。该 import 链在 base 已存在、本 PR 未改这些文件的 import,属既有问题(PR 描述亦已如实注明),CI 双源全绿 |
pnpm --filter desktop run typecheck / pnpm --filter mobile run typecheck |
均 EXIT=0 |
node scripts/check-i18n.mjs / check-i18n-glossary.mjs / check-test-hygiene.mjs |
均 EXIT=0(无新增违规;待裁决术语告警为存量) |
未执行:真实设备双模式目检(以作者 iOS/Android 浅深截图代);真实账号委派链路端到端(由单测覆盖失效链路)。机器人静默期超时放行:copilot-pull-request-reviewer 与 chatgpt-codex-connector 在 20 分钟上限内未表态(Codex 安全审查因用量额度耗尽未完成,非发现问题),这两个机器人的意见可能在合并后才到。
Intent alignment
- 描述来源:PR 标题与 body(2026-10-24 拉取),关联 Chris「先交伙伴段,标记紧接着单独做」(#7032 后续)。
- 初始实现:
c796d9dc52(父基线d795c6db6f)——手机任务行按伙伴名册following链接显示跟进头像 + 桌面投影输出该组链接。 - 待合并 head:
c9fff2960d= 初始实现 + review 修复79e7965257+ 同步 upstream/main 的 merge commit(base 同步,非扩范围)。
| 原目标/初始行为 | 最终行为与影响 | 证据 | 变化依据 |
|---|---|---|---|
| 手机任务行标题旁显示跟进伙伴头像(首页/电脑页) | 不变,新增 TaskFollowMark、useTaskFollowers 接入 HomeSurface |
c796d9dc52 + head apps/mobile/src/session/HomeSurface.tsx |
原目标本体 |
名册 following 链接 + revision 摘要 |
不变 | botRemoteResourceProjection.ts |
原目标本体 |
| 标记随变化刷新 | 补齐:任务归档/恢复、电脑页名册刷新、冷启动磁盘读回通知 | 79e7965257(sessions 监听 + scheduleBotRemoteResourceChangedForFollowedSession + useTeammateRoster(screenFocused) + cache emit()) |
Codex/Greptile 4 条已 Resolve 意见的缺陷修复,仍在原目标内,未改产品方向 |
结论:一致。多轮修复只补失效与刷新,无功能删除/削弱/替换、无无关扩范围;已 Resolve 的 bot 意见均为 P2 级刷新缺陷且已核实落实。无待裁定的核心方向问题。
Overall
pass —— 没有 P0/P1,原意一致性复核通过,可进入 guarded Approve 与合并。
这次改了什么
摘要
手机任务列表补上桌面侧栏已有的「在跟进」标记:伙伴开的后台任务、或伙伴明确接手的任务,任务行标题右侧显示这位伙伴的 16pt 小头像,一眼看出这件事有谁在管。紧接 #7032(首页伙伴段)之后的单独一步。
following的任务链接。口径和桌面useSessionFollowers相同:委派子任务 ∪ 明确接手 − 解除;只列在用伙伴、未归档、本机、普通来源、非 Orca worker 的任务,按最近更新取前 200 条。变更类型
feat新功能docs/test/chore文档、测试或工程维护范围
bots.ts读跟进任务;botRemoteResourceProjection.ts输出following链接与 revision 摘要;botWorkbenchTools.ts、register.ts、botRemoteResourceInvalidation.ts失效广播。sessions.ts任务状态变化通知一个由register.ts安装的监听,botRemoteResourceInvalidation.scheduleBotRemoteResourceChangedForFollowedSession找出开启或接手该任务的伙伴并广播(sessions 模块不加载伙伴依赖)。remoteResources.ts链接上限 64→256;remoteResourceCache.cachedTaskFollowers;新TaskFollowMark;HomeSurface任务行接入;devices/[deviceId]电脑详情页保持名册刷新;名册冷启动从磁盘读回后通知订阅者;5 语读屏文案;--mock伙伴数据带跟进链接。docs/design-rules/design-inventory.md。UI 变化
iOS(iPhone 18 Pro 模拟器)浅色 / 深色:
Android(API 36 模拟器)浅色 / 深色:
左:iOS 置顶任务(Cindy);右:Android 英文任务(LiZi):
4 倍放大,头像与转圈、时间垂直居中:
RemoteCompanionAvatarframed 样式(与伙伴段/桌面侧栏同一组件语言)。iconSize.md(16),与同一行的置顶、自动化图标等大,间距沿用标题行既有 gap 8。怎么验证的
自动验证
测试价值(engineering-conventions §3.2):
botRemoteResourceProjection.test.ts新增 1 例:经投影入口验证伙伴行带following链接、conversation仍在首位、集合变化时 revision 改变(新协议字段与失效依据,原无覆盖)。botTaskResponsibilityAuthority.test.ts在已有用例加 1 条断言:接手责任后同时广播远程名册变化(漏广播 = 手机标记不刷新)。remoteResourceCache.test.ts新增 1 例:同电脑匹配、跨电脑不串、按名字排序、链接撤回后消失。botRemoteResourceInvalidation.test.ts新增 1 例(review):任务归档/恢复后只刷新开启它和接手它的伙伴,跳过暂停、记录损坏与无关伙伴(漏刷新 = 恢复的任务不显示标记)。remoteResourceCache.test.ts再增 1 例(review):任务行先于本机名册读取时,名册读回后会收到通知(冷启动标记缺失)。手工验证
本 worktree 的 Metro(
apps/mobile,--mock视觉数据)同时连 iOS 模拟器(iPhone 18 Pro)与 Android 模拟器(cindy-api36):devices/[deviceId]):Android 截图核对三条标记;iOS 被系统「在 Cindy 中打开?」弹窗遮住置顶行(无模拟器窗口可点),以该页列表实际渲染的三条标记与读屏文本为证。未执行的验证
sessionsRestoreIfArchived.test.ts在未改动的提交上同样失败(electronappmock 缺失,既有问题),CI 分片通过。风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)