Skip to content

Commit f14f6e2

Browse files
fix: announce the secret reveal control as a toggle
The reveal button keeps one label and exposes its state: aria-pressed on web, the togglebutton role with checked on mobile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 64ef794 commit f14f6e2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎apps/mobile/src/features/threads/SecretRequestCard.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ function SecretRequestField({
216216
/>
217217
{input.secret ? (
218218
<Pressable
219-
accessibilityRole="button"
220-
accessibilityLabel={revealed ? `Hide ${input.label}` : `Show ${input.label}`}
221-
accessibilityState={{ selected: revealed }}
219+
accessibilityRole="togglebutton"
220+
accessibilityLabel={`Show ${input.label}`}
221+
accessibilityState={{ checked: revealed }}
222222
hitSlop={8}
223223
className="absolute right-1 size-11 items-center justify-center active:opacity-70"
224224
onPress={() => setRevealed((current) => !current)}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function SecretRequestField(props: {
228228
type="button"
229229
size="icon-xs"
230230
variant="ghost"
231-
aria-label={revealed ? `Hide ${input.label}` : `Show ${input.label}`}
231+
aria-label={`Show ${input.label}`}
232232
aria-pressed={revealed}
233233
disabled={props.disabled}
234234
// Keep focus, and the caret, in the input.

0 commit comments

Comments
 (0)