Skip to content

feat(web): 公告单列分工摘要块(#370 点1)#396

Merged
leeguooooo merged 1 commit into
mainfrom
feat/370-charter-division
Jul 12, 2026
Merged

feat(web): 公告单列分工摘要块(#370 点1)#396
leeguooooo merged 1 commit into
mainfrom
feat/370-charter-division

Conversation

@leeguooooo

Copy link
Copy Markdown
Owner

#370 第 1 点:分工在公告里单独一块展示。CharterBanner 下加只读分工摘要(host=X · N worker...),点「查看团队 →」跳团队面板。

至此 #370 方案A 全部要点落地:①分工在公告单列(本 PR)②协调并入团队面板(#395)③任务详情/检索(#271+#369)④三面板+组织架构合并(#385/#389/#395)。

web 661 全过、tsc/build 干净。

Refs #370

#370 第 1 点:分工应在公告里单独一块展示、和其他内容分开。公告面板在 CharterBanner
下方加一条只读分工摘要(host=X · N worker · N reviewer),点「查看团队 →」跳到合并后
的团队面板看组织树/全貌。分工数据来自 channelRoles,不新造模型。

至此 #370 方案A 全部要点落地:①分工在公告单列(本 PR)②协调并入团队面板(#395)
③任务详情/检索(#271 + 附件 #369)④分工/协调/Agent/组织架构合并为团队面板(#385/#389/#395)。

验证:web 661 全过(i18n en/zh 对齐)、tsc/build 干净。

Refs #370

Claude-Session: https://claude.ai/code/session_01PgxkZeqJmDge3dYe9W2tPZ
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

370 - Partially compliant

Compliant requirements:

  • 分工在公告中应该单独一个区域展示, 和其他内容分两块

Non-compliant requirements:

  • 协调功能很多用户用不明白, 需要优化
  • 任务没办法看任务详情, 还有各种检索条件 这很重要
  • 组织架构和分工合并到一起,并优化样式和布局
  • 归档和删除的区别

Requires further human verification:

  • 协调功能很多用户用不明白, 需要优化
  • 任务没办法看任务详情, 还有各种检索条件 这很重要
  • 组织架构和分工合并到一起,并优化样式和布局
  • 归档和删除的区别
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

可能的空指针异常

在计算 charterDivisionSummary 时,如果 channelRoles 为空,可能会导致 hostundefined。虽然代码中有检查 channelRoles.length === 0 的逻辑,但建议进一步确保 host 不为 undefined 以避免潜在的空指针异常。

// #370 点1:公告面板单列一块「分工摘要」——host + 各角色计数,只读,点开跳团队面板看全貌。
const charterDivisionSummary = ((): string => {
  if (channelRoles.length === 0) return "";
  const host = channelRoles.find((r) => r.role === "host");
  const counts = new Map<string, number>();
  for (const r of channelRoles) if (r.role !== "host") counts.set(r.role, (counts.get(r.role) ?? 0) + 1);
  const parts = [host ? `host=${host.display ?? host.name}` : null, ...[...counts].map(([role, n]) => `${n} ${role}`)];
  return parts.filter((p): p is string => p !== null).join(" · ");
})();

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
确保host角色有显示名称

在生成分工摘要时,确保host角色存在且有显示名称。如果host没有显示名称,则使用其默认名称。

web/src/pages/Channel.tsx [3448-3455]

 const charterDivisionSummary = ((): string => {
   if (channelRoles.length === 0) return "";
   const host = channelRoles.find((r) => r.role === "host");
   const counts = new Map<string, number>();
   for (const r of channelRoles) if (r.role !== "host") counts.set(r.role, (counts.get(r.role) ?? 0) + 1);
-  const parts = [host ? `host=${host.display ?? host.name}` : null, ...[...counts].map(([role, n]) => `${n} ${role}`)];
+  const parts = [host && (host.display || host.name) ? `host=${host.display || host.name}` : null, ...[...counts].map(([role, n]) => `${n} ${role}`)];
   return parts.filter((p): p is string => p !== null).join(" · ");
 })();
Suggestion importance[1-10]: 7

__

Why: 该建议确保了host角色存在且有显示名称,提高了代码的健壮性。

Medium

@leeguooooo leeguooooo merged commit 4d93839 into main Jul 12, 2026
20 checks passed
@leeguooooo leeguooooo mentioned this pull request Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant