mirror of
https://github.com/block/buzz.git
synced 2026-11-10 19:32:00 +00:00
## Summary Follow-up to [#9213 Activity filters UI](https://github.com/block/buzz/pull/9213), from its [last Codex finding](https://github.com/block/buzz/pull/9213#discussion_r4497322772). With Threads, Mentions or a People/Agents filter active, an Activity row holds only part of its conversation. Marking it read advanced the `thread:<root>` (or channel) marker through the row's latest event, which also read replies the filter hid. For example, reading a person's reply in People also read an older agent reply in the same thread. Filtered rows now advance the synced thread or channel marker through every event that is read, stopping just before the first unread event the filter hides, and write local `msg:` marks only for shown events past that point. Once the hidden event is read too, the marker catches up and syncs both. This also fixes filtered DM rows from #9213, whose `msg:`-only reads never synced to other devices. Unfiltered rows are unchanged. ## Testing - New widget test: "reading a thread row under People leaves hidden agent replies unread". It fails without the fix, and checks the synced marker stops short of a hidden unread reply, then advances fully once nothing hidden is unread. - `flutter test test/features/activity/` (136 pass) and `flutter analyze` on the activity feature. ## Before merge - [x] Automated simulator run (iPhone 17 Pro sim, iOS 27, re-run on d17f79a; the catch-up change in28b927eis covered by the widget test): with Agents selected, marked a channel mention row unread then read; it stays read under Anyone and after relaunch. Screenshots are in Buzz (internal data). The test account has no thread mixing agent and human replies, so the hidden-reply case is covered by the widget test. - [x] Main vs PR simulator comparison of a filtered thread read with a hidden unread reply (iPhone 17 Pro sim, iOS 27; main at [65e8643](https://github.com/block/buzz/commit/65e864301d), PR at [b2414cf](b2414cf6d8)). Neither test account has a real thread with both a person and an agent mention, so this runs the Activity page on the simulator with seeded events through the widget-test harness (`flutter run` of the test). The thread has an older agent mention and a newer person mention, both unread. The steps: choose People, swipe the person row to read it, switch to Agents, then Anyone. Left is main, right is this PR. - After the read, the person row is read under People on both. - Under Agents, main shows the older agent reply as read (the thread marker moved to the person reply's timestamp). The PR keeps it unread (marker stops one second before the agent reply).  - Under Anyone, the thread row is read on main and still unread on the PR, because its agent reply is unread.  🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: Tom Brow <tomb@squareup.com> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>