Fix Unread Messages overlay doesn't respond to messages being read#2
Open
Fix Unread Messages overlay doesn't respond to messages being read#2
Conversation
There was a problem hiding this comment.
Caution
Changes requested β
Reviewed everything up to dd71c91 in 2 minutes and 16 seconds. Click for details.
- Reviewed
76lines of code in1files - Skipped
0files when reviewing. - Skipped posting
4draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with π or π to teach Ellipsis.
1. package/src/components/MessageList/MessageList.tsx:747
- Draft comment:
Minor typo in the comment: insert a space afterchannelUnreadState?.first_unread_message_id. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. package/src/components/MessageList/MessageList.tsx:380
- Draft comment:
Typo: The declaration for 'messageIdLastScrolledToRef' is missing its 'const'. It should be declared as 'const messageIdLastScrolledToRef = useRef(undefined);' to match the intended declaration. - Reason this comment was not posted:
Marked as duplicate.
3. package/src/components/MessageList/MessageList.tsx:747
- Draft comment:
Typographical error: In the comment, 'ThechannelUnreadState?.first_unread_message_idis here for sent messages unread label' is missing a space after the backtick. It should read: 'ThechannelUnreadState?.first_unread_message_idis here for sent messages unread label'. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. package/src/components/MessageList/MessageList.tsx:377
- Draft comment:
Typographical issue: In the comment ('so that we dont scroll to it again on target message set'), 'dont' should be corrected to "don't" for proper contraction. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative as it points out a typographical error in a comment within the code. It does not suggest a code change or improvement, nor does it address functionality or logic. Therefore, it violates the rule against making purely informative comments.
Workflow ID: wflow_vYPmivU5o8aJN8iC
You can customize by changing your verbosity settings, reacting with π or π, replying to comments, or adding code review rules.
| * this flag keeps track of it so that we dont scroll to it again on target message set | ||
| */ | ||
| const messageIdLastScrolledToRef = useRef<string>(undefined); | ||
| messageIdLastScrolledToRef = useRef<string>(undefined); |
There was a problem hiding this comment.
Missing const in the declaration of messageIdLastScrolledToRef. This change unintentionally removes the variable declaration and can lead to unexpected behavior. Please restore the const.
Suggested change
| messageIdLastScrolledToRef = useRef<string>(undefined); | |
| const messageIdLastScrolledToRef = useRef<string>(undefined); |
| lastViewedMessageTimestampRef.current = lastItemDate; | ||
|
|
||
| // If we've been looking at unread messages for more than 2 seconds, mark them as read | ||
| setTimeout(() => { |
There was a problem hiding this comment.
The new setTimeout in updateStickyUnreadIndicator schedules markRead after 2 seconds. Consider storing the timer reference and clearing it if conditions change or if the component unmounts to avoid duplicate or stale calls.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
π― Goal
π Implementation details
π¨ UI Changes
iOS
Android
π§ͺ Testing
βοΈ Checklist
developbranchImportant
Fix unread messages overlay by tracking last viewed message timestamp and marking messages as read after 2 seconds of visibility in
MessageList.tsx.MessageListWithContextto track last viewed message timestamp usinglastViewedMessageTimestampRef.updateStickyUnreadIndicatorto handle marking messages as read based on visibility and time viewed.MessageList.tsx.This description was created by
for dd71c91. You can customize this summary. It will automatically update as commits are pushed.