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

Preload scaffolds for an almost-instant-loading user profile page #9172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jimrandomh
Copy link
Collaborator

@jimrandomh jimrandomh commented Apr 25, 2024

Improve the loading states of the user profile page. This started with the observation that the drafts list was picking up a limit: 20 and displaying more post-placeholders than it should. I fixed that, and went a little further and also made a SequencesGridItem placeholder, and used the user postCount and sequenceCount fields to get things to line up.

I also did most of the setup for UsersProfile to have an instant-load from the Apollo cache, similar to the instant-load experience you get on post pages. However, there is still one server round trip spent with a blank page and a loading spinner, because to get a user out of the apollo cache we need the user _id, but the URL contains only the user slug, and I didn't manage to find an easy way to convert without a server round trip.

┆Issue is synchronized with this Asana task by Unito

@jimrandomh jimrandomh requested a review from a team as a code owner April 25, 2024 04:52
@jimrandomh jimrandomh requested review from jpaddison3 and removed request for a team April 25, 2024 04:52
@jpaddison3 jpaddison3 self-assigned this Apr 25, 2024
Copy link
Collaborator

@jpaddison3 jpaddison3 left a comment

Choose a reason for hiding this comment

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

Approved, though I'm honestly unsure if there's a benefit as written.

Comment on lines +130 to +133
} & (
{ sequence: SequencesPageFragment, placeholder?: false }
| { sequence: null, placeholder: true }
)) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't actually do the type checking you want it to. Something in our component registration mucks with it.

showAuthor={showAuthor}
bookItemStyle={bookItemStyle}
/>)}
{!sequences && placeholderCount!==undefined && range(0, placeholderCount)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't get this to render the loading state. I see the entire section giving me the loading spinner every time.

@jpaddison3 jpaddison3 assigned jimrandomh and unassigned jpaddison3 Apr 25, 2024
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.

None yet

2 participants