-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Hide empty content in favor of Reader onboarding. #96988
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~52 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
@allilevine I just had a thought: not everyone sees Reader onboarding, correct? I think we only show it to new accounts. So this change could show a "blank" screen if someone doesn't have any subscriptions and is not presented with onboarding. |
@holdercp Thanks for catching that! What about adding the |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
I noticed a small difference between production and this branch. It looks like if the account has no subscriptions (except the users own site), in production we show the Screen.Recording.2024-12-02.at.23.02.23.mov |
@eoigal Nice catch! I added a check for subscriptions to sites that the user is an owner of. I also added back "Welcome to Reader" for conditions we may have missed. Do you happen to know where we filter out the users' own blogs? I'm wondering if it's just owners, or if they're a member of the site. |
3edb91e
to
5d7f75d
Compare
client/reader/following/main.tsx
Outdated
const isLoading = isLoadingCount || isLoadingSiteSubscriptions; | ||
|
||
const hasNonSelfSubscriptions = useMemo( () => { | ||
if ( isLoading ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this check in this function? I think having it within the hasNonSelfSubscriptions
function muddies the intent of the function, meaning the value really represents hasNonSelfSubscriptionsAndNotLoadingSubscriptions
😂.
Can we move the loading check outside of this function? It looks like we're checking isLoading
again on line 50 so maybe this check is redundant anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's redundant. I went ahead and removed it. 👍
client/reader/following/main.tsx
Outdated
} | ||
|
||
return subscriptionsCount.blogs > 0; | ||
}, [ subscriptionsCount?.blogs, siteSubscriptions, isLoading ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does using the optional chaining here impact useMemo
? What if it resolves to undefined
? I would suspect it would be fine and would work like we expect and re-run the function if that first item changes from undefined
to an array or object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah if subscriptionsCount
is undefined, it would just re-run. I updated to explicitly check the object.
} } | ||
/> | ||
) } | ||
<DataViews |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 I think pulling all the subscription logic up into main
makes this much easier to reason about.
I'm still seeing reader onboarding even if I have subscriptions: I did this by manually following sites from discover or search. Based on this change, I would expect onboarding to be hidden in the scroll view. |
@holdercp That's expected when you meet the normal conditions for Reader Onboarding: new account that hasn't completed onboarding yet. It's still called here. When I create a new user I do have some initial subscriptions, so seeing it there might be common (as opposed to a new account with no subscriptions at all). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm noticing now that completing onboarding in the empty state doesn't refresh the view and show your subscriptions. I can follow up on that. |
Proposed Changes
Why are these changes being made?
Testing Instructions
Pre-merge Checklist