fix(ui): Fix shadowed messages not hidden in the channel list#2787
fix(ui): Fix shadowed messages not hidden in the channel list#2787VelikovPetar wants to merge 4 commits into
shadowed messages not hidden in the channel list#2787Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChannel list last-message rendering now distinguishes shadowed messages by current user, exposes an optional predicate override, and adds widget tests for the updated visibility rules. ChangesShadowed channel list messages
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/stream_chat_flutter/lib/src/scroll_view/channel_scroll_view/stream_channel_list_item.dart (1)
587-595: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the default last-message filter into one shared helper.
The same current-user-aware shadow/error/ephemeral filtering now lives in both
_ChannelLastMessageWithStatusStateandChannelLastMessageText. That makes it easy for these two channel-list paths to drift again on the next visibility-rule change. Have both call one private helper/factory instead.Also applies to: 704-712
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/stream_chat_flutter/lib/src/scroll_view/channel_scroll_view/stream_channel_list_item.dart` around lines 587 - 595, The default last-message visibility logic is duplicated between _defaultLastMessagePredicate in _ChannelLastMessageWithStatusState and the matching filter used by ChannelLastMessageText, so move the current-user-aware shadow/error/ephemeral checks into one shared private helper/factory and have both call it. Keep the existing behavior by reusing the same Message-based predicate logic (including currentUser, shadowed/isShadowed, isError, and isEphemeral) from both channel-list paths so they cannot drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/stream_chat_flutter/test/src/scroll_view/channel_scroll_view/stream_channel_list_item_test.dart`:
- Line 6: The import in stream_channel_list_item_test.dart uses a relative path
and violates the always_use_package_imports rule. Update the import currently
referencing mocks.dart through a relative URI to use the package import style
instead, keeping the same dependency but matching the rest of the codebase and
the analysis configuration.
---
Nitpick comments:
In
`@packages/stream_chat_flutter/lib/src/scroll_view/channel_scroll_view/stream_channel_list_item.dart`:
- Around line 587-595: The default last-message visibility logic is duplicated
between _defaultLastMessagePredicate in _ChannelLastMessageWithStatusState and
the matching filter used by ChannelLastMessageText, so move the
current-user-aware shadow/error/ephemeral checks into one shared private
helper/factory and have both call it. Keep the existing behavior by reusing the
same Message-based predicate logic (including currentUser, shadowed/isShadowed,
isError, and isEphemeral) from both channel-list paths so they cannot drift.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 08d6a979-2e53-4e01-b2d0-3f8179330577
📒 Files selected for processing (3)
packages/stream_chat_flutter/CHANGELOG.mdpackages/stream_chat_flutter/lib/src/scroll_view/channel_scroll_view/stream_channel_list_item.dartpackages/stream_chat_flutter/test/src/scroll_view/channel_scroll_view/stream_channel_list_item_test.dart
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2787 +/- ##
==========================================
+ Coverage 69.59% 69.69% +0.10%
==========================================
Files 426 426
Lines 25676 25676
==========================================
+ Hits 17869 17896 +27
+ Misses 7807 7780 -27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Submit a pull request
Linear: FLU-562
CLA
Description of the pull request
We were correctly hiding
shadowedmessages from other users in the Message List, but not on the Channel List items. This PR enhances theChannelLastMessageTextpredicate with checks forshadowedmessages from other users.Screenshots / Videos
shadowed-before.mov
shadowed-after.mov
Summary by CodeRabbit