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

Add link to reader profile on /me page #99064

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

artemiomorales
Copy link
Contributor

Related to #99015
Additional context here: p1738106541068789-slack-C083J8DHLLD

Proposed Changes

Adds a link and description to the reader profile on the /me page.

Why are these changes being made?

We'd like to provide an easily accessible link to users so they can see their reader user profiles.

Testing Instructions

  • Go to the /me page
  • Ensure the new link exists
  • Ensure the correct username is being used
  • Make sure the link works as expected

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)?

@artemiomorales artemiomorales marked this pull request as ready for review January 29, 2025 21:05
@artemiomorales artemiomorales requested a review from a team January 29, 2025 21:05
@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 Jan 29, 2025
@matticbot
Copy link
Contributor

matticbot commented Jan 29, 2025

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

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

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/profile-link-on-me-page on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Jan 29, 2025

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

Sections (~196 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
site-blocks                 +790 B  (+0.1%)     +196 B  (+0.1%)
security                    +790 B  (+0.1%)     +196 B  (+0.1%)
purchases                   +790 B  (+0.0%)     +196 B  (+0.0%)
privacy                     +790 B  (+0.1%)     +196 B  (+0.1%)
notification-settings       +790 B  (+0.1%)     +196 B  (+0.1%)
me                          +790 B  (+0.1%)     +196 B  (+0.1%)
help                        +790 B  (+0.1%)     +196 B  (+0.1%)
developer                   +790 B  (+0.1%)     +196 B  (+0.1%)
account-close               +790 B  (+0.1%)     +196 B  (+0.1%)
account                     +790 B  (+0.1%)     +196 B  (+0.1%)

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.
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.

Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

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

Just a small comment below wrt the link staying in the same environment, but this looks good and works for me.

Comment on lines 137 to 138
a: <a href={ profileUrl }></a>,
url: <>{ profileUrl }</>,
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo Jan 30, 2025

Choose a reason for hiding this comment

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

I think using the https://wordpress.com bit in the visible URL makes sense for the users perception. But for the anchor href i might simply go with /read/users/${username}, that way if we are doing a walkthrough or testing on a testing environment like horizon, calypso.live, or localhost, the link moves us to the profile but keeps us in the same environment (instead of pushing us back to production).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! That's been updated.

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.

Looks and works great. Nicely done.

@@ -40,6 +40,11 @@ class Profile extends Component {
};

render() {
// We want to use a relative URL so we can test effectively in each
// environement, but show the absolute URL in the UI for end users.
const relativeProfileUrl = `/read/users/${ this.props.user.username }`;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const relativeProfileUrl = `/read/users/${ this.props.user.username }`;
const relativeProfileUrl = getUserProfileUrl( this.props.user.username );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants