🎨 Palette: [UX improvement] Enhance accessibility and visual feedback#26
🎨 Palette: [UX improvement] Enhance accessibility and visual feedback#26
Conversation
- Added missing .loader CSS class for form submission feedback. - Added aria-label to private pass input for screen readers. - Implemented auto-focus for the private pass modal input. Co-authored-by: LVT-ENG <214667862+LVT-ENG@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user experience and accessibility of the application by adding visual feedback, improving keyboard navigation, and providing better support for screen readers. These changes make the interface more responsive and user-friendly. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
Este PR introduce buenas mejoras de accesibilidad y experiencia de usuario. Mis comentarios se centran en refinar aún más estas mejoras. En index.html, sugiero ajustar el aria-label y el placeholder para mayor claridad y consistencia. En js/main.js, señalo un aspecto importante de la gestión del foco en modales para completar la mejora de accesibilidad: restaurar el foco al elemento original cuando el modal se cierra. Los cambios en el CSS para el loader son correctos.
| const input = document.getElementById('private-pass-input'); | ||
| if (input) input.focus(); |
There was a problem hiding this comment.
¡Excelente mejora de accesibilidad al mover el foco al input!
Para completar el patrón de accesibilidad de un modal, es crucial devolver el foco al elemento que lo activó cuando el modal se cierra. De lo contrario, el foco se "pierde" en la página (a menudo vuelve al inicio del <body>), creando una mala experiencia para la navegación por teclado.
Para solucionarlo, puedes guardar el elemento activo antes de mostrar el modal y restaurar el foco al cerrarlo.
1. Añade una propiedad en el constructor:
constructor() {
// ...
this.previouslyFocusedElement = null;
this.init();
}2. Guarda el foco en requestPrivatePass:
requestPrivatePass() {
this.previouslyFocusedElement = document.activeElement; // Guardar foco
const modal = document.getElementById('private-pass-modal');
modal.style.display = 'flex';
const input = document.getElementById('private-pass-input');
if (input) input.focus();
}3. Restaura el foco en closePrivatePass:
closePrivatePass() {
const modal = document.getElementById('private-pass-modal');
modal.style.display = 'none';
if (this.previouslyFocusedElement) {
this.previouslyFocusedElement.focus(); // Restaurar foco
}
}Esto asegurará una experiencia de usuario fluida y accesible.
| <h3 style="color:#C5A46D; margin-bottom:1.5rem;">PASE PRIVADO SOLICITADO</h3> | ||
| <p style="color:#F5EFE6; opacity:0.7; margin-bottom:2rem;">Contenido restringido para Curadores del Búnker. Por favor, introduce tu credencial de acceso.</p> | ||
| <input type="password" id="private-pass-input" placeholder="Credential ID" style="width:100%; padding:1rem; background:#0d0e10; border:1px solid rgba(255,255,255,0.1); color:#F5EFE6; margin-bottom:2rem;"> | ||
| <input type="password" id="private-pass-input" placeholder="Credential ID" aria-label="Introduce tu credencial de acceso" style="width:100%; padding:1rem; background:#0d0e10; border:1px solid rgba(255,255,255,0.1); color:#F5EFE6; margin-bottom:2rem;"> |
There was a problem hiding this comment.
Para mejorar la accesibilidad y la consistencia, te sugiero los siguientes cambios:
aria-labelconciso: El valor dearia-labeles una instrucción completa. Es mejor que sea una etiqueta concisa, como "Credencial de acceso", ya que el párrafo anterior ya da el contexto.- Consistencia de idioma: El
placeholder"Credential ID" está en inglés. Sería bueno traducirlo a "ID de Credencial" para que coincida con el resto de la interfaz.
Adicionalmente, considera mover los estilos en línea de este elemento a una clase CSS en styles/main.css para mejorar la mantenibilidad.
| <input type="password" id="private-pass-input" placeholder="Credential ID" aria-label="Introduce tu credencial de acceso" style="width:100%; padding:1rem; background:#0d0e10; border:1px solid rgba(255,255,255,0.1); color:#F5EFE6; margin-bottom:2rem;"> | |
| <input type="password" id="private-pass-input" placeholder="ID de Credencial" aria-label="Credencial de acceso" style="width:100%; padding:1rem; background:#0d0e10; border:1px solid rgba(255,255,255,0.1); color:#F5EFE6; margin-bottom:2rem;"> |
💡 What: This PR introduces three micro-UX and accessibility enhancements:
.loaderCSS class instyles/main.css. This ensures that the "ASK PAU" button shows a rotating loader during the analysis process, as intended by the JavaScript logic.requestPrivatePassinjs/main.jsto automatically focus the password input field when the Staff Access modal is opened, saving the user an extra click/tab.aria-labelto the#private-pass-inputinindex.htmlto provide clear context for assistive technologies.🎯 Why: These small changes collectively make the interface feel more responsive and accessible, adhering to high UX standards and ensuring a smoother experience for all users.
📸 Before/After:
♿ Accessibility:
aria-labelto the password input.PR created automatically by Jules for task 3411431885991634331 started by @LVT-ENG