Skip to content

🎨 Palette: Improve Login UX and Navbar accessibility#36

Open
BilalkhanIO wants to merge 1 commit intomainfrom
palette/improve-login-ux-a11y-17783112272834294221
Open

🎨 Palette: Improve Login UX and Navbar accessibility#36
BilalkhanIO wants to merge 1 commit intomainfrom
palette/improve-login-ux-a11y-17783112272834294221

Conversation

@BilalkhanIO
Copy link
Owner

@BilalkhanIO BilalkhanIO commented Feb 5, 2026

This PR implements several micro-UX and accessibility improvements:

💡 What:

  • Added a loading state to the Login form to provide feedback during submission.
  • Improved the Navbar shopping cart accessibility with ARIA labels.
  • Added consistent :disabled styling for form buttons.
  • Ensured proper cleanup of asynchronous timers to avoid memory leaks.

🎯 Why:

  • The Login form felt unresponsive without feedback.
  • The shopping cart was unlabelled for screen reader users.
  • Consistency between Login and Signup flows was improved.

Accessibility:

  • Added aria-label="View shopping cart, 3 items" to the cart link.
  • Added aria-hidden="true" to decorative icons and redundant text badges.
  • Improved form button states for better screen reader and visual feedback.

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Login button now displays a "Logging in..." message and becomes disabled during submission to provide visual feedback.
  • Bug Fixes

    • Disabled buttons across login and signup now display visual indicators (reduced opacity and cursor change) to clearly show non-interactive state.
    • Shopping cart link accessibility enhanced with improved screen reader support.
  • Documentation

    • Added UX learning guidelines for common design patterns and best practices.

- Added isLoading state and cleanup to Login.jsx
- Improved login button feedback with "Logging in..." text and disabled state
- Added :disabled styles to .form__btn in Login.css and signup.css
- Prevented hover effects on disabled buttons using :not(:disabled)
- Added aria-label to Navbar cart link and aria-hidden to its contents
- Added cleanup logic to Signup.jsx for consistency

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 5, 2026

📝 Walkthrough

Walkthrough

This pull request introduces async state cleanup patterns using React hooks (useRef and useEffect), implements disabled button styling across login and signup components, adds accessibility enhancements to icon-only links, and documents UX learning patterns. Changes span CSS styling updates, component logic modifications, and accessibility improvements across the authentication and navigation components.

Changes

Cohort / File(s) Summary
Documentation
.Jules/palette.md
New file documenting three UX learning patterns: async state cleanup with useRef, disabled button hover prevention, and icon link accessibility requirements.
Login Component
fy-project/src/components/Login/Login.css, fy-project/src/components/Login/Login.jsx
Added disabled state styling with opacity and cursor properties; implemented useRef-based timeout management with cleanup effect; added loading state that disables button during simulated network delay.
Signup Component
fy-project/src/components/Signup/Signup.jsx, fy-project/src/components/Signup/signup.css
Implemented useRef-based timeout cleanup pattern; narrowed button hover selector to exclude disabled state; added disabled button styling with opacity and cursor properties.
Navigation Accessibility
fy-project/src/components/Navbar/Navbar.jsx
Enhanced shopping cart icon-link with aria-label on the anchor element and aria-hidden attributes on decorative icon and count elements for screen reader accessibility.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰✨ Our buttons now rest when disabled so true,
With timeouts cleaned up when components bid adieu,
Aria-labels guide those who cannot see,
Async patterns refined—hop, skip, and spree! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title partially relates to the changeset. It mentions 'Improve Login UX' and 'Navbar accessibility', which are real aspects of the PR, but omits significant changes like Signup component improvements, async cleanup patterns, and disabled button styling — making it incomplete relative to the full scope of changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/improve-login-ux-a11y-17783112272834294221

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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
fy-project/src/components/Signup/Signup.jsx (1)

44-54: ⚠️ Potential issue | 🟠 Major

Remove credential logging from the client.
Logging password and confirmPassword is a security/PII risk and should be removed or masked.

🛡️ Suggested fix
-            console.log(
-                "Signing up with:",
-                {
-                    name,
-                    email,
-                    password,
-                    confirmPassword
-                }
-            );
+            // Avoid logging credentials in client logs
+            console.log("Signing up with:", { name, email });
🤖 Fix all issues with AI agents
In `@fy-project/src/components/Login/Login.jsx`:
- Around line 33-37: Remove the plaintext credential logging in the simulated
network request: in the setTimeout callback where timeoutRef.current is set,
eliminate the console.log that prints email and password (or if you need an
audit, only log non-sensitive info and mask the email/password, e.g., show email
domain or replace password with fixed asterisks). Update the block that calls
setIsLoading(false) inside the timeout to no longer reference or print the
password (remove console.log(email, password) and, if needed, replace with a
safe message like "Login simulated" or a masked email via the existing email
variable).

In `@fy-project/src/components/Navbar/Navbar.jsx`:
- Around line 24-26: Replace the hard-coded cart count in Navbar.jsx with a
derived value (e.g., a prop or state like cartCount) and reuse that single
variable for both the aria-label and the visible badge; update the anchor's
aria-label to include `${cartCount} items` and render the same cartCount inside
the <span className='navbar__cart_span'> so they stay synchronized (ensure the
component that renders Navbar passes or computes cartCount and that
FiShoppingBag keeps aria-hidden="true" while the span is exposed to assistive
tech).

Comment on lines +33 to +37
// Simulate a network request
timeoutRef.current = setTimeout(() => {
setIsLoading(false);
console.log("Logging in with email:", email, " and password:", password);
}, 1500); // Simulate a 1.5-second delay
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

Remove credential logging from the client.
Logging passwords (even in dev) is a security/PII risk and can leak via console capture tools. Please remove or mask sensitive fields.

🛡️ Suggested fix
-      console.log("Logging in with email:", email, " and password:", password);
+      // Avoid logging credentials in client logs
+      console.log("Logging in with email:", email);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Simulate a network request
timeoutRef.current = setTimeout(() => {
setIsLoading(false);
console.log("Logging in with email:", email, " and password:", password);
}, 1500); // Simulate a 1.5-second delay
// Simulate a network request
timeoutRef.current = setTimeout(() => {
setIsLoading(false);
// Avoid logging credentials in client logs
console.log("Logging in with email:", email);
}, 1500); // Simulate a 1.5-second delay
🤖 Prompt for AI Agents
In `@fy-project/src/components/Login/Login.jsx` around lines 33 - 37, Remove the
plaintext credential logging in the simulated network request: in the setTimeout
callback where timeoutRef.current is set, eliminate the console.log that prints
email and password (or if you need an audit, only log non-sensitive info and
mask the email/password, e.g., show email domain or replace password with fixed
asterisks). Update the block that calls setIsLoading(false) inside the timeout
to no longer reference or print the password (remove console.log(email,
password) and, if needed, replace with a safe message like "Login simulated" or
a masked email via the existing email variable).

Comment on lines +24 to +26
<a href='#addToCart' className='navbar__cart' aria-label="View shopping cart, 3 items">
<FiShoppingBag className="navbar__cart-icon" aria-hidden="true" />
<span className='navbar__cart_span' aria-hidden="true">3</span>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid hard‑coding cart count in the aria‑label and badge.
If the cart count changes, the label and badge will become inaccurate for users and assistive tech. Consider deriving the count from state/props and reusing it for both the label and the badge.

🔧 Suggested direction
-                    <a href='#addToCart' className='navbar__cart' aria-label="View shopping cart, 3 items">
-                        <FiShoppingBag className="navbar__cart-icon" aria-hidden="true" />
-                        <span className='navbar__cart_span' aria-hidden="true">3</span>
-                    </a>
+                    {/* e.g. const cartCount = props.cartCount; */}
+                    <a
+                      href='#addToCart'
+                      className='navbar__cart'
+                      aria-label={`View shopping cart, ${cartCount} items`}
+                    >
+                        <FiShoppingBag className="navbar__cart-icon" aria-hidden="true" />
+                        <span className='navbar__cart_span' aria-hidden="true">{cartCount}</span>
+                    </a>
🤖 Prompt for AI Agents
In `@fy-project/src/components/Navbar/Navbar.jsx` around lines 24 - 26, Replace
the hard-coded cart count in Navbar.jsx with a derived value (e.g., a prop or
state like cartCount) and reuse that single variable for both the aria-label and
the visible badge; update the anchor's aria-label to include `${cartCount}
items` and render the same cartCount inside the <span
className='navbar__cart_span'> so they stay synchronized (ensure the component
that renders Navbar passes or computes cartCount and that FiShoppingBag keeps
aria-hidden="true" while the span is exposed to assistive tech).

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