Skip to content

Show a loading state on the login page while logging in - #1816

Merged
robertying merged 2 commits into
mainfrom
claude/project-thread-q2eanw
Nov 24, 2026
Merged

robertying merged 2 commits into
mainfrom
claude/project-thread-q2eanw

Conversation

@robertying

@robertying robertying commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Requested by Rui · project thread

While a login runs, the login page only disabled its Log In button: the fields, the graduate switch and the other buttons stayed live, and nothing showed that anything was happening.

Now, while logging in:

  • The button shows progress in each platform's own way, labeled 正在登录… / Logging in…:
    • iOS and Mac: a SwiftUI ProgressView before the label inside the filled button, in the disabled label's color (left alone it would take the accent).
    • Android: a small Material 3 CircularProgressIndicator (18 dp, the size of a button icon) in the disabled content color, before the label.
    • Windows and Linux: Fluent's loading button, a tiny Spinner as the button's icon.
  • The rest of the page is disabled and looks it: both login fields (so the password's return key can't submit again), the graduate switch and its label, Log In with Saved Account, Continue Offline and the debug Mock Network button. A disabled SwiftUI field looks like an enabled one, so the iOS fields' text takes the disabled color; on Windows and Linux the field labels dim with their fields.
  • When the login fails, the page unlocks and the existing error toast shows, as before. Nothing moves; the button only widens for the longer label.

ContainedButton gains a loading prop and LoginFields a disabled one. The @expo/ui Button test stand-in now lets content replace the label, as the real view does.

Testing

  • Jest (iOS, Android and web projects): the loading button and disabled fields on each platform, and the login page locking and unlocking with loggingIn. Full suite, typecheck, lint and format pass.
  • Run on an iPhone 18 Pro simulator, a Pixel Fold emulator and the Electron app with a slow mock login, in light and dark.

While a login runs, the login button shows a spinner with 正在登录… in
each platform's own style (SwiftUI ProgressView in the filled button,
a small M3 circular indicator, a tiny Fluent spinner as the button's
icon), and the fields, the graduate switch and the other buttons are
disabled, so nothing changes the login under a request in flight.

ContainedButton gains a `loading` prop and LoginFields a `disabled` one.
The @expo/ui Button test stand-in now lets content replace the label,
as the real view does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertying robertying self-assigned this Nov 24, 2026
A disabled SwiftUI field and a Fluent field's label look the same as
enabled ones, and the graduate switch's label isn't part of the switch,
so the page didn't show that they were locked. The iOS fields' text,
the Fluent field labels and the graduate label now take the disabled
color, and the iOS spinner takes the disabled label's color instead of
the accent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertying
robertying merged commit 76890e6 into main Nov 24, 2026
14 checks passed
@robertying
robertying deleted the claude/project-thread-q2eanw branch November 24, 2026 08:32
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