diff --git a/content/solid/turn-status.mdx b/content/solid/turn-status.mdx index 9ab79a2..4724a10 100644 --- a/content/solid/turn-status.mdx +++ b/content/solid/turn-status.mdx @@ -40,6 +40,10 @@ import { TurnStatus } from "@/components/ui/turn-status" ## With steps Given children, the line is a button and opens to show them: the calls of the step in hand. +The activity label is announced by a separate status region, so the button keeps +its native role and updates to the clock and token count do not repeat the announcement. +When `label` is omitted or blank, the activity name supplies the announcement and +button name without adding visible text. Pass `label` to customize or translate it. diff --git a/src/components/ui/turn-status.tsx b/src/components/ui/turn-status.tsx index 53600c4..89773da 100644 --- a/src/components/ui/turn-status.tsx +++ b/src/components/ui/turn-status.tsx @@ -63,6 +63,9 @@ function TurnStatus({ const [open, setOpen] = React.useState(false) const elapsed = useElapsed(since) const opens = Boolean(children) + // The glyph is decorative. Even without visible words, expose the activity + // and keep the disclosure's name independent of the clock and token count. + const activityLabel = label?.trim() || activity const line = ( <> @@ -83,11 +86,13 @@ function TurnStatus({ return (
+ {/* Announce activity changes without repeating the clock and count. */} + {activityLabel}
{opens ? ( ) : ( -
+
{line}
)}