Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Fix: Memoize user profile for performance improvement #5158

Merged

Conversation

psavan1655
Copy link
Contributor

@psavan1655 psavan1655 commented Feb 28, 2023

Fixes Issue

Closes #5003

Changes proposed

  • Navigating to different tabs ("My Links", "Milestones", .... ) in user profile. Top hero section of user flickers.
  • Cause: As navigating to different tabs cause re-rendering of userProfile component.
  • Solution: Memoize userProfile component, as user data doesn't change on a simple tab change. So no need to re-render component on every change.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

https://www.loom.com/share/c0b4d8c001734d86931668b43d53e51f

Note to reviewers

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

It's great having you contribute to this project

Welcome to the community 🤓

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord chat and our GitHub Organisation - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.

@github-actions github-actions bot added the small Pull request with less than 10 changed lines label Feb 28, 2023
@github-actions
Copy link
Contributor

Welcome @psavan1655! Thank you so much for your first pull request!

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@eddiejaoude eddiejaoude merged commit 47e124a into EddieHubCommunity:main Mar 1, 2023
@FrozenHearth
Copy link
Contributor

Hi @psavan1655
One edge case got missed. When clicking on the sort icon in the My Links tab in the profile page, the flickering still happens.

@github-actions
Copy link
Contributor

Reviewpad Report

📜 Executed actions

$addLabel("small")
$removeLabels(["medium", "large"])
$commentOnce($sprintf("Welcome @%v! Thank you so much for your first pull request!", [$author()]))

@psavan1655
Copy link
Contributor Author

Hi @FrozenHearth, Thanks for pointing out, WIll surely take a look into it.

@eddiejaoude Should i work on it? I have reproduced the issue and verified it.

@eddiejaoude
Copy link
Member

Sure, but please also raise an issue (bug)

@psavan1655
Copy link
Contributor Author

#5535 Created this issue. You can assign me there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
small Pull request with less than 10 changed lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab switching on a user's page is causing the user details section to flicker
3 participants