-
-
Notifications
You must be signed in to change notification settings - Fork 13.5k
๐ style: improve auth sign in loading #8805
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideIntroduces loading state management for OAuth sign-in buttons, showing a spinner on the active provider during sign-in to improve UX. Class diagram for updated AuthSignInBox component loading stateclassDiagram
class AuthSignInBox {
+useState<string | null> loadingProvider
+handleSignIn(provider: string)
+setLoadingProvider(provider: string | null)
}
AuthSignInBox --> OAuthProviderButton : renders
class OAuthProviderButton {
+loading: boolean
+onClick: () => void
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
๐ @arvinxx Thank you for raising your pull request and contributing to our Community |
TestGru AssignmentSummary
Tip You can |
Claude finished @arvinxx's task โโ View job Code ReviewReview Checklist
SummaryThis PR adds loading state management to the OAuth sign-in buttons, improving user experience by providing visual feedback during the authentication process. Changes OverviewThe PR introduces:
โ Strengths
๐ Suggestions for Improvement1. Prevent Multiple Simultaneous Sign-insCurrently, users can click other provider buttons while one is loading. Consider disabling all buttons during sign-in: <Button
className={styles.button}
icon={AuthIcons(provider, 16)}
key={provider}
loading={loadingProvider === provider}
disabled={loadingProvider !== null} // Disable all buttons when any is loading
onClick={() => handleSignIn(provider)}
>
{provider}
</Button> 2. Consider Edge CasesThe loading state might not reset if the const handleSignIn = async (provider: string) => {
setLoadingProvider(provider);
const timeoutId = setTimeout(() => {
setLoadingProvider(null);
}, 30000); // 30 second timeout
try {
await signIn(provider, { redirectTo: callbackUrl });
clearTimeout(timeoutId);
} catch (error) {
clearTimeout(timeoutId);
setLoadingProvider(null);
// ... rest of error handling
}
}; ๐ Potential IssuesNone identified. The implementation is straightforward and follows React best practices. โก Performance ConsiderationsNo performance concerns. The state update is minimal and only affects the UI rendering of the buttons. ๐ Security ConsiderationsNo security issues identified. The loading state is purely cosmetic and doesn't affect the authentication flow security. ๐งช Test CoverageConsider adding tests for:
VerdictLGTM! ๐ This is a clean, focused improvement to the authentication UX. The suggestions above are optional enhancements that could further improve the robustness of the implementation. |
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.
Codecov Reportโ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8805 +/- ##
========================================
Coverage 85.58% 85.58%
========================================
Files 935 935
Lines 72792 72792
Branches 6577 6811 +234
========================================
Hits 62296 62296
Misses 10496 10496
Flags with carried forward coverage won't be shown. Click here to find out more. โ View full report in Codecov by Sentry. ๐ New features to boost your workflow:
|
โค๏ธ Great PR @arvinxx โค๏ธ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
### [Version 1.112.1](v1.112.0...v1.112.1) <sup>Released on **2025-08-16**</sup> #### ๐ Styles - **misc**: Add Imagen 4 GA models, style improve auth sign in box loading. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Add Imagen 4 GA models, closes [#8799](#8799) ([2e9ad20](2e9ad20)) * **misc**: Style improve auth sign in box loading, closes [#8805](#8805) ([62f5a1b](62f5a1b)) </details> <div align="right"> [](#readme-top) </div>
๐ This PR is included in version 1.112.1 ๐ The release is available on: Your semantic-release bot ๐ฆ๐ |
## [Version 1.113.0](v1.112.0...v1.113.0) <sup>Released on **2025-08-18**</sup> #### โป Code Refactoring - **misc**: Refactor const folder to a new package, refactor prompts folder to the `@lobechat/prompts` pacakge, ้ๆArgsInput็ปไปถ. #### โจ Features - **provider**: Add BFL provider support for image generation. #### ๐ Bug Fixes - **db**: Desktop local db can't vectorization. - **misc**: Improve mcp tracing with user config. #### ๐ Styles - **misc**: Add Imagen 4 GA models, style improve auth sign in box loading. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Refactor const folder to a new package, closes [lobehub#8756](https://github.com/jaworldwideorg/OneJA-Bot/issues/8756) ([30a4734](30a4734)) * **misc**: Refactor prompts folder to the `@lobechat/prompts` pacakge, closes [lobehub#8810](https://github.com/jaworldwideorg/OneJA-Bot/issues/8810) ([d82e7bb](d82e7bb)) * **misc**: ้ๆ ArgsInput ็ปไปถ, closes [lobehub#8765](https://github.com/jaworldwideorg/OneJA-Bot/issues/8765) ([0905559](0905559)) #### What's improved * **provider**: Add BFL provider support for image generation, closes [lobehub#8806](https://github.com/jaworldwideorg/OneJA-Bot/issues/8806) ([519e03e](519e03e)) #### What's fixed * **db**: Desktop local db can't vectorization, closes [lobehub#8830](https://github.com/jaworldwideorg/OneJA-Bot/issues/8830) ([a00fd9d](a00fd9d)) * **misc**: Improve mcp tracing with user config, closes [lobehub#8827](https://github.com/jaworldwideorg/OneJA-Bot/issues/8827) ([5cab2ee](5cab2ee)) #### Styles * **misc**: Add Imagen 4 GA models, closes [lobehub#8799](https://github.com/jaworldwideorg/OneJA-Bot/issues/8799) ([2e9ad20](2e9ad20)) * **misc**: Style improve auth sign in box loading, closes [lobehub#8805](https://github.com/jaworldwideorg/OneJA-Bot/issues/8805) ([62f5a1b](62f5a1b)) </details> <div align="right"> [](#readme-top) </div>
๐ป ๅๆด็ฑปๅ | Change Type
๐ ๅๆด่ฏดๆ | Description of Change
๐ ่กฅๅ ไฟกๆฏ | Additional Information
Summary by Sourcery
Enhancements: