Skip to content

🎨 Palette: Improve Login Form Accessibility and Error Handling#21

Open
BenjaminWie wants to merge 1 commit intomainfrom
palette-login-ux-improvement-474735464200036666
Open

🎨 Palette: Improve Login Form Accessibility and Error Handling#21
BenjaminWie wants to merge 1 commit intomainfrom
palette-login-ux-improvement-474735464200036666

Conversation

@BenjaminWie
Copy link
Owner

This PR introduces a micro-UX improvement to the login flow by replacing disruptive browser alerts with accessible, inline validation messages.

💡 What:

  • Updated App.tsx to manage login errors via state.
  • Enhanced LoginView.tsx with a semantic <label> (visually hidden via sr-only).
  • Added aria-invalid and aria-describedby to the email input for robust accessibility.
  • Used role="alert" on error messages to ensure immediate announcement by assistive technologies.
  • Implemented the derived state pattern to reliably sync error messages between parent and child components.

🎯 Why:

  • Browser alerts are non-accessible and disrupt the user's flow.
  • Inline validation provides immediate, contextual feedback.
  • Proper ARIA attributes make the application usable for screen reader users.

♿ Accessibility:

  • Added <label htmlFor="email-input"> for the email field.
  • Integrated aria-invalid and aria-describedby for error states.
  • Marked the error message container with role="alert".

📸 Verification:

  • Verified visually and functionally using a Playwright script.
  • Confirmed that errors are displayed inline and accessible attributes are correctly toggled.
  • Verified that the build and type checking pass.

PR created automatically by Jules for task 474735464200036666 started by @BenjaminWie

- Replaced browser alert() with accessible inline error messages in the login flow.
- Implemented derived state pattern in LoginView to sync external error props.
- Added visually hidden <label> for the email input.
- Added aria-invalid, aria-describedby, and role="alert" for better screen reader support.
- Recorded UX learnings in .Jules/palette.md.

Co-authored-by: BenjaminWie <54136562+BenjaminWie@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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef6932a4b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

id="email-input"
type="email"
value={email}
onChange={(e) => { setEmail(e.target.value); setError(''); }}

Choose a reason for hiding this comment

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

P1 Badge Preserve failed-login feedback after input edits

Clearing only the local error here breaks repeat failure feedback: after one rejected login, typing in the field removes the message, and a second rejected login with the same backend message often won't reappear because the parent loginError value is unchanged and the prop-sync guard (externalError !== prevExternalError) never runs. In that flow, users can keep getting denied without seeing any error text.

Useful? React with 👍 / 👎.

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