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

don't maintain position whenever there are no parents #4277

Merged
merged 1 commit into from
May 30, 2024

Conversation

haileyok
Copy link
Member

Why

In #4254, we removed the ViewHeader from the items given to FlatList and instead placed it outside the FlatList. In doing so, we removed the first element of our array.

Now, whenever we open a post that has no parents but has a link card inside of it, we see that the list is maintaining the position of the root post - since that is the first item in the list that can be "latched onto".

RocketSim_Recording_iPhone_15_Pro_6.1_2024-05-30_00.09.24.mp4

The solution is to set the maintainVisibleContentPosition prop to undefined whenever we know there are no parents that could cause a layout jump.

Test Plan

Visit this post and test opening the quoted post. There should be no layout jump. https://bsky.app/profile/ellyzoe.bsky.social/post/3ktlkoamoko2h

RocketSim_Recording_iPhone_15_Pro_6.1_2024-05-30_00.20.26.mp4

Copy link

render bot commented May 30, 2024

Copy link

Old size New size Diff
7.23 MB 7.23 MB 4 B (0.00%)

@gaearon gaearon merged commit 76f860d into main May 30, 2024
6 checks passed
estrattonbailey added a commit that referenced this pull request May 31, 2024
* origin/main: (51 commits)
  [🐴] Option to share via chat in post dropdown (#4231)
  [🐴] Record message (#4230)
  [🐴] send record via link in text (Record DMs - base PR) (#4227)
  Use new icons on notifications screen (#4299)
  Composer - fix modals, and other tweaks (#4298)
  Shadows (#4265)
  Change many border widths from `1` to `hairlineWidth` (#4294)
  Add follow button to feed item avatar (#3560)
  Disable non-deterministic flaky test (#4295)
  Don't log downsample warning when unnecessary (#4291)
  [Statsig] Sample noisy events (#4288)
  Bump FontAwesome (#4285)
  Fix scrolling for labeler profiles (#4286)
  Reduce Threadgate button size (#4287)
  put dropdown in fullscreenoverlay on iOS (#4284)
  play haptics before closing modal (#4283)
  match loadmore position to fab (#4280)
  Composer - Use sheet presentation on iOS (#4278)
  don't maintain position whenever there are no parents (#4277)
  Fix native translations on iOS 17.5.1 (#4282)
  ...
@haileyok haileyok deleted the hailey/no-maintain-position-no-parents branch September 2, 2024 20:07
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