fix: screen readers miss the pressed state of rating and read aloud buttons and the name of three switches (#35291)

After rating a reply, Good Response or Bad Response looks selected, but screen readers announced no state, and Read Aloud gave screen readers no sign that it was reading aloud. These buttons now report whether they are pressed. The enable switch in the tool server dialog, the Global switch in a function's menu and the enable switch in the webhook form were announced only as "switch, on", and now have a name.

Fixes #35290
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-30 18:27:55 +04:00
1 parent 2e94968a9a
commit e40bc6f481
4 files changed
+13 -3

No files matched your search

+4 -1
View File
@@ -696,7 +696,10 @@
</Tooltip>
<Tooltip content={enable ? $i18n.t('Enabled') : $i18n.t('Disabled')}>
<Switch bind:state={enable} />
<Switch
bind:state={enable}
ariaLabel={$i18n.t('Toggle whether current connection is active.')}
/>
</Tooltip>
</div>
</div>
@@ -57,7 +57,11 @@
</div>
<div>
<Switch on:change={toggleGlobalHandler} bind:state={func.is_global} />
<Switch
on:change={toggleGlobalHandler}
bind:state={func.is_global}
ariaLabel={$i18n.t('Global')}
/>
</div>
</div>
@@ -449,7 +449,7 @@
bind:value={form.url}
/>
<Tooltip content={form.enabled ? $i18n.t('Enabled') : $i18n.t('Disabled')}>
<Switch bind:state={form.enabled} />
<Switch bind:state={form.enabled} ariaLabel={$i18n.t('Enabled')} />
</Tooltip>
</div>
</div>
@@ -1215,6 +1215,7 @@
<Tooltip content={$i18n.t('Read Aloud')} placement="bottom">
<button
aria-label={$i18n.t('Read Aloud')}
aria-pressed={speaking}
id="speak-button-{message.id}"
class="{isLastMessage || ($settings?.highContrastMode ?? false)
? 'visible'
@@ -1423,6 +1424,7 @@
<Tooltip content={$i18n.t('Good Response')} placement="bottom">
<button
aria-label={$i18n.t('Good Response')}
aria-pressed={(message?.annotation?.rating ?? '').toString() === '1'}
class="{isLastMessage || ($settings?.highContrastMode ?? false)
? 'visible'
: 'hover-reveal'} inline-flex size-7 shrink-0 items-center justify-center p-1.5 hover:bg-base-1000/5 dark:hover:bg-base-0/5 rounded-lg {(
@@ -1467,6 +1469,7 @@
<Tooltip content={$i18n.t('Bad Response')} placement="bottom">
<button
aria-label={$i18n.t('Bad Response')}
aria-pressed={(message?.annotation?.rating ?? '').toString() === '-1'}
class="{isLastMessage || ($settings?.highContrastMode ?? false)
? 'visible'
: 'hover-reveal'} inline-flex size-7 shrink-0 items-center justify-center p-1.5 hover:bg-base-1000/5 dark:hover:bg-base-0/5 rounded-lg {(