Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Remove error icon from ExpandableMessage component (#11964)

Alona9b57a0b14f70
diff --git a/frontend/__tests__/components/chat/expandable-message.test.tsx b/frontend/__tests__/components/chat/expandable-message.test.tsx
index 0b25ef1f92..4ba839b8af 100644
--- a/frontend/__tests__/components/chat/expandable-message.test.tsx
+++ b/frontend/__tests__/components/chat/expandable-message.test.tsx
@@ -61,7 +61,7 @@ describe("ExpandableMessage", () => {
expect(icon).toHaveClass("fill-success");
});
- it("should render with error icon for failed action messages", () => {
+ it("should render with no icon for failed action messages", () => {
renderWithProviders(
<ExpandableMessage
id="OBSERVATION_MESSAGE$RUN"
@@ -75,8 +75,7 @@ describe("ExpandableMessage", () => {
"div.flex.gap-2.items-center.justify-start",
);
expect(container).toHaveClass("border-neutral-300");
- const icon = screen.getByTestId("status-icon");
- expect(icon).toHaveClass("fill-danger");
+ expect(screen.queryByTestId("status-icon")).not.toBeInTheDocument();
});
it("should render with neutral border and no icon for action messages without success prop", () => {
diff --git a/frontend/src/components/features/chat/expandable-message.tsx b/frontend/src/components/features/chat/expandable-message.tsx
index 12942498a2..f1f7fe6869 100644
--- a/frontend/src/components/features/chat/expandable-message.tsx
+++ b/frontend/src/components/features/chat/expandable-message.tsx
@@ -6,7 +6,6 @@ import { I18nKey } from "#/i18n/declaration";
import ArrowDown from "#/icons/angle-down-solid.svg?react";
import ArrowUp from "#/icons/angle-up-solid.svg?react";
import CheckCircle from "#/icons/check-circle-solid.svg?react";
-import XCircle from "#/icons/x-circle-solid.svg?react";
import { OpenHandsAction } from "#/types/core/actions";
import { OpenHandsObservation } from "#/types/core/observations";
import { cn } from "#/utils/utils";
@@ -169,19 +168,12 @@ export function ExpandableMessage({
)}
</button>
</span>
- {type === "action" && success !== undefined && (
+ {type === "action" && success && (
<span className="flex-shrink-0">
- {success ? (
- <CheckCircle
- data-testid="status-icon"
- className={cn(statusIconClasses, "fill-success")}
- />
- ) : (
- <XCircle
- data-testid="status-icon"
- className={cn(statusIconClasses, "fill-danger")}
- />
- )}
+ <CheckCircle
+ data-testid="status-icon"
+ className={cn(statusIconClasses, "fill-success")}
+ />
</span>
)}
</div>