-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: Améliorer l'accessibilité des boutons d'action Ollama #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -405,22 +405,24 @@ export default function OllamaTab() { | |||||||||||||
| <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" | ||||||||||||||
| > | ||||||||||||||
| <svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor"> | ||||||||||||||
| <svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"> | ||||||||||||||
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /> | ||||||||||||||
| </svg> | ||||||||||||||
| </button> | ||||||||||||||
| <button | ||||||||||||||
| onClick={() => toggleManualDisable(m, !!isDisabled)} | ||||||||||||||
| class={`p-1 rounded transition-colors ${isDisabled ? 'text-emerald-500 hover:bg-emerald-50' : 'text-gray-300 hover:text-rose-500 hover:bg-rose-50'}`} | ||||||||||||||
| class={`p-1 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37] ${isDisabled ? 'text-emerald-500 hover:bg-emerald-50' : 'text-gray-300 hover:text-rose-500 hover:bg-rose-50'}`} | ||||||||||||||
| title={isDisabled ? 'Activer le modèle' : 'Désactiver le modèle'} | ||||||||||||||
| aria-label={isDisabled ? 'Activer le modèle' : 'Désactiver le modèle'} | ||||||||||||||
| > | ||||||||||||||
| {isDisabled ? ( | ||||||||||||||
| <svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7" /></svg> | ||||||||||||||
| <svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7" /></svg> | ||||||||||||||
| ) : ( | ||||||||||||||
| <svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12" /></svg> | ||||||||||||||
| <svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12" /></svg> | ||||||||||||||
| )} | ||||||||||||||
| </button> | ||||||||||||||
| </div> | ||||||||||||||
|
|
@@ -435,14 +437,14 @@ export default function OllamaTab() { | |||||||||||||
| )} | ||||||||||||||
| </div> | ||||||||||||||
| <div class="flex items-center gap-2"> | ||||||||||||||
| <button onClick={() => toggleInstance(inst)} class={`text-[10px] font-bold px-3 py-1 rounded-full border transition-colors ${inst.enabled ? 'border-amber-200 text-amber-700 hover:bg-amber-50' : 'border-green-200 text-green-700 hover:bg-green-50'}`}> | ||||||||||||||
| <button onClick={() => toggleInstance(inst)} class={`text-[10px] font-bold px-3 py-1 rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37] ${inst.enabled ? 'border-amber-200 text-amber-700 hover:bg-amber-50' : 'border-green-200 text-green-700 hover:bg-green-50'}`}> | ||||||||||||||
| {inst.enabled ? 'Désactiver' : 'Activer'} | ||||||||||||||
| </button> | ||||||||||||||
| <button onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors"> | ||||||||||||||
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><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 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> | ||||||||||||||
|
Comment on lines
+443
to
445
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pour les utilisateurs sur ordinateur, l'ajout d'un attribut
Suggested change
|
||||||||||||||
| <button onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors"> | ||||||||||||||
| <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><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 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> | ||||||||||||||
|
Comment on lines
+446
to
448
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pour les utilisateurs sur ordinateur, l'ajout d'un attribut
Suggested change
|
||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le bouton de test individuel appelle actuellement
runTest, qui ne met pas à jour l'état de chargement localtestingModel. Par conséquent, l'icône ne tourne pas (animate-spin) et le bouton n'est pas désactivé pendant un test individuel. En utilisanttestModelà la place et en vérifiant sitestingModel === m, le bouton affichera correctement l'état de chargement et sera désactivé pour éviter les clics multiples.