fix(a11y): restore playground stop label

This commit is contained in:
Viktor Avelino
2026-06-23 11:38:07 -04:00
parent 6554f38f28
commit 353ebf99bf
2 changed files with 9 additions and 10 deletions

View File

@ -36,6 +36,9 @@ const ButtonSendWrapper = ({
};
const buttonClasses = cn("form-modal-send-button", getButtonState());
const buttonLabel = isBuilding
? t("flowBuild.stop")
: t("playground.sendButton");
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
e.stopPropagation();
@ -56,13 +59,9 @@ const ButtonSendWrapper = ({
onClick={handleClick}
disabled={isLoading}
unstyled
data-testid="button-send"
aria-label={
isBuilding ? t("playground.cancelButton") : t("playground.sendButton")
}
title={
isBuilding ? t("playground.cancelButton") : t("playground.sendButton")
}
data-testid={isBuilding ? "button-stop" : "button-send"}
aria-label={buttonLabel}
title={buttonLabel}
>
<div className="flex h-fit w-fit items-center gap-2 text-sm font-medium">
{isBuilding ? (

View File

@ -126,7 +126,7 @@ describe("IOModal chat input wrapper", () => {
expect(preventDefaultSpy).not.toHaveBeenCalled();
});
it("should_prevent_default_and_move_cursor_to_end_when_space_is_pressed_outside_textarea", () => {
it("should_not_prevent_default_when_space_is_pressed_on_group_wrapper", () => {
const inputRef = React.createRef<HTMLTextAreaElement>();
const fileInputRef = React.createRef<HTMLInputElement>();
const realTextarea = document.createElement("textarea");
@ -158,8 +158,8 @@ describe("IOModal chat input wrapper", () => {
const { preventDefaultSpy } = dispatchOn(wrapper, "keydown", { key: " " });
expect(preventDefaultSpy).toHaveBeenCalled();
expect(selectionSpy).toHaveBeenCalledWith(3, 3);
expect(preventDefaultSpy).not.toHaveBeenCalled();
expect(selectionSpy).not.toHaveBeenCalled();
});
it("should_not_prevent_default_on_unrelated_key_outside_textarea", () => {