-
Notifications
You must be signed in to change notification settings - Fork 384
feat(ui, core, llc, localization): unread banners #2871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renefloor
wants to merge
7
commits into
master
Choose a base branch
from
worktree-unread-banners
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c54721e
feat(llc): add ChannelClientState.isMarkedAsUnread
renefloor 6035a2c
feat(core): add StreamChannel.openAtFirstUnread
renefloor 2622109
feat(ui): rework unread indicators and tighten mark-read gating (FLU-…
renefloor 452ed9b
feat(i18n): add unreadMessagesSeparatorLabel translations
renefloor 5c3e35e
test improvements
renefloor 0808f07
fix review comments
renefloor 27e1a51
fix(ui): dispose _showScrollToBottom notifier
renefloor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/stream_chat_flutter/lib/src/message_list_view/mark_read_details.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import 'package:stream_chat_flutter/stream_chat_flutter.dart'; | ||
|
|
||
| /// The information available when deciding whether to automatically mark a | ||
| /// [StreamMessageListView]'s channel as read. | ||
| /// | ||
| /// Passed to a caller-supplied predicate on | ||
| /// [StreamMessageListViewConfiguration.shouldMarkRead]. Not intended to be | ||
| /// constructed directly. | ||
| class StreamMarkReadDetails { | ||
| /// Creates a set of details describing the current mark-read gate state. | ||
| const StreamMarkReadDetails({ | ||
| required this.hasSeenLastMessage, | ||
| required this.hasSeenFirstUnreadMessage, | ||
| required this.isMarkedAsUnread, | ||
| required this.unreadCount, | ||
| }); | ||
|
|
||
| /// Whether the bottom of the list has been fully visible at some point | ||
| /// since the last successful mark-read — either it's visible right now, or | ||
| /// it was visible earlier and the user has since scrolled away. | ||
| final bool hasSeenLastMessage; | ||
|
|
||
| /// Whether the user has seen (rendered on screen) or scrolled past the | ||
| /// pre-existing unread boundary captured when the channel was opened. | ||
| /// | ||
| /// Always `true` when there was nothing to see in the first place — the | ||
| /// channel opened fully read, or it uses local unread counts with read | ||
| /// events disabled. | ||
| final bool hasSeenFirstUnreadMessage; | ||
|
|
||
| /// Whether the current user has an active manual mark-unread on this | ||
| /// channel that hasn't been read past yet. | ||
| final bool isMarkedAsUnread; | ||
|
|
||
| /// The channel's current unread count. | ||
| final int unreadCount; | ||
| } | ||
|
|
||
| /// Signature for overriding [StreamMessageListView]'s automatic mark-read | ||
| /// gating. | ||
| /// | ||
| /// Return `true` to mark the channel as read, `false` to skip it for now — | ||
| /// the list retries on the next relevant scroll or message event. | ||
| typedef StreamShouldMarkReadPredicate = bool Function(StreamMarkReadDetails details); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.