Skip to content

fix: aggregate knowledge base notifications to prevent toast storm#13284

Merged
DeJeune merged 1 commit intoCherryHQ:mainfrom
kovsu:03-07-fix-knowledge-notification
Mar 7, 2026
Merged

fix: aggregate knowledge base notifications to prevent toast storm#13284
DeJeune merged 1 commit intoCherryHQ:mainfrom
kovsu:03-07-fix-knowledge-notification

Conversation

@kovsu
Copy link
Copy Markdown
Collaborator

@kovsu kovsu commented Mar 7, 2026

Fix #12989

before after
CleanShot.2026-03-07.at.20.55.12.mp4
CleanShot.2026-03-07.at.20.51.49.mp4

Copy link
Copy Markdown
Collaborator

@GeorgeDong32 GeorgeDong32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码审查

✅ 总体评价

这是一个高质量的 bug 修复,有效解决了批量添加知识库项目时的"通知风暴"问题。核心改动逻辑清晰,代码组织良好。


🟡 建议:通知标题优化

sendBatchNotification 方法中,通知标题统一使用 t('common.knowledge_base')("知识库"),建议根据处理结果动态设置更具辨识度的标题:

当前代码:

NotificationService.getInstance().send({
  id: uuid(),
  type,
  title: t('common.knowledge_base'),  // 统一使用"知识库"
  message,
  ...
})

建议改进:

const title = failed === 0 
  ? t('notification.knowledge.batch_success_title')   // "知识库处理成功"
  : failed > 0 && succeeded > 0
    ? t('notification.knowledge.batch_mixed_title')   // "知识库处理完成"
    : t('notification.knowledge.batch_error_title')   // "知识库处理失败"

NotificationService.getInstance().send({
  id: uuid(),
  type,
  title,
  message,
  ...
})

这样用户可以通过通知标题快速识别处理结果,而不需要阅读详细内容。


结论:建议合并,上述为可选改进。

@DeJeune DeJeune merged commit 3f6aedb into CherryHQ:main Mar 7, 2026
13 checks passed
@kovsu kovsu deleted the 03-07-fix-knowledge-notification branch March 7, 2026 15:30
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.

[Bug]: UI: Obstructive repeated error message in Knowledge

4 participants