From 353ebf99bfd64e8f5fdf659883b73ecec0348984 Mon Sep 17 00:00:00 2001 From: Viktor Avelino Date: Tue, 23 Jun 2026 11:38:07 -0400 Subject: [PATCH] fix(a11y): restore playground stop label --- .../chat-input/components/button-send-wrapper.tsx | 13 ++++++------- .../components/__tests__/input-wrapper.test.tsx | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/button-send-wrapper.tsx b/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/button-send-wrapper.tsx index b44d0ef083..25e026a9fc 100644 --- a/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/button-send-wrapper.tsx +++ b/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/button-send-wrapper.tsx @@ -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) => { 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} >
{isBuilding ? ( diff --git a/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/__tests__/input-wrapper.test.tsx b/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/__tests__/input-wrapper.test.tsx index 5622ab9111..c9cb882a2f 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/__tests__/input-wrapper.test.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/__tests__/input-wrapper.test.tsx @@ -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(); const fileInputRef = React.createRef(); 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", () => {