Skip to content

Fix login page loading#6499

Merged
IKarbowiak merged 6 commits into
mainfrom
fix-login-page-loading
Apr 13, 2026
Merged

Fix login page loading#6499
IKarbowiak merged 6 commits into
mainfrom
fix-login-page-loading

Conversation

@IKarbowiak
Copy link
Copy Markdown
Member

Scope of the change

  • I confirm I added ripples for changes (see src/ripples) or my feature doesn't contain any user-facing changes
  • I used analytics "trackEvent" for important events

@IKarbowiak IKarbowiak self-assigned this Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 11:23
@IKarbowiak IKarbowiak requested a review from a team as a code owner April 9, 2026 11:23
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: a854b6c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.80%. Comparing base (a91bfa6) to head (a854b6c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6499   +/-   ##
=======================================
  Coverage   47.79%   47.80%           
=======================================
  Files        2581     2581           
  Lines       45451    45456    +5     
  Branches    10704    10675   -29     
=======================================
+ Hits        21724    21730    +6     
+ Misses      22490    22489    -1     
  Partials     1237     1237           
Flag Coverage Δ
storybook 43.07% <ø> (ø)
units 43.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

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 improves the login UX by avoiding an incorrect “no login method available” empty-state while the login page is still determining which authentication methods are enabled/available.

Changes:

  • Render a spinner (instead of the empty-state message) while auth configuration is loading and no login methods are known yet.
  • Add a changeset entry documenting the patch change.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/auth/components/LoginPage/LoginPage.tsx Adds a loading-state spinner in the “no login method” area while auth config is still loading.
.changeset/cool-trains-fetch.md Records the patch-level UX fix in the changelog.

Comment thread src/auth/components/LoginPage/LoginPage.tsx Outdated
Comment thread src/auth/components/LoginPage/LoginPage.tsx Outdated
lkostrowski
lkostrowski previously approved these changes Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 09:19
Copy link
Copy Markdown
Contributor

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

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

Comment on lines +144 to +154
{!passwordLoginEnabled &&
(!externalAuthentications || externalAuthentications.length === 0) &&
(loading || !externalAuthentications ? (
<Box
display="flex"
justifyContent="center"
width="100%"
data-test-id="login-methods-loading"
>
<Spinner aria-label="Loading login methods" />
</Box>
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The spinner is rendered whenever externalAuthentications is undefined, even when loading is false. In cases where the query is skipped or errors out (so the list never becomes defined), this can result in a permanent loading indicator and no actionable feedback. Consider rendering the spinner only while loading is true, and falling back to the empty-state (or a dedicated error state) once loading has finished but the methods list is still missing.

Copilot uses AI. Check for mistakes.
@IKarbowiak IKarbowiak requested a review from lkostrowski April 10, 2026 09:30
witoszekdev
witoszekdev previously approved these changes Apr 10, 2026
width="100%"
data-test-id="login-methods-loading"
>
<Spinner aria-label="Loading login methods" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick: this could use intl.formattedMessage for translations

Comment on lines +144 to +146
{!passwordLoginEnabled &&
(!externalAuthentications || externalAuthentications.length === 0) &&
(loading || !externalAuthentications ? (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this condition got pretty complicated, maybe we could refactor this into something easier to understand?

e.g.

const hasExternalAuthentications = ...
const showLoadingState = ...

it also looks like we check externalAuthentications twice:

!externalAuthentications ...
(loading || !externalAuthentications ?

Copilot AI review requested due to automatic review settings April 13, 2026 08:26
Copy link
Copy Markdown
Contributor

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

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

Comment on lines +47 to +52
const hasExternalAuthentications = (externalAuthentications?.length ?? 0) > 0;
const isLoadingLoginMethods = loading || !externalAuthentications;
const showLoginMethodsSpinner =
!passwordLoginEnabled && !hasExternalAuthentications && isLoadingLoginMethods;
const showPasswordLoginDisabledMessage =
!passwordLoginEnabled && !hasExternalAuthentications && !isLoadingLoginMethods;
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

isLoadingLoginMethods treats externalAuthentications being undefined as “loading” even when the loading prop is false. This can result in a spinner that never resolves if the caller ends up with data === undefined and loading === false (e.g. GraphQL error, skipped query, or aborted request). Consider relying solely on the loading prop (and pass it correctly from the parent), or introduce an explicit "login methods loaded"/"login methods error" signal so the UI can fall back to an empty/error state instead of a perpetual spinner.

Copilot uses AI. Check for mistakes.
@IKarbowiak IKarbowiak requested a review from witoszekdev April 13, 2026 10:46
@IKarbowiak IKarbowiak merged commit b652a58 into main Apr 13, 2026
21 of 22 checks passed
@IKarbowiak IKarbowiak deleted the fix-login-page-loading branch April 13, 2026 12:19
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.

4 participants