🎨 Palette: Améliorer l'accessibilité des boutons d'action Ollama#77
🎨 Palette: Améliorer l'accessibilité des boutons d'action Ollama#77bobdivx wants to merge 1 commit into
Conversation
Co-authored-by: bobdivx <6737167+bobdivx@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.
|
There was a problem hiding this comment.
Code Review
This pull request improves accessibility and keyboard navigation in the OllamaTab component by adding focus rings, aria-label attributes, and hiding decorative SVGs from screen readers. The review feedback suggests a bug fix to correctly handle the loading state of individual model tests by switching from runTest to testModel. Additionally, it recommends adding title attributes to the edit and delete buttons to provide tooltips for desktop users.
| <button | ||
| onClick={() => runTest(m, inst.normalizedUrl || inst.url)} | ||
| disabled={isTesting || batchTesting} | ||
| class={`p-1 rounded hover:bg-gray-200 transition-colors ${isTesting ? 'animate-spin text-blue-500' : 'text-gray-400'}`} | ||
| class={`p-1 rounded hover:bg-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37] ${isTesting ? 'animate-spin text-blue-500' : 'text-gray-400'}`} | ||
| title="Lancer un test" | ||
| aria-label="Lancer un test" | ||
| > |
There was a problem hiding this comment.
Le bouton de test individuel appelle actuellement runTest, qui ne met pas à jour l'état de chargement local testingModel. Par conséquent, l'icône ne tourne pas (animate-spin) et le bouton n'est pas désactivé pendant un test individuel. En utilisant testModel à la place et en vérifiant si testingModel === m, le bouton affichera correctement l'état de chargement et sera désactivé pour éviter les clics multiples.
| <button | |
| onClick={() => runTest(m, inst.normalizedUrl || inst.url)} | |
| disabled={isTesting || batchTesting} | |
| class={`p-1 rounded hover:bg-gray-200 transition-colors ${isTesting ? 'animate-spin text-blue-500' : 'text-gray-400'}`} | |
| class={`p-1 rounded hover:bg-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37] ${isTesting ? 'animate-spin text-blue-500' : 'text-gray-400'}`} | |
| title="Lancer un test" | |
| aria-label="Lancer un test" | |
| > | |
| <button | |
| onClick={() => testModel(m, inst.normalizedUrl || inst.url)} | |
| disabled={isTesting || batchTesting || testingModel === m} | |
| class={`p-1 rounded hover:bg-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37] ${(isTesting || testingModel === m) ? 'animate-spin text-blue-500' : 'text-gray-400'}`} | |
| title="Lancer un test" | |
| aria-label="Lancer un test" | |
| > |
| <button onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]" aria-label="Modifier l'instance"> | ||
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg> | ||
| </button> |
There was a problem hiding this comment.
Pour les utilisateurs sur ordinateur, l'ajout d'un attribut title en plus de aria-label permet d'afficher une infobulle (tooltip) au survol de la souris, ce qui améliore grandement l'expérience utilisateur pour ces boutons contenant uniquement des icônes.
| <button onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]" aria-label="Modifier l'instance"> | |
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg> | |
| </button> | |
| <button onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]" title="Modifier l'instance" aria-label="Modifier l'instance"> | |
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg> | |
| </button> |
| <button onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]" aria-label="Supprimer l'instance"> | ||
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg> | ||
| </button> |
There was a problem hiding this comment.
Pour les utilisateurs sur ordinateur, l'ajout d'un attribut title en plus de aria-label permet d'afficher une infobulle (tooltip) au survol de la souris, ce qui améliore grandement l'expérience utilisateur pour ces boutons contenant uniquement des icônes.
| <button onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]" aria-label="Supprimer l'instance"> | |
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg> | |
| </button> | |
| <button onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]" title="Supprimer l'instance" aria-label="Supprimer l'instance"> | |
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg> | |
| </button> |
💡 What: Ajout d'attributs
aria-labeletaria-hiddenainsi que des anneaux de focus clavier (focus-visible:ring) aux boutons d'action d'instance Ollama (test, activation, modification, suppression).🎯 Why: Les boutons contenant uniquement des icônes étaient inaccessibles aux lecteurs d'écran (qui lisaient simplement "bouton") et la navigation au clavier manquait d'indicateurs visuels clairs.
📸 Before/After: Les lecteurs d'écran peuvent désormais décrire correctement les actions, et les utilisateurs naviguant au clavier verront un anneau vert (#175B37) autour des boutons ciblés.
♿ Accessibility: Amélioration significative de la prise en charge des lecteurs d'écran et de la navigation au clavier (WCAG).
PR created automatically by Jules for task 7152885285040917665 started by @bobdivx