CI(ui-extra): use Enter to submit Compare composer + add aria-label

Compare-mode composer (shared-composer.tsx) wraps the send button in
TooltipIconButton without setting aria-label="Send message", so the
playwright_extra_ui Compare step's button[aria-label="Send message"]
selector matched 0 elements and timed out at 30s.

Two changes:

  1. Test: switch from clicking the send button to pressing Enter on
     the textarea. The composer's onKeyDown handler maps plain Enter
     to send(), which is also the natural user flow.

  2. Frontend: add aria-label="Send message" to the compare composer's
     send button. Single-thread composer (thread.tsx) already sets
     this; mirror it for accessibility consistency and to keep the
     selector working as a fallback in older builds.
This commit is contained in:
Daniel Han 2026-05-07 06:01:11 +00:00
commit c8b13b7fe2
2 changed files with 9 additions and 2 deletions

View file

@ -762,6 +762,7 @@ export function SharedComposer({
className="size-8 rounded-full"
onClick={send}
disabled={!canSend}
aria-label="Send message"
>
<ArrowUpIcon className="size-4" />
</TooltipIconButton>

View file

@ -209,7 +209,13 @@ with sync_playwright() as p:
else:
cmp_composer.click()
cmp_composer.fill("Reply with: A")
page.locator('button[aria-label="Send message"]').first.click()
# Prefer Enter on the textarea: the shared composer's
# onKeyDown handler maps plain Enter to send(). The
# send button is rendered via TooltipIconButton +
# ComposerPrimitive.Send and its aria-label was
# added late, so older builds match nothing for
# button[aria-label="Send message"] in compare mode.
cmp_composer.press("Enter")
# Wait for at least 2 NEW assistant bubbles (one per pane).
try:
page.wait_for_function(
@ -228,7 +234,7 @@ with sync_playwright() as p:
# Send a second prompt -> 4 total new bubbles.
cmp_composer.fill("Reply with: B")
page.locator('button[aria-label="Send message"]').first.click()
cmp_composer.press("Enter")
try:
page.wait_for_function(
"""(want) => {