-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add a "last unread" indicator for reports #1498
Comments
External Upwork post - https://www.upwork.com/jobs/~0168a5128a533e2505 |
here how i would solve this bugs a. backend heavy approach
b. frontend heavy
upwork proposal https://www.upwork.com/ab/proposals/1363015601945636865 |
What about the |
That makes sense to me Lucas, but maybe I am missing something about the existing proposal. cc @roryabraham since you have proposed the original solution |
@lucas-neuhaus-dev Yep, the |
@roryabraham
This new function
The exception mentioned happens only when
This I spent some reasonable time reading the explanation and testing things out on the code, but can't seem to figure this stuff out. One more thing:
What about, instead of inserting an object in the array, we don't leave it as it is, and add some conditional logic on the Sorry for the long list of questions. I'm not sure of how strict I have to follow the instructions on the PR description, so I wanted to make sure I understood it well before anything really. |
@lucas-neuhaus-dev sorry for the confusion. This implementation plan was copy/pasted from a document which outlines some features that do not yet exist, including the ability to manually mark conversations as unread. That was an oversight on my part, so I'm sorry to have wasted some of your time. I should have been more careful in copy/pasting this out of its original context. Allow me to clarify...
Actually, you shouldn't need to create this function or call
Your understanding of this is correct. This should be a new function similar to
If you think it would be more complicated to inject an object into the Again, sorry for the unnecessary confusion I caused here @lucas-neuhaus-dev. There is a lot of context missing in that explanation, so it makes no sense on its own. |
No problem! Thanks for the explanation.
I see, that's a good point. |
Just a heads up that I updated the mockup in the original comment of this issue - not a huge change, just moves the "New" over to the right. |
@shawnborton since you mentioned that, let me ask: When an unread message is within a group of recent messages (when it's not the first message with an avatar on the left), like on the image below: Do you want it to be like the image, or do you prefer tagging that message as a new group? I mean, show the name, avatar and time again after the |
I think the general rule of thumb is that the unread indicator would immediately precede the last unread individual message. So basically what you have mocked up is perfect. |
@shawnborton just thought of another question 😅 haha For large screens, don't you think that it will look weird? The |
Hmmmm I think your mock is a little bias. It is a 1180px width screen, instead of other very normal 1920px, so it is more of a medium screen. I would encourage you to try a 1920px screen with very short messages. I believe that if we brought the |
Yeah, it really doesn't look great at the center, I had a different image in my head. I'm on it, thanks! |
Awesome, thanks for your feedback though and working through the mockups with me! |
Obs.: I have one unrelated question at the end, I would appreciate it if someone could kill my curiosity on that, not necessary tho Proposal
I know it is better to show what I have if I'm having problems with something, that's why I'm writing this proposal without the Unrelated question |
Yeah, but we still have to write a little function to get it, since
It does. I did some tests and it misses the action index by a decent margin.
I see, thanks for the explanation. |
I have fallen down this rabbit hole before :) Be careful not to lose yourself in there. |
I noticed that in some cases (sorry, I have no idea how to reproduce) the app is showing the green unread line for message I sent myself (in the same browser window), which should never happen: @lucas-neuhaus-dev seems like a bug in the implementation, can you take a look please? |
Hi @iwiznia, I can already imagine what caused this, my bad. I'll take a look at this in just a few minutes and open a new PR once I got a solution. Thanks for pointing that out. |
Awesome, thanks for the fast response! |
I was able to reproduce it when:
Hopefully that is the only edge case, if you think what you are facing is a different issue, please let me know. |
I think it is a different issue, since I had not sent any new messages, but let's fix the issue you found and se how that goes. |
Just an update. I started a full-time job yesterday, so I didn't really have time to work on this. |
Hi @lucas-neuhaus-dev - Just checking it to see if you have an update on these changes! |
Contributor has been paid, the contract has been completed, and the Upwork post has been closed. |
If you haven’t already, check out our contributing guidelines for onboarding!
Platform - version: web, ios, android, desktop - version number Version 1.0.1-444 (1.0.1-444)
Action Performed:
Expected Result:
Actual Result:
At this time, the only method to see the last read message is looking at the time stamp.
Currently, the only method to determine the last message you've read is by the date of the messages
And some guidelines for a solution in the code:
UnreadActionIndicator
This simple component will render an
<Animated.View />
as a horizontally-oriented flexbox containing:<Text />
component containing the word “new”<View/>
with a width but no height, and a green borderBottom (AKA a horizontal rule in React Native).It should have a very simple animation to fade out when being hidden.
ReportActionsView
We need to make sure that the last unread comment on the report remains unread until the user leaves the report and comes back. We’ll start by writing a new function called
recordLastUnreadAction
. It will grab thelastUnreadAction
from the report. If none is found, we’ll use the highest visible sequence number, just likerecordMaxAction
does now.Then we’ll rename
recordMaxAction
torecordMaxVisibleAction
, and replace all uses ofrecordMaxAction
withrecordLastUnreadAction
, except for this one, which is triggered when an inactive report becomes active again. In that case, we’ll callscrollToAction
with the sequence number of the last unread action so that we display the last unread comment in the report, then callrecordMaxVisibleAction
.We’ll then create a new function called
insertUnreadIndicator
, which will inject an object with{type: ‘unreadIndicator’}
into thesortedReportAction
array in the position immediately following thelastUnreadAction
.Then we’ll update
renderItem
to check the type of the item, and if it isunreadIndicator
, it will render an<UnreadActionIndicator />
instead of a<ReportActionItem />
. In markAllRead, we’ll trigger the hide animation on the<UnreadActionIndicator />
, then when it’s completed remove it from thesortedReportActions
array.The text was updated successfully, but these errors were encountered: