a11y(transcription): announce @mention empty state via aria-live

Collapse the two empty-state branches into a single p[aria-live=polite]
whose text derives from the search query. Screen readers now hear the
transition between "Namen eingeben…" and "Keine Personen gefunden".
Leonie FINDING-MENTION-002 on PR #629.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-19 22:20:16 +02:00
committed by marcel
parent 6a5083f9bc
commit 9b6561562d
2 changed files with 20 additions and 9 deletions

View File

@@ -178,15 +178,16 @@ function selectItem(item: Person) {
</div>
</div>
{#if model.items.length === 0}
{#if searchQuery.trim() === ''}
<p class="px-3 py-2.5 font-sans text-sm text-ink-3">
{m.person_mention_search_prompt()}
</p>
{:else}
<p class="px-3 py-2.5 font-sans text-sm text-ink-3">
{m.person_mention_popup_empty()}
</p>
{/if}
<!--
Single live region so screen readers announce the transition between
"Namen eingeben…" (empty search) and "Keine Personen gefunden"
(searched but empty). Leonie FINDING-MENTION-002 on PR #629.
-->
<p class="px-3 py-2.5 font-sans text-sm text-ink-3" aria-live="polite">
{searchQuery.trim() === ''
? m.person_mention_search_prompt()
: m.person_mention_popup_empty()}
</p>
<!--
Empty-state escape hatch — without it the transcriber has to close
the dropdown, navigate to /persons/new, come back, and re-type the