Skip to content

fix profile loading#109

Merged
sunithvs merged 1 commit intosunithvs:mainfrom
fariqueparammel:fix-view-profile-loading
Sep 20, 2025
Merged

fix profile loading#109
sunithvs merged 1 commit intosunithvs:mainfrom
fariqueparammel:fix-view-profile-loading

Conversation

@fariqueparammel
Copy link
Copy Markdown
Contributor

Summary

View profile buttong used to freeze till next page is being reloaded. So, added a function to show loading animation till the new page is loaded.

Description

fix profile loading by adding a new function to show loading animation while its being redirected

Motivation and Context

immediate fix for indiafoss 2025

How has this been tested?

manually tested.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Sep 19, 2025

@fariqueparammel is attempting to deploy a commit to the lamsta Team on Vercel.

A member of the Team first needs to authorize it.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @fariqueparammel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the UI would freeze when clicking the 'View Profile' button in the GitHub modal. By implementing a loading state and a visual spinner, the change provides immediate feedback to the user during page navigation, significantly enhancing the perceived responsiveness and overall user experience.

Highlights

  • Loading State Implementation: A new loading state has been introduced using useState to manage the visual feedback during profile redirection.
  • Profile Redirection Function: A dedicated asynchronous function, redirectToProfilePage, was added to handle the navigation to the user's profile, ensuring the loading state is activated before the page transition.
  • Enhanced User Interface: The 'View Profile' button now displays a spinner animation and is disabled while the page is loading, preventing UI freezes and improving user experience.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively resolves a UI freeze by introducing a loading state during profile page navigation. The implementation is clean and directly addresses the issue. My review includes a minor suggestion to optimize the new function definition, aligning it with React best practices for performance and consistency already present in the component.

Comment on lines +46 to +52
const redirectToProfilePage = async () => {
if (!profile) return;
setLoading(true);
await router.push(`/${profile?.login}?ref=modal`);

// no need to setLoading(false) because navigation will replace this page
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This function is redefined on every render. To optimize performance and maintain consistency with other memoized callbacks in this component (e.g., validateGithubUsername), you should wrap redirectToProfilePage in useCallback.

Also, the optional chaining in profile?.login is redundant due to the if (!profile) check above it. Removing it will make the code slightly cleaner.

Suggested change
const redirectToProfilePage = async () => {
if (!profile) return;
setLoading(true);
await router.push(`/${profile?.login}?ref=modal`);
// no need to setLoading(false) because navigation will replace this page
};
const redirectToProfilePage = useCallback(async () => {
if (!profile) return;
setLoading(true);
await router.push(`/${profile.login}?ref=modal`);
// no need to setLoading(false) because navigation will replace this page
}, [profile, router]);

@sunithvs sunithvs merged commit fc10282 into sunithvs:main Sep 20, 2025
1 check failed
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.

2 participants