Skip to content

fix: Server credentials input ux#216

Merged
rodonisi merged 8 commits into
rodonisi:mainfrom
BothaGideon:enhancement/fix-server-credentials-input-ux
Jun 19, 2026
Merged

fix: Server credentials input ux#216
rodonisi merged 8 commits into
rodonisi:mainfrom
BothaGideon:enhancement/fix-server-credentials-input-ux

Conversation

@BothaGideon

Copy link
Copy Markdown
Contributor

A few enhancements, bugfixes and UX updates:

  • Fixed a bug where saving invalid credentials still showed the logged-in user - auth errors now correctly display a red ✕ and "Invalid credentials".
  • Disabled the Save button while a login request is in progress.
  • Refactored the credentials form for a stable widget lifecycle and cleaner state management.
  • Added spinner loading animation when processing requests for library syncs

Credentials journey

BEFORE:

Screen.Recording.2026-06-18.at.13.17.45.mp4

AFTER:

Screen.Recording.2026-06-18.at.13.18.41.mp4
Simulator Screenshot - iPhone 17 - 2026-06-18 at 13 11 46 Simulator Screenshot - iPhone 17 - 2026-06-18 at 13 11 42 Simulator Screenshot - iPhone 17 - 2026-06-18 at 13 11 33

BothaGideon and others added 3 commits June 18, 2026 10:33
Refactor `CredentialsSettings` into smaller, focused widgets to enhance maintainability and readability.

Improve the display of login status within the form, providing clearer feedback for loading, error, and successful login states, including a visual confirmation. The "Save" button is now explicitly disabled while a login attempt is in progress.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uses `maybeWhen` to explicitly handle `AsyncValue` states (loading, error) for user and server data. This improves UI stability by preventing potential issues with `valueOrNull` during state transitions on the credentials settings page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously, the catch block in CurrentUser.build() returned the cached
user state on any error, masking authentication failures. When a user
saved invalid credentials, the UI continued showing the green checkmark
and logged-in user instead of the error state.

- Remove the try/catch that swallowed auth errors with stale state
- Auth errors now propagate correctly, setting currentUserProvider to
  AsyncError, which causes loginStatus to return .error
- UI correctly shows red ✕ and 'Invalid credentials' label

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BothaGideon BothaGideon changed the title Fix: Server credentials input ux fix: Server credentials input ux Jun 18, 2026

@rodonisi rodonisi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ohh quite nice you're tackling this, thanks! I've been putting away improving the login form for a while now :)

I've left some minor comments that could addressed

Comment thread ios/Podfile.lock Outdated
Comment thread lib/pages/settings/credentials_settings.dart Outdated
Comment thread lib/riverpod/providers/auth.dart
Comment thread lib/pages/settings/credentials_settings.dart Outdated
BothaGideon and others added 3 commits June 18, 2026 20:56
Synchronize iOS dependencies, including workmanager_apple, to reflect
potential changes or updates made during development on this branch.
When the app launches offline, network errors (SocketException,
TimeoutException) now fail immediately instead of retrying 3 times.
This preserves the instant offline UX that existed before the invalid
credentials fix.

The retry logic now distinguishes between:
- Network errors (offline) → fail fast, no retries
- Missing credentials → fail fast, no retries
- Transient server errors (5xx) → retry up to 3 times

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BothaGideon

Copy link
Copy Markdown
Contributor Author

@rodonisi Fixed the shorthands and checked the offline abilities. Please let me know if this is sufficient!

@rodonisi

Copy link
Copy Markdown
Owner

Thanks a lot, LGTM :)

Comment thread lib/pages/settings/credentials_settings.dart Outdated
Comment thread lib/pages/settings/credentials_settings.dart Outdated
@rodonisi rodonisi added the fix Fix implementation label Jun 18, 2026
@rodonisi rodonisi enabled auto-merge (squash) June 19, 2026 09:58
@rodonisi rodonisi merged commit 81fce90 into rodonisi:main Jun 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants