Skip to content

🙌 OpenHands: AI-Driven Development

fix(event-group): show '4/5 actions completed' with spinner while running (#355)

Robert Brennand2ebc7baa952
diff --git a/__tests__/components/conversation-events/chat/event-message-components/event-group.test.tsx b/__tests__/components/conversation-events/chat/event-message-components/event-group.test.tsx
index 1eb8e50b57..546f6ed842 100644
--- a/__tests__/components/conversation-events/chat/event-message-components/event-group.test.tsx
+++ b/__tests__/components/conversation-events/chat/event-message-components/event-group.test.tsx
@@ -165,7 +165,7 @@ describe("EventGroup", () => {
expect(screen.queryByTestId("status-icon")).not.toBeInTheDocument();
});
- it("hides the success indicator while running and shows it when done", () => {
+ it("shows a spinner while running and the success indicator when done", () => {
const running = [
makeBashObservation("o1", "a1", "ls"),
makeBashAction("a2", "pwd"),
@@ -176,6 +176,7 @@ describe("EventGroup", () => {
<div>child</div>
</EventGroup>,
);
+ expect(screen.getByTestId("spinner-icon")).toBeInTheDocument();
expect(screen.queryByTestId("status-icon")).not.toBeInTheDocument();
const done = [
@@ -187,6 +188,7 @@ describe("EventGroup", () => {
<div>child</div>
</EventGroup>,
);
+ expect(screen.queryByTestId("spinner-icon")).not.toBeInTheDocument();
expect(screen.getByTestId("status-icon")).toBeInTheDocument();
});
diff --git a/src/components/conversation-events/chat/event-message-components/event-group.tsx b/src/components/conversation-events/chat/event-message-components/event-group.tsx
index 5c3471888b..bcc572ddaf 100644
--- a/src/components/conversation-events/chat/event-message-components/event-group.tsx
+++ b/src/components/conversation-events/chat/event-message-components/event-group.tsx
@@ -1,5 +1,6 @@
import React from "react";
import { useTranslation } from "react-i18next";
+import { LoaderCircle } from "lucide-react";
import ArrowDown from "#/icons/angle-down-solid.svg?react";
import ArrowUp from "#/icons/angle-up-solid.svg?react";
import { OpenHandsEvent, ActionEvent } from "#/types/agent-server/core";
@@ -43,9 +44,9 @@ interface EventGroupProps {
* - Left (prominent): the title of the most recent action/observation in
* the group — i.e. either the action currently in flight, or the latest
* completed step.
- * - Right (subdued): "{completed} of {total} actions" while at least one
- * action is still pending, otherwise "{count} actions completed", followed
- * by a success check once nothing is in flight.
+ * - Right (subdued): "{completed}/{total} actions completed" while at
+ * least one action is still pending (with a spinner), otherwise
+ * "{count} actions completed" followed by a success check.
*
* Collapsed, after the group has been "moved past" (`isFinalized=true`):
* - "{count} actions completed" is promoted to the prominent foreground
@@ -138,7 +139,14 @@ export function EventGroup({
</span>
<span className="flex items-center flex-shrink-0 font-normal text-neutral-400">
<span className="truncate">{countSummary}</span>
- {!isRunning && <SuccessIndicator status="success" />}
+ {isRunning ? (
+ <LoaderCircle
+ data-testid="spinner-icon"
+ className="h-4 w-4 ml-2 inline animate-spin text-neutral-300"
+ />
+ ) : (
+ <SuccessIndicator status="success" />
+ )}
</span>
</>
)}
diff --git a/src/i18n/translation.json b/src/i18n/translation.json
index 98d1a64c91..cb38f9ec47 100644
--- a/src/i18n/translation.json
+++ b/src/i18n/translation.json
@@ -23815,21 +23815,21 @@
"ca": "{{count}} accions completades"
},
"EVENT_GROUP$ACTIONS_PROGRESS": {
- "en": "{{completed}} of {{total}} actions",
- "ja": "{{total}} 件中 {{completed}} 件のアクション",
- "zh-CN": "{{total}} 个操作中的 {{completed}} 个",
- "zh-TW": "{{total}} 個動作中的 {{completed}} 個",
- "ko-KR": "{{total}}개 중 {{completed}}개 작업",
- "no": "{{completed}} av {{total}} handlinger",
- "it": "{{completed}} di {{total}} azioni",
- "pt": "{{completed}} de {{total}} ações",
- "es": "{{completed}} de {{total}} acciones",
- "ar": "{{completed}} من أصل {{total}} إجراء",
- "fr": "{{completed}} sur {{total}} actions",
- "tr": "{{total}} eylemden {{completed}} tanesi",
- "de": "{{completed}} von {{total}} Aktionen",
- "uk": "{{completed}} з {{total}} дій",
- "ca": "{{completed}} de {{total}} accions"
+ "en": "{{completed}}/{{total}} actions completed",
+ "ja": "{{completed}}/{{total}} 件のアクションが完了しました",
+ "zh-CN": "已完成 {{completed}}/{{total}} 个操作",
+ "zh-TW": "已完成 {{completed}}/{{total}} 個動作",
+ "ko-KR": "{{completed}}/{{total}}개의 작업이 완료되었습니다",
+ "no": "{{completed}}/{{total}} handlinger fullført",
+ "it": "{{completed}}/{{total}} azioni completate",
+ "pt": "{{completed}}/{{total}} ações concluídas",
+ "es": "{{completed}}/{{total}} acciones completadas",
+ "ar": "اكتمل {{completed}}/{{total}} من الإجراءات",
+ "fr": "{{completed}}/{{total}} actions terminées",
+ "tr": "{{completed}}/{{total}} eylem tamamlandı",
+ "de": "{{completed}}/{{total}} Aktionen abgeschlossen",
+ "uk": "Виконано дій: {{completed}}/{{total}}",
+ "ca": "{{completed}}/{{total}} accions completades"
},
"EVENT_GROUP$EXPAND": {
"en": "Expand actions",