Browse Source

Merge pull request #16176 from itk-dev/feature/toggle-user-assistant-button-accessibility

FEAT: toggle user assistant button accessibility
Tim Jaeryang Baek 2 months ago
parent
commit
22f9481e99
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/lib/components/playground/Chat.svelte

+ 9 - 1
src/lib/components/playground/Chat.svelte

@@ -298,7 +298,15 @@
 					>
 						<div class="flex-1 shrink-0">
 							<button
-								class="px-3.5 py-1.5 text-sm font-medium bg-gray-50 hover:bg-gray-100 text-gray-900 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition rounded-lg shrink-0"
+								type="button"
+								class="px-3.5 py-1.5 text-sm font-medium bg-gray-50 hover:bg-gray-100 text-gray-900 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition rounded-lg shrink-0 {($settings?.highContrastMode ??
+								false)
+									? ''
+									: 'outline-hidden'}"
+								aria-pressed={role === 'assistant'}
+								aria-label={$i18n.t(
+									role === 'user' ? 'Switch to Assistant role' : 'Switch to User role'
+								)}
 								on:click={() => {
 									role = role === 'user' ? 'assistant' : 'user';
 								}}