Skip to content

Commit a472342

Browse files
nibarAhmednibarAhmedmaria-rcksjuliusmarminge
authored
fix(web): screen readers no longer say "Message" twice entering the composer (#26692)
Co-authored-by: nibarAhmed <[email protected]> Co-authored-by: maria-rcks <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
1 parent d9619ad commit a472342

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,6 @@ export default function ChatView(props: ChatViewProps) {
744744
] = useState<Record<string, boolean>>({});
745745
const legendListRef = useRef<LegendListRef | null>(null);
746746
const conversationArea = workspaceAreaProps("conversation", 1, "Conversation");
747-
const composerArea = workspaceAreaProps("composer", 2, "Message input");
748747
const [composerOverlayElement, setComposerOverlayElement] = useState<HTMLDivElement | null>(null);
749748
const [composerTimelineInset, setComposerTimelineInset] = useState(0);
750749
const composerTimelineInsetRef = useRef(0);
@@ -3528,7 +3527,11 @@ export default function ChatView(props: ChatViewProps) {
35283527
</div>
35293528

35303529
<div
3531-
{...composerArea}
3530+
{...workspaceAreaProps(
3531+
"composer",
3532+
2,
3533+
showProviderSubagentBar ? "Subagent" : undefined,
3534+
)}
35323535
ref={(overlay: HTMLDivElement | null) => {
35333536
setComposerOverlayElement(overlay);
35343537
attachFollowComposerOverlay(overlay);

‎apps/web/src/lib/workspaceFocus.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ const FOCUSABLE_SELECTOR =
99
'button:not(:disabled), a[href], input:not(:disabled), textarea:not(:disabled), select:not(:disabled), [contenteditable="true"], [tabindex]';
1010

1111
/** Props that make an element one stop in the F6 cycle; `order` sets its place in the cycle. */
12-
export function workspaceAreaProps(name: string, order: number, label: string) {
12+
export function workspaceAreaProps(name: string, order: number, label?: string) {
1313
return {
1414
"data-workspace-area": name,
1515
"data-workspace-order": order,
16-
"aria-label": label,
17-
role: "region",
16+
...(label ? { "aria-label": label, role: "region" } : {}),
1817
tabIndex: -1,
1918
} as const;
2019
}

0 commit comments

Comments
 (0)