Skip to content

🎨 Palette: Add async loading states to authentication forms#165

Open
singhaditya21 wants to merge 1 commit into
mainfrom
palette/async-loading-states-11746497168856005904
Open

🎨 Palette: Add async loading states to authentication forms#165
singhaditya21 wants to merge 1 commit into
mainfrom
palette/async-loading-states-11746497168856005904

Conversation

@singhaditya21

Copy link
Copy Markdown
Owner

💡 What

Added proper loading states (disabled, text change to "⏳ Loading...", and aria-busy="true") to the authentication form buttons (Login, Register, and Google Sign-in) while they wait for asynchronous API calls to complete.

🎯 Why

Users were experiencing a lack of visual feedback during the mock API delay when signing in or registering. This caused confusion and allowed for potential double-submissions if users clicked the buttons multiple times before the async request finished.

📸 Before/After

  • Before: Clicking 'Sign In' did nothing visually until the request completed, leaving the user guessing and the button clickable.
  • After: Clicking 'Sign In' immediately disables the button, changes the text to "⏳ Loading...", and applies aria-busy="true". The original state is reliably restored whether the request succeeds or fails.

♿ Accessibility

Added aria-busy="true" dynamically to the buttons during the loading state, informing screen readers that the element is currently processing an action and the user should wait.


PR created automatically by Jules for task 11746497168856005904 started by @singhaditya21

- Adds "⏳ Loading..." text, disabled state, and `aria-busy` to login, register, and Google sign-in buttons during async API calls.
- Ensures state is reliably restored in `finally` blocks, gracefully handling potential API errors.
- Modifies `handleGoogleSignIn` to correctly process the simulated async delay as an awaitable Promise instead of a floating `setTimeout`.
- Improves accessibility and prevents duplicate submissions.

Co-authored-by: singhaditya21 <53948039+singhaditya21@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant