Skip to content

Conversation

@najuna-brian
Copy link
Contributor

@najuna-brian najuna-brian commented Jan 1, 2026

Problem

UX issue: The login button remained gray/disabled when returning to the Settings screen while already logged in.
Closes #141

Solution

  • Added as const assertions to style properties in Alert button configurations to fix TypeScript type inference
  • Added initialUsername and initialPassword state tracking alongside existing initialServerUrl
  • Login button is now disabled (grey) when:
    • User is already logged in AND
    • Credentials (server URL, username, password) haven't changed from saved values
  • Login button is enabled (green) when:
    • Not logged in, OR
    • Any credential field has been modified

Changes

  • formulus/src/screens/SettingsScreen.tsx

Testing

  1. Log in with valid credentials → navigates to home
  2. Return to Settings screen → login button should be grey/disabled
  3. Modify any field (server URL, username, or password) → button turns green/enabled
  4. Revert changes back to original → button turns grey/disabled again

Copy link
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this! Hmm.. are we sure we want the check for hasCredentialsChanged? I think that the button should still be active even when there are no changes (eg. when the auth token has expired, but the creds are the same) ❓

@najuna-brian
Copy link
Contributor Author

Good point! I've removed the hasCredentialsChanged check ☺️

@najuna-brian najuna-brian requested a review from r0ssing January 1, 2026 20:18
Copy link
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

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

Looks great! I will test it manually asap! 😄

@najuna-brian najuna-brian merged commit aeb440d into OpenDataEnsemble:dev Jan 2, 2026
8 checks passed
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.

[Formulus] Login button appears inactive (styling)

2 participants