Skip to content

feat: 调整通知中心语义和徽标计数#284

Draft
utopiafar wants to merge 1 commit into
memex-lab:mainfrom
utopiafar:codex/issue-280-notification-semantics
Draft

feat: 调整通知中心语义和徽标计数#284
utopiafar wants to merge 1 commit into
memex-lab:mainfrom
utopiafar:codex/issue-280-notification-semantics

Conversation

@utopiafar

Copy link
Copy Markdown
Collaborator

摘要

  • 将 action center 拆成后台问题、待处理动作、过期建议、澄清、卡片更新等语义分区。
  • 引入 primary badge count:红点只计入需要用户主动处理的项目,卡片详情更新仍可进入 action center 但不会制造强提醒。
  • 为日程动作增加懒加载 past_due 语义,并在 UI 中弱化过期建议的强操作感。

验证

  • flutter test --no-pub --concurrency=1 test/data/services/system_action_service_test.dart test/ui/main_screen/widgets/action_center_failed_cards_test.dart
  • flutter test --no-pub --concurrency=1
  • dart analyze 变更文件:无 error/warning,仅保留 timeline_screen.dart 既有 info lint
  • Android 模拟器 Medium_Phone_API_35:arm64 globalDev debug APK 安装并冷启动,进入 onboarding UI,无启动 crash 日志

Closes #280

@github-actions

Copy link
Copy Markdown

PR AI Review / PR AI 语义预检

中文

  • 风险等级:低风险
  • 需要人工审核:
  • 黄金链路影响:
  • 置信度:high
  • Workflow run:27489513100

PR 将通知中心拆分为语义分区(后台异常、待确认动作、已过期建议、澄清请求、卡片更新),引入 primaryBadgeCount 将卡片详情更新排除在主徽标之外,并为已过期的日程建议增加 past_due 状态和弱化 UI。变更范围合理,遵循现有架构模式,测试覆盖充分。

影响范围

  • service
  • ui
  • view_model
  • i18n
  • tests

黄金链路

  • none
  • 说明:变更仅涉及通知中心 UI 语义和徽标计数逻辑,不影响记录输入、timeline 渲染、agent pipeline、LLM 配置或本地数据完整性等核心链路。

风险项

  • info 格式化清理与功能变更混合。证据:lib/ui/card_attachments/widgets/system_action_card.dart — functional changes (past_due UI) mixed with trailing-comma/formatting normalization, lib/ui/main_screen/widgets/action_center_sheet.dart — section refactor mixed with formatting。
    建议:未来建议将格式化清理与功能变更分到独立提交,方便 review 聚焦语义差异。不影响本次合并。

测试缺口

  • lib/ui/timeline/view_models/timeline_viewmodel.dart 新增的 actionCenterItemCount 字段没有对应的 ViewModel 单元测试。该字段控制通知按钮是否弹出 ActionCenterSheet(而非仅显示 toast),属于用户交互行为变化。。 建议检查:Add a TimelineViewModel unit test verifying actionCenterItemCount is populated from getActionCenterSummary() and used to gate sheet visibility.

English

  • Risk level: LOW
  • Human review required: NO
  • Golden path impact: NONE
  • Confidence: high
  • Workflow run: 27489513100

PR restructures the action center into semantic sections (background issues, pending actions, past-due suggestions, clarifications, card updates), introduces primaryBadgeCount to exclude informational card updates from the main badge, and adds past_due status with de-emphasized UI for expired calendar suggestions. Changes are well-scoped, follow existing architecture patterns, and have solid test coverage.

Affected Areas

  • service
  • ui
  • view_model
  • i18n
  • tests

Golden Path

  • none
  • Rationale: Changes are scoped to action center UI semantics and badge counting logic. No impact on record capture, timeline rendering, agent pipeline, LLM configuration, or local-first data integrity.

Findings

  • info Formatting cleanup mixed with functional changes. Evidence: lib/ui/card_attachments/widgets/system_action_card.dart — functional changes (past_due UI) mixed with trailing-comma/formatting normalization, lib/ui/main_screen/widgets/action_center_sheet.dart — section refactor mixed with formatting.
    Recommendation: Consider separating formatting-only cleanup from functional changes into distinct commits for easier review. Not blocking for this PR.

Test Gaps

  • lib/ui/timeline/view_models/timeline_viewmodel.dart The new actionCenterItemCount field on TimelineViewModel lacks a dedicated unit test. This field controls whether the notification button opens the ActionCenterSheet (vs. showing a toast), which is a user interaction behavior change.. Suggested check: Add a TimelineViewModel unit test verifying actionCenterItemCount is populated from getActionCenterSummary() and used to gate sheet visibility..

AI review is advisory. Maintainers should verify the result before merging.

@github-actions github-actions Bot added the ai: low risk AI review classified the PR as low risk label Jun 14, 2026
@github-actions

Copy link
Copy Markdown

PR Preflight Summary / PR 预检汇总

中文

  • 统一结论:低风险:两个预检均已完成,质量预检通过,可走普通手动合并流程。
  • Policy preflight:低风险。未命中打回或高风险规则。
  • Flutter quality:通过。Analyzer 和 test baseline 均未发现新增问题。
  • PR head:1287666a8aca8737de8536ef6a91d984ee960759
  • Policy run:27489513112
  • Flutter run:27489513101

English

  • Combined result: Low risk: both preflights completed and quality passed; use the normal manual merge flow.
  • Policy preflight: LOW RISK. No blocking or high-risk policy signal was found.
  • Flutter quality: PASS. Analyzer and test baselines found no newly introduced issue.
  • PR head: 1287666a8aca8737de8536ef6a91d984ee960759
  • Policy run: 27489513112
  • Flutter run: 27489513101
PR Policy Preflight / PR 规则预检

PR Policy Preflight / PR 规则预检

中文

  • 判定:低风险
  • 变更文件数:13
  • 变更行数:1310
  • Diff 是否截断:false

未发现确定性规则问题。

English

  • Decision: LOW RISK
  • Changed files: 13
  • Changed lines: 1310
  • Diff truncated: false

No deterministic policy findings.

PR Flutter Quality / Flutter 质量预检

PR Flutter Quality / Flutter 质量预检

中文

  • 总体:通过
  • Analyzer baseline:通过
  • Test baseline:通过

English

  • Overall: PASS
  • Analyzer baseline: PASS
  • Test baseline: PASS

Flutter Analyzer Baseline

  • Base issues: 287
  • PR issues: 287
  • New issues: 0

No new analyzer issues introduced by this PR.

Flutter Test Baseline

  • Base failures: 0
  • PR failures: 0
  • New failures: 0

No new Flutter test failures introduced by this PR.

@whbzju whbzju left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the Action Center semantics changes. The overall direction makes sense, but I think these should be addressed before merge:

  • [P2] past_due can block future device-action resync. SystemActionService introduces the new past_due status, but ScheduleStateService._maintainDeviceAction still treats any non-pending existing device action as historical and returns early. If a future schedule item expires and gets marked past_due, then the user/agent later updates that schedule item to a new future time, _maintainDeviceAction will keep the old past_due action instead of clearing/recreating a confirmable device action. Please treat past_due as rebuildable/clearable, not the same as completed / dismissed / rejected. Relevant paths: lib/data/services/system_action_service.dart, lib/data/services/schedule_state_service.dart.

  • [P2] Expired reminders are still strong badge items. The UI copy says future calendar and reminder suggestions need confirmation, but markPastCalendarActionsPastDue() only scans actionType == calendar. actionReviewDeadline() already knows how to parse reminder due_date, so expired reminders remain pending, continue to count toward the primary badge, and stay under “Actions to confirm.” Either include reminders in the past-due transition or narrow the copy/tests to make it explicit that only calendar suggestions are softened. Relevant path: lib/data/services/system_action_service.dart.

  • [P3] All-day calendar suggestions can be moved out of pending too early. actionReviewDeadline() uses end_time ?? start_time for calendar actions and does not account for all_day. For an all-day event with only a date/start time, this can mark the suggestion past_due after midnight even though the user may still reasonably add it during that day. Please use the all-day end-of-day boundary, or require/use an explicit end_time for all-day actions. Relevant path: lib/data/services/system_action_service.dart.

I did not see whitespace issues in git diff --check origin/main...origin/pr/284.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai: low risk AI review classified the PR as low risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

梳理通知中心语义、一键清理与过期策略

2 participants