Skip to content
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

desktop: get anchor scroll lock working #4345

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

patosullivan
Copy link
Member

fixes tlon-3470

This splits useAnchorScrollLock out to its own file and simplifies the logic and state management quite a bit. There is now just a single place where scrollToIndex gets called. I think it was failing on web because of a race condition.

Probably best for @davidisaaclee to take a look at this one, but open to reviews from anyone else too.

@patosullivan patosullivan changed the title desktop: get scrollToIndex working desktop: get anchor scroll lock working Jan 16, 2025
Copy link
Contributor

@davidisaaclee davidisaaclee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code generally looks good + appreciate the cleanup – putting some notes down since I need to log off for the night:

  • Outside of this PR's scope, it looks like anchors are kind of broken now, I think due to unconfirmed posts (i.e. loading the most recent messages asap) – you can see this by doing a search in channel and jumping to a result :( commenting out this useEffect disables loading unconfirmeds and restores the anchor behavior (which lgtm with this PR's changes)
  • During a onScrollToIndexFailed, develop scrolls to an estimated offset, then attempts to do another scrollToIndex. I can't get a onScrollToIndexFailed to trigger, but I remember that when onScrollToIndexFailed happened, the estimated offset was often wrong, leaving you at an irrelevant part of the scroll. I'm trying to get this to trigger; but if I can't hit it, I'm happy to see it simplified

@patosullivan patosullivan merged commit d0e2269 into develop Jan 17, 2025
1 check passed
@patosullivan patosullivan deleted the po/tlon-3470-scroll-to-index-desktop branch January 17, 2025 13:27
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