Skip to content

Reader onboarding: update profile complete criteria and Gravatar status #103602

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

Merged
merged 7 commits into from
May 22, 2025

Conversation

allilevine
Copy link
Member

@allilevine allilevine commented May 21, 2025

Fixes https://linear.app/a8c/issue/CML-497/no-link-back-to-reader

Proposed Changes

  • Change the profile complete criteria: as long as they've filled in at least one field, show a success notice.
  • Update has_gravatar to true when avatar is updated, and show a success notice.
  • Prevent the normal settings saved success notice from showing when the URL includes ref=reader-onboarding.
Screenshot 2025-05-21 at 3 35 14 PM

Why are these changes being made?

  • So that the user can get back to the Reader.

Testing Instructions

  • Make a new account and confirm your email
  • Go to the Reader to start the onboarding
  • On the third step, click "Add your avatar and fill out your profile"
  • Upload an avatar. You should see a success notice.
  • Edit your name or about description and click "Save profile details."
  • You should see a success notice that links back to the Reader.
  • Click to return to the Reader.

Note that the success notice will show even if you delete your Gravatar image, because that's also a change, but that's unlikely to be the case for someone in Reader Onboarding.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@allilevine allilevine self-assigned this May 21, 2025
Copy link

github-actions bot commented May 21, 2025

@@ -13,7 +13,7 @@ import { isProfileComplete } from './utils';

function dispatchNotice( dispatch: Store[ 'dispatch' ] ) {
dispatch(
successNotice( translate( 'Profile complete!' ), {
successNotice( translate( 'Settings saved!' ), {
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the wording here to reflect that your profile may not be 100% complete.

@matticbot
Copy link
Contributor

matticbot commented May 21, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/me-link-back-to-reader on your sandbox.

@@ -40,11 +40,7 @@ export const dispatchProfileCompleteNotice = ( store: Store, action: UnknownActi
...state.userSettings.settings,
...( typeof action.settingValues === 'object' ? action.settingValues : {} ),
};
const gravatarDetails = {
...state.gravatarStatus,
gravatarDetails: { has_gravatar: !! state.gravatarStatus.tempImage },
Copy link
Member Author

Choose a reason for hiding this comment

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

We may not have a tempImage, and we don't want to overwrite true if the avatar has been added.

@matticbot
Copy link
Contributor

matticbot commented May 21, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~378 bytes removed 📉 [gzipped])

name                    parsed_size           gzip_size
entry-main                   -739 B  (-0.0%)     -171 B  (-0.0%)
entry-subscriptions          -303 B  (-0.0%)     -302 B  (-0.1%)
entry-domains-landing        -252 B  (-0.0%)      -57 B  (-0.0%)
entry-dashboard-dotcom       -252 B  (-0.0%)      -57 B  (-0.0%)
entry-dashboard-a4a          -252 B  (-0.0%)      -57 B  (-0.0%)
entry-browsehappy            -252 B  (-0.1%)      -57 B  (-0.1%)
entry-stepper                -144 B  (-0.0%)      -19 B  (-0.0%)
entry-reauth-required         -91 B  (-0.0%)      +47 B  (+0.0%)
entry-login                   -91 B  (-0.0%)      +47 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~241262 bytes added 📈 [gzipped])

name                        parsed_size           gzip_size
purchases                       +2257 B  (+0.1%)    -2054 B  (-0.3%)
site-blocks                     +1858 B  (+0.3%)     -215 B  (-0.1%)
security                        +1858 B  (+0.2%)     -508 B  (-0.2%)
privacy                         +1858 B  (+0.3%)     -499 B  (-0.3%)
notification-settings           +1858 B  (+0.3%)     -805 B  (-0.4%)
me                              +1858 B  (+0.4%)      -94 B  (-0.1%)
help                            +1858 B  (+0.3%)     -475 B  (-0.3%)
developer                       +1858 B  (+0.3%)     -667 B  (-0.4%)
account-close                   +1858 B  (+0.3%)     -284 B  (-0.2%)
account                         +1858 B  (+0.3%)     -628 B  (-0.3%)
checkout                         -273 B  (-0.0%)    -1381 B  (-0.3%)
a8c-for-agencies-client          -209 B  (-0.0%)    -1363 B  (-0.2%)
site-purchases                   +178 B  (+0.0%)    -1537 B  (-0.3%)
home                             -103 B  (-0.0%)     -432 B  (-0.1%)
backup                            -93 B  (-0.0%)     -599 B  (-0.2%)
a8c-for-agencies-sites            -93 B  (-0.0%)     -599 B  (-0.1%)
signup                            -26 B  (-0.0%)      -38 B  (-0.1%)
async-step-unified-plans          -26 B  (-0.0%)      -12 B  (-0.0%)
async-step-unified-domains        -26 B  (-0.0%)      -22 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~1017 bytes added 📈 [gzipped])

name                                       parsed_size           gzip_size
async-load-automattic-help-center-stepper       +196 B  (+0.0%)     +992 B  (+0.4%)
async-load-automattic-help-center               +196 B  (+0.0%)     +992 B  (+0.6%)
async-load-calypso-blocks-cookie-banner          +53 B  (+0.3%)      +25 B  (+0.4%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@allilevine allilevine marked this pull request as ready for review May 21, 2025 19:43
@allilevine allilevine requested a review from a team as a code owner May 21, 2025 19:43
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 21, 2025
@allilevine allilevine requested a review from Copilot May 21, 2025 19:54
@davemart-in
Copy link
Contributor

Just tested this. @allilevine I'm now seeing a double notification anytime I save (after coming from the onboarding flow):

CleanShot 2025-05-21 at 15 54 24@2x

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR relaxes the reader onboarding profile-complete check to succeed if any profile field or a Gravatar exists, and ensures a success notice is shown when the avatar is updated.

  • Change isProfileComplete to use || instead of &&, so filling a single field or uploading an avatar counts as complete.
  • Update the onboarding handler to listen for GRAVATAR_DETAILS_RECEIVE and adjust notice text.
  • Add receiveGravatarDetails dispatch in the Gravatar editor component and update tests.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
client/state/reader/onboarding/utils.ts Switched profile-complete criteria from all fields (&&) to any (`
client/state/reader/onboarding/handlers.ts Updated action type to GRAVATAR_DETAILS_RECEIVE and notice message.
client/state/data-layer/wpcom/gravatar-upload/index.js Registered dispatchProfileCompleteNotice on GRAVATAR_DETAILS_RECEIVE.
client/blocks/edit-gravatar/index.jsx Added receiveGravatarDetails prop dispatch on avatar update.
client/blocks/edit-gravatar/test/index.jsx Updated test to expect receiveGravatarDetails call.
Comments suppressed due to low confidence (2)

client/state/reader/onboarding/handlers.ts:14

  • [nitpick] The notice ID reader-profile-complete no longer matches the updated message Profile updated!; consider renaming the ID to something like reader-profile-updated for clarity and consistency.
id: 'reader-profile-complete',

client/state/reader/onboarding/utils.ts:8

  • The new logic in isProfileComplete (allowing any single field or has_gravatar) isn't covered by existing unit tests; consider adding tests for cases where only one profile field or only the gravatar flag is set.
settings.last_name ||

@allilevine
Copy link
Member Author

Just tested this. @allilevine I'm now seeing a double notification anytime I save (after coming from the onboarding flow):

@davemart-in That's expected, unfortunately -- we're adding this extra notice when coming from the onboarding flow, but we also always show a notice when you save your user settings. It's triggered after our notice, so it's difficult to remove. I can try a couple more things but I don't want to prevent that notice from showing up normally.

@allilevine
Copy link
Member Author

Just tested this. @allilevine I'm now seeing a double notification anytime I save (after coming from the onboarding flow):

@davemart-in That's expected, unfortunately -- we're adding this extra notice when coming from the onboarding flow, but we also always show a notice when you save your user settings. It's triggered after our notice, so it's difficult to remove. I can try a couple more things but I don't want to prevent that notice from showing up normally.

@davemart-in I had an idea and added a check for the url param in the settings data layer. It's mixing concerns but it'll prevent the second notice.

@allilevine allilevine requested a review from davemart-in May 21, 2025 20:52
Copy link
Contributor

@davemart-in davemart-in left a comment

Choose a reason for hiding this comment

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

Tested again. Works as expected this time. Thanks!

@allilevine allilevine force-pushed the fix/me-link-back-to-reader branch from 5d309e9 to e6e5df7 Compare May 22, 2025 13:29
@allilevine allilevine merged commit f6a70ef into trunk May 22, 2025
11 checks passed
@allilevine allilevine deleted the fix/me-link-back-to-reader branch May 22, 2025 14:07
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 22, 2025
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.

3 participants