Skip to content

[codex] Fix duplicate timeline placeholder cards#145

Merged
utopiafar merged 1 commit into
memex-lab:mainfrom
utopiafar:codex/fix-timeline-card-dedupe
May 18, 2026
Merged

[codex] Fix duplicate timeline placeholder cards#145
utopiafar merged 1 commit into
memex-lab:mainfrom
utopiafar:codex/fix-timeline-card-dedupe

Conversation

@utopiafar
Copy link
Copy Markdown
Collaborator

Summary

  • Fixes [Bug]输入新卡片时,主页信息流上会短暂出现两个占位卡片 #143 by making the in-memory timeline list idempotent by TimelineCardModel.id.
  • Upserts locally submitted/card-added cards instead of blindly inserting duplicates.
  • Collapses duplicate processing copies when card updates arrive, while keeping unloaded filtered-list cards hidden.
  • Adds a stable key to timeline entries and focused unit/widget coverage for duplicate submission, update, and pagination overlap cases.

Root Cause

A newly submitted card can enter the TimelineViewModel from more than one local UI/update path while it is still in processing state. addCard() always inserted at index 0, so two copies of the same fact id could be visible until a later refresh or completed card update rebuilt the list from storage.

Validation

  • dart pub get --offline --no-example
  • flutter test --no-pub test/ui/timeline
  • dart analyze lib/ui/timeline/view_models/timeline_viewmodel.dart lib/ui/timeline/widgets/timeline_screen.dart test/ui/timeline/view_models/timeline_viewmodel_test.dart test/ui/timeline/widgets/timeline_entry_dedupe_test.dart (passes with existing info-level timeline_screen.dart warnings for deprecated withOpacity and one existing async-context lint)
  • git diff --cached --check

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

PR Preflight Summary / PR 预检汇总

中文

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

English

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

PR Policy Preflight / PR 规则预检

中文

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

未发现确定性规则问题。

English

  • Decision: LOW RISK
  • Changed files: 0
  • Changed lines: 0
  • 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: 328
  • PR issues: 328
  • 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.

@utopiafar utopiafar marked this pull request as ready for review May 18, 2026 14:34
@utopiafar utopiafar merged commit 7a39453 into memex-lab:main May 18, 2026
4 checks passed
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]输入新卡片时,主页信息流上会短暂出现两个占位卡片

1 participant