Skip to content

🎨 Palette: Add loading state feedback to Login form#37

Open
BilalkhanIO wants to merge 1 commit intomainfrom
palette-login-ux-improvement-11625164005394565080
Open

🎨 Palette: Add loading state feedback to Login form#37
BilalkhanIO wants to merge 1 commit intomainfrom
palette-login-ux-improvement-11625164005394565080

Conversation

@BilalkhanIO
Copy link
Owner

@BilalkhanIO BilalkhanIO commented Feb 6, 2026

💡 What: The UX enhancement added

Added an isLoading state to the Login component that:

  1. Disables the "Login" button upon submission.
  2. Changes the button text to "Logging in..." to provide feedback.
  3. Uses a simulated 1.5s delay with proper useRef and useEffect cleanup.
  4. Added :disabled and :hover:not(:disabled) styles to Login.css.

🎯 Why: The user problem it solves

Users need immediate feedback that their action is being processed. Without it, they might click the button multiple times or wonder if the app has frozen.

♿ Accessibility: Any a11y improvements made

  • Added visual cues (opacity, cursor: not-allowed) for the disabled state.
  • Prevented hover effects on disabled buttons to avoid confusion.
  • The text change provides a status update for the action.

PR created automatically by Jules for task 11625164005394565080 started by @BilalkhanIO

Summary by CodeRabbit

  • New Features

    • Login button now displays loading state during authentication with dynamic text changes ("Login" to "Logging in...")
    • Button becomes disabled during the login process
  • Style

    • Updated disabled button styling with reduced opacity and cursor indicator
  • Documentation

    • Added UX/Accessibility learnings on form feedback patterns and disabled interactive element styling

Implemented a loading state for the login button to provide immediate
user feedback and prevent duplicate form submissions. Added visual
feedback for disabled buttons in CSS and ensured proper React hook
cleanup for the simulated request.

Co-authored-by: BilalkhanIO <48455259+BilalkhanIO@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 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.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

Adds documentation about UX accessibility patterns for asynchronous form feedback and disabled element styling. Implements asynchronous login simulation in the Login component with a loading state, disabled button behavior, and updated UI feedback. Updates button CSS to prevent hover effects when disabled.

Changes

Cohort / File(s) Summary
Documentation
.Jules/palette.md
Added journal entries documenting two UX/accessibility learnings: asynchronous form feedback patterns with immediate visual feedback and disabled element styling with hover safeguards.
Login Component
fy-project/src/components/Login/Login.jsx, fy-project/src/components/Login/Login.css
Implemented async form feedback: added loading state via useRef and useEffect for timeout management, button disabled state during async operation with text toggle ("Login" / "Logging in..."), and updated CSS to prevent hover styles on disabled buttons and add explicit disabled styling (opacity 0.7, cursor not-allowed).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A button learns to pause and wait,
With async grace, it shields its fate,
Disabled hover, cleanup care—
The form now shows what's loading there! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title references a related change (CSS styling for disabled states) documented in the Palette journal, but the primary focus is the loading state feedback implementation in the Login component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch palette-login-ux-improvement-11625164005394565080

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@fy-project/src/components/Login/Login.jsx`:
- Around line 29-38: In handleSubmit, remove the plaintext password from the
console logging (or remove the console.log entirely) so credentials are not
written to the browser console; instead log only non-sensitive info (e.g., email
or a generic "login attempt") using the existing setIsLoading and timeoutRef
logic. Also add an early guard at the top of handleSubmit that returns
immediately if isLoading is true to prevent duplicate submissions. Ensure you
update the function that sets timeoutRef.current and uses setIsLoading so it
respects the new early-return guard.

Comment on lines 29 to 38
const handleSubmit = (event) => {
event.preventDefault();
// Perform login validation
console.log("Logging in with email:", email, " and password:", password);
setIsLoading(true);

// Simulate login validation
timeoutRef.current = setTimeout(() => {
setIsLoading(false);
console.log("Logging in with email:", email, " and password:", password);
}, 1500);
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Security: Do not log the password to the console.

Line 36 logs the user's password in plaintext via console.log. Even in a simulation, this is a credential leak to the browser console (visible to browser extensions, shared machines, etc.) and sets a bad precedent. Remove the password from the log, or remove the log entirely.

Additionally, consider adding an early return if isLoading is already true to guard against programmatic re-submissions (though the disabled button covers normal clicks).

Proposed fix
 const handleSubmit = (event) => {
   event.preventDefault();
+  if (isLoading) return;
   setIsLoading(true);

   // Simulate login validation
   timeoutRef.current = setTimeout(() => {
     setIsLoading(false);
-    console.log("Logging in with email:", email, " and password:", password);
+    // TODO: Replace with actual authentication API call
+    console.log("Login submitted for:", email);
   }, 1500);
 };
🤖 Prompt for AI Agents
In `@fy-project/src/components/Login/Login.jsx` around lines 29 - 38, In
handleSubmit, remove the plaintext password from the console logging (or remove
the console.log entirely) so credentials are not written to the browser console;
instead log only non-sensitive info (e.g., email or a generic "login attempt")
using the existing setIsLoading and timeoutRef logic. Also add an early guard at
the top of handleSubmit that returns immediately if isLoading is true to prevent
duplicate submissions. Ensure you update the function that sets
timeoutRef.current and uses setIsLoading so it respects the new early-return
guard.

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