Skip to content

Commit bf69268

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 5ad1e16 commit bf69268

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
@@ -972,15 +972,21 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
972972
// looping animation would repaint every row that shows it.
973973
const titleRegenerationIcon =
974974
thread.titleRegeneration != null ? (
975-
<View accessible accessibilityLabel="Regenerating title">
976-
<SymbolView
977-
name="arrow.clockwise"
978-
size={11}
979-
tintColorClassName={rowAppearance.mutedIconTintClassName}
980-
type="monochrome"
981-
/>
982-
</View>
975+
<SymbolView
976+
name="arrow.clockwise"
977+
size={11}
978+
tintColorClassName={rowAppearance.mutedIconTintClassName}
979+
type="monochrome"
980+
/>
983981
) : null;
982+
// The row is one accessible element, so nested labels are never read.
983+
const rowAccessibilityLabel = [
984+
thread.title,
985+
props.hasQueuedMessages ? "messages queued to send" : null,
986+
thread.titleRegeneration != null ? "regenerating title" : null,
987+
]
988+
.filter((part) => part !== null)
989+
.join(", ");
984990

985991
// Sidebar rows use navigation foregrounds on their active and idle surfaces.
986992
const cardContent = (
@@ -1212,9 +1218,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
12121218
interactionOpacity={rowAppearance.interactionOpacity}
12131219
className={rowAppearance.className}
12141220
accessibilityHint={swipeAccessibilityHint}
1215-
accessibilityLabel={
1216-
props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title
1217-
}
1221+
accessibilityLabel={rowAccessibilityLabel}
12181222
accessibilityRole="button"
12191223
accessibilityState={{ selected }}
12201224
onPress={() => {
@@ -1244,9 +1248,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
12441248
interactionClassName={rowAppearance.interactionClassName}
12451249
interactionOpacity={rowAppearance.interactionOpacity}
12461250
accessibilityHint={swipeAccessibilityHint}
1247-
accessibilityLabel={
1248-
props.hasQueuedMessages ? `${thread.title}, messages queued to send` : thread.title
1249-
}
1251+
accessibilityLabel={rowAccessibilityLabel}
12501252
accessibilityRole="button"
12511253
accessibilityState={{ selected }}
12521254
className={rowAppearance.className}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
18271827
aria-label={accessibility.label}
18281828
aria-current={accessibility.current}
18291829
data-testid="sidebar-row-slim"
1830-
aria-busy={isRegeneratingTitle || undefined}
18311830
className={cn(rowSurfaceClassName, "flex h-9 items-center gap-2.5 px-2.5")}
18321831
onClick={handleClick}
18331832
onDoubleClick={handleDoubleClick}
@@ -1988,7 +1987,6 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
19881987
aria-label={accessibility.label}
19891988
aria-current={accessibility.current}
19901989
data-testid="sidebar-row-card"
1991-
aria-busy={isRegeneratingTitle || undefined}
19921990
className={rowSurfaceClassName}
19931991
onClick={handleClick}
19941992
onDoubleClick={handleDoubleClick}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ export const ChatHeader = memo(function ChatHeader({
408408
type="button"
409409
aria-label={`Thread actions for ${activeThreadTitle}`}
410410
aria-haspopup="menu"
411-
aria-busy={isRegeneratingTitle || undefined}
412411
onClick={openMenuFromTitle}
413412
onDoubleClick={canOperateThread ? handleTitleDoubleClick : undefined}
414413
onBlur={cancelPendingTitleMenu}

0 commit comments

Comments
 (0)