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

Tweak feed card to prevent spinnerz when pushing to screen #4600

Merged
merged 9 commits into from
Jun 22, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Jun 22, 2024

Why

There's some spinner states on feed cards - in prod, not related to the FeedCard change necessarily - that we'd like to remove. Easy little win.

We also didn't actually migrate to using the new FeedCard in the ProfileFeedgens list. I had done this work in the starterpacks branch, so I picked it out of there and made a couple tweaks after the recent FeedCard merge into main.

Finally, made a little types tweak inside of FeedCard so that Link knows whether something is a ListView or GeneratorView, supporting this new precaching.

How

We already have a precacheFeed function that takes in FeedSourceInfo from inside one of our query functions. However, we also want to make it possible to run this with a GeneratorView.

Following a similar pattern that we use for posts and profiles, we're adding a precacheFeedFromGeneratorView that can be called with the Link's onPress. This runs just before pushing to the screen - and lets the query already have the info it needs.

Test Plan

Visit a profile that has some feeds, and notice the lack of a spinner state (easiest to see with throttling)

Before

Screen.Recording.2024-06-21.at.7.03.42.PM.mov

After

Screen.Recording.2024-06-21.at.7.04.49.PM.mov

types

lint

tweak to prevent spinnerzzz state

tweak feed card to not required a did resolve req
Copy link

render bot commented Jun 22, 2024

@haileyok haileyok changed the title tweak to prevent spinnerzzz state Tweak feed card to prevent spinnerz when pushing to screen Jun 22, 2024
Copy link

github-actions bot commented Jun 22, 2024

Old size New size Diff
6.31 MB 6.31 MB 1.13 KB (0.02%)

@haileyok haileyok marked this pull request as ready for review June 22, 2024 02:15
src/state/queries/feed.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

lgtm

@haileyok haileyok merged commit 35f6453 into main Jun 22, 2024
6 checks passed
@gaearon gaearon deleted the hailey/precache-feed-card branch June 22, 2024 03:01
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