diff --git a/frontend/__tests__/utils/utils.test.ts b/frontend/__tests__/utils/utils.test.ts index 91e9ba031b..8fc286d4b1 100644 --- a/frontend/__tests__/utils/utils.test.ts +++ b/frontend/__tests__/utils/utils.test.ts @@ -11,7 +11,7 @@ import { I18nKey } from "#/i18n/declaration"; // Mock translations const t = (key: string) => { const translations: { [key: string]: string } = { - COMMON$WAITING_FOR_SANDBOX: "Waiting For Sandbox", + COMMON$WAITING_FOR_SANDBOX: "Waiting for sandbox", COMMON$STOPPING: "Stopping", COMMON$STARTING: "Starting", COMMON$SERVER_STOPPED: "Server stopped", @@ -69,7 +69,7 @@ describe("getStatusText", () => { t, }); - expect(result).toBe(t(I18nKey.COMMON$WAITING_FOR_SANDBOX)); + expect(result).toBe("Waiting for sandbox"); }); it("returns task detail when task status is ERROR and detail exists", () => { diff --git a/frontend/src/utils/utils.ts b/frontend/src/utils/utils.ts index 849d65fbdf..80f40158f6 100644 --- a/frontend/src/utils/utils.ts +++ b/frontend/src/utils/utils.ts @@ -838,7 +838,7 @@ interface GetStatusTextArgs { * isStartingStatus: false, * isStopStatus: false, * curAgentState: AgentState.RUNNING - * }) // Returns "Waiting For Sandbox" + * }) // Returns "Waiting for sandbox" */ export function getStatusText({ isPausing = false, @@ -866,13 +866,13 @@ export function getStatusText({ return t(I18nKey.CONVERSATION$READY); } - // Format status text: "WAITING_FOR_SANDBOX" -> "Waiting for sandbox" + // Format status text with sentence case: "WAITING_FOR_SANDBOX" -> "Waiting for sandbox" return ( taskDetail || taskStatus .toLowerCase() .replace(/_/g, " ") - .replace(/\b\w/g, (c) => c.toUpperCase()) + .replace(/^\w/, (c) => c.toUpperCase()) ); }