Skip to content

Commit 9bc5488

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 163695e commit 9bc5488

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
@@ -891,15 +891,21 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
891891
// looping animation would repaint every row that shows it.
892892
const titleRegenerationIcon =
893893
thread.titleRegeneration != null ? (
894-
<View accessible accessibilityLabel="Regenerating title">
895-
<SymbolView
896-
name="arrow.clockwise"
897-
size={11}
898-
tintColorClassName={rowAppearance.mutedIconTintClassName}
899-
type="monochrome"
900-
/>
901-
</View>
894+
<SymbolView
895+
name="arrow.clockwise"
896+
size={11}
897+
tintColorClassName={rowAppearance.mutedIconTintClassName}
898+
type="monochrome"
899+
/>
902900
) : null;
901+
// The row is one accessible element, so nested labels are never read.
902+
const rowAccessibilityLabel = [
903+
thread.title,
904+
props.hasQueuedMessages ? "messages queued to send" : null,
905+
thread.titleRegeneration != null ? "regenerating title" : null,
906+
]
907+
.filter((part) => part !== null)
908+
.join(", ");
903909

904910
// Sidebar rows use navigation foregrounds on their active and idle surfaces.
905911
const cardContent = (
@@ -1087,9 +1093,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
10871093
interactionOpacity={rowAppearance.interactionOpacity}
10881094
className={rowAppearance.className}
10891095
accessibilityHint={swipeAccessibilityHint}
1090-
accessibilityLabel={
1091-
props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title
1092-
}
1096+
accessibilityLabel={rowAccessibilityLabel}
10931097
accessibilityRole="button"
10941098
accessibilityState={{ selected }}
10951099
onPress={() => {
@@ -1119,9 +1123,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
11191123
interactionClassName={rowAppearance.interactionClassName}
11201124
interactionOpacity={rowAppearance.interactionOpacity}
11211125
accessibilityHint={swipeAccessibilityHint}
1122-
accessibilityLabel={
1123-
props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title
1124-
}
1126+
accessibilityLabel={rowAccessibilityLabel}
11251127
accessibilityRole="button"
11261128
accessibilityState={{ selected }}
11271129
className={rowAppearance.className}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
16291629
aria-label={accessibility.label}
16301630
aria-current={accessibility.current}
16311631
data-testid="sidebar-row-slim"
1632-
aria-busy={isRegeneratingTitle || undefined}
16331632
className={cn(rowSurfaceClassName, "flex h-9 items-center gap-2.5 px-2.5")}
16341633
onClick={handleClick}
16351634
onDoubleClick={handleDoubleClick}
@@ -1781,7 +1780,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
17811780
aria-label={accessibility.label}
17821781
aria-current={accessibility.current}
17831782
data-testid="sidebar-row-card"
1784-
aria-busy={isRegeneratingTitle || undefined}
17851783
className={rowSurfaceClassName}
17861784
onClick={handleClick}
17871785
onDoubleClick={handleDoubleClick}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ export const ChatHeader = memo(function ChatHeader({
459459
type="button"
460460
aria-label={`Thread actions for ${activeThreadTitle}`}
461461
aria-haspopup="menu"
462-
aria-busy={isRegeneratingTitle || undefined}
463462
onClick={openMenuFromTitle}
464463
onDoubleClick={handleTitleDoubleClick}
465464
onBlur={cancelPendingTitleMenu}

0 commit comments

Comments
 (0)