Skip to content

scroller: move AuthorRow when deleting first message in sequence #4695

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

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jamesacklin
Copy link
Member

Fixes TLON-3132 where deleting the first message in a sequence wouldn't move the AuthorRow to the second one, making it appear as though the person above you sent your second message. showAuthor was mostly just checking to see if the previous message was sent by the same author and wasn't taking the live state of the previous post into account (i.e. deleting).

  • Adjusts the showAuthor logic to account for deleted posts preceding the current one.
  • Uses useLivePost inside BaseScrollerItem to get the current state of the previous post and looks for the isDeleted flag.
  • Tracks if the live version of the previous post exists and if it's deleted. If so, forces showAuthor to true.
  • If the previous message was simply edited and not deleted, we fall back to the original showAuthor logic.
image

I don't actually know if this affects performance in the FlatList at all, since I know we've done a lot of work there and things are fairly torqued-down. @dnbrwstr would love your opinion here.

Copy link

linear bot commented Apr 22, 2025

@patosullivan
Copy link
Member

This works, but only if you leave the channel and come back. If a delete comes through while you're looking at the channel we'll still see the issue.

@jamesacklin
Copy link
Member Author

That's a bit surprising, since that was precisely what useLivePosts is supposed to do. Let me see...

@jamesacklin jamesacklin marked this pull request as draft April 24, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants