Skip to content

Commit 52c729c

Browse files
committed
fix(clients): announce title regeneration to screen readers
Drop aria-busy so the Regenerating title status is not deferred, and fold the state into the mobile row's accessibility label since nested labels are never read.
1 parent cf9311d commit 52c729c

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

‎apps/mobile/src/features/threads/thread-list-v2-items.tsx‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -929,15 +929,21 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
929929
// looping animation would repaint every row that shows it.
930930
const titleRegenerationIcon =
931931
thread.titleRegeneration != null ? (
932-
<View accessible accessibilityLabel="Regenerating title">
933-
<SymbolView
934-
name="arrow.clockwise"
935-
size={11}
936-
tintColorClassName={rowAppearance.mutedIconTintClassName}
937-
type="monochrome"
938-
/>
939-
</View>
932+
<SymbolView
933+
name="arrow.clockwise"
934+
size={11}
935+
tintColorClassName={rowAppearance.mutedIconTintClassName}
936+
type="monochrome"
937+
/>
940938
) : null;
939+
// The row is one accessible element, so nested labels are never read.
940+
const rowAccessibilityLabel = [
941+
thread.title,
942+
props.hasQueuedMessages ? "messages queued to send" : null,
943+
thread.titleRegeneration != null ? "regenerating title" : null,
944+
]
945+
.filter((part) => part !== null)
946+
.join(", ");
941947

942948
// Sidebar rows use navigation foregrounds on their active and idle surfaces.
943949
const cardContent = (
@@ -1138,9 +1144,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
11381144
interactionOpacity={rowAppearance.interactionOpacity}
11391145
className={rowAppearance.className}
11401146
accessibilityHint={swipeAccessibilityHint}
1141-
accessibilityLabel={
1142-
props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title
1143-
}
1147+
accessibilityLabel={rowAccessibilityLabel}
11441148
accessibilityRole="button"
11451149
accessibilityState={{ selected }}
11461150
onPress={() => {
@@ -1170,9 +1174,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
11701174
interactionClassName={rowAppearance.interactionClassName}
11711175
interactionOpacity={rowAppearance.interactionOpacity}
11721176
accessibilityHint={swipeAccessibilityHint}
1173-
accessibilityLabel={
1174-
props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title
1175-
}
1177+
accessibilityLabel={rowAccessibilityLabel}
11761178
accessibilityRole="button"
11771179
accessibilityState={{ selected }}
11781180
className={rowAppearance.className}

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
18181818
aria-label={accessibility.label}
18191819
aria-current={accessibility.current}
18201820
data-testid="sidebar-row-slim"
1821-
aria-busy={isRegeneratingTitle || undefined}
18221821
className={cn(rowSurfaceClassName, "flex h-9 items-center gap-2.5 px-2.5")}
18231822
onClick={handleClick}
18241823
onDoubleClick={handleDoubleClick}
@@ -1979,7 +1978,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
19791978
aria-label={accessibility.label}
19801979
aria-current={accessibility.current}
19811980
data-testid="sidebar-row-card"
1982-
aria-busy={isRegeneratingTitle || undefined}
19831981
className={rowSurfaceClassName}
19841982
onClick={handleClick}
19851983
onDoubleClick={handleDoubleClick}

‎apps/web/src/components/chat/ChatHeader.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ export const ChatHeader = memo(function ChatHeader({
327327
type="button"
328328
aria-label={`Thread actions for ${activeThreadTitle}`}
329329
aria-haspopup="menu"
330-
aria-busy={isRegeneratingTitle || undefined}
331330
onClick={openMenuFromTitle}
332331
onDoubleClick={canOperateThread ? handleTitleDoubleClick : undefined}
333332
onBlur={cancelPendingTitleMenu}

0 commit comments

Comments
 (0)