From 2c2a3266a63ac8b2d77ab2d7973ac1afc71ae5a9 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Wed, 5 Aug 2026 14:58:17 -0700 Subject: [PATCH] Change question card submit button label to 'Submit' (#12782) - Replace 'Send answer' with 'Submit' for clarity and consistency - Update all locale translations (en, es, ja, ko, zh) - Remove fixed button width and add whitespace-nowrap for flexible sizing - Update component and test references --- mobile/src/session/MobileNativeChatAsk.tsx | 2 +- .../native-chat/NativeChatInteractiveCard.test.tsx | 6 +++--- .../native-chat/NativeChatQuestionCard.test.tsx | 8 ++++---- .../src/components/native-chat/NativeChatQuestionCard.tsx | 4 ++-- src/renderer/src/i18n/locales/en.json | 2 +- src/renderer/src/i18n/locales/es.json | 2 +- src/renderer/src/i18n/locales/ja.json | 2 +- src/renderer/src/i18n/locales/ko.json | 2 +- src/renderer/src/i18n/locales/zh.json | 2 +- tests/e2e/native-chat-ask-user-question-card.spec.ts | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mobile/src/session/MobileNativeChatAsk.tsx b/mobile/src/session/MobileNativeChatAsk.tsx index 86fcb0dc4..68258c228 100644 --- a/mobile/src/session/MobileNativeChatAsk.tsx +++ b/mobile/src/session/MobileNativeChatAsk.tsx @@ -187,7 +187,7 @@ export function MobileNativeChatAsk({ prompt, onAnswer, onCancel }: Props): Reac disabled={!canAdvance} > - {isLast ? 'Send answer' : 'Next'} + {isLast ? 'Submit' : 'Next'} diff --git a/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx b/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx index 15009c5e5..a9b65f950 100644 --- a/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx @@ -101,7 +101,7 @@ function askResultMessage(): NativeChatMessage { function chooseSpacesAndSubmit(): void { fireEvent.click(screen.getByRole('button', { name: /Spaces/ })) - fireEvent.click(screen.getByRole('button', { name: 'Send answer' })) + fireEvent.click(screen.getByRole('button', { name: 'Submit' })) } describe('NativeChatInteractiveCard answer lifecycle', () => { @@ -122,7 +122,7 @@ describe('NativeChatInteractiveCard answer lifecycle', () => { chooseSpacesAndSubmit() expect(screen.getByText('Tabs or spaces?')).toBeInTheDocument() - fireEvent.click(screen.getByRole('button', { name: 'Send answer' })) + fireEvent.click(screen.getByRole('button', { name: 'Submit' })) expect(mocks.sendAnswer).toHaveBeenCalledTimes(2) }) @@ -205,7 +205,7 @@ describe('NativeChatInteractiveCard answer lifecycle', () => { chooseSpacesAndSubmit() act(() => settleDelivery?.(false)) - expect(screen.getByRole('button', { name: 'Send answer' })).toBeEnabled() + expect(screen.getByRole('button', { name: 'Submit' })).toBeEnabled() expect(screen.getByText('Tabs or spaces?')).toBeInTheDocument() }) }) diff --git a/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx b/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx index 3e2a8b277..26805ed2f 100644 --- a/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatQuestionCard.test.tsx @@ -75,7 +75,7 @@ describe('NativeChatQuestionCard', () => { render(tabsOrSpaces, onAnswer) clickOption('Spaces') - clickAction('Send answer') + clickAction('Submit') expect(onAnswer).toHaveBeenCalledWith([{ indices: [1], other: '' }]) }) @@ -97,7 +97,7 @@ describe('NativeChatQuestionCard', () => { clickOption('Cherry') clickOption('Apple') - clickAction('Send answer') + clickAction('Submit') expect(onAnswer).toHaveBeenCalledWith([{ indices: [0, 2], other: '' }]) }) @@ -118,7 +118,7 @@ describe('NativeChatQuestionCard', () => { ) clickOptionAt(1) - clickAction('Send answer') + clickAction('Submit') expect(onAnswer).toHaveBeenCalledWith([{ indices: [1], other: '' }]) }) @@ -133,7 +133,7 @@ describe('NativeChatQuestionCard', () => { setter.call(input, 'four spaces') input.dispatchEvent(new Event('input', { bubbles: true })) }) - clickAction('Send answer') + clickAction('Submit') expect(onAnswer).toHaveBeenCalledWith([{ indices: [], other: 'four spaces' }]) }) diff --git a/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx b/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx index d5241e23b..adabecf67 100644 --- a/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx +++ b/src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx @@ -209,7 +209,7 @@ export function NativeChatQuestionCard({ disabled={isSubmitting} onClick={() => confirm()} className={cn( - 'w-24 shrink-0 rounded-md px-3 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-50', + 'shrink-0 whitespace-nowrap rounded-md px-3 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-50', currentAnswered ? 'bg-primary text-primary-foreground hover:bg-primary/90' : 'text-muted-foreground hover:bg-accent hover:text-accent-foreground' @@ -219,7 +219,7 @@ export function NativeChatQuestionCard({ ? translate('components.native-chat.question.sending', 'Sending…') : currentAnswered ? isLast - ? translate('components.native-chat.question.send', 'Send answer') + ? translate('components.native-chat.question.send', 'Submit') : translate('components.native-chat.question.next', 'Next') : translate('components.native-chat.question.skip', 'Skip')} diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 98972cf07..29218566e 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -14867,7 +14867,7 @@ "other": "Other…", "otherPlaceholder": "Type your answer", "cancel": "Cancel", - "send": "Send answer", + "send": "Submit", "next": "Next", "skip": "Skip", "sending": "Sending…" diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 68a9bcb8f..e32c1ca23 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -14526,7 +14526,7 @@ "other": "Otro…", "otherPlaceholder": "Escribe tu respuesta", "cancel": "Cancelar", - "send": "Enviar respuesta", + "send": "Enviar", "next": "Siguiente", "skip": "Omitir", "sending": "Enviando…" diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 9ef5a69cb..16a92c12c 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -14526,7 +14526,7 @@ "other": "他の…", "otherPlaceholder": "答えを入力してください", "cancel": "キャンセル", - "send": "回答を送信する", + "send": "送信", "next": "次へ", "skip": "スキップ", "sending": "送信中…" diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index d6c3e34fc..0489f1850 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -14537,7 +14537,7 @@ "other": "다른…", "otherPlaceholder": "답변을 입력하세요", "cancel": "취소", - "send": "답변 보내기", + "send": "제출", "next": "다음", "skip": "건너뛰기", "sending": "전송 중…" diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index c5f255fe4..1b197b3ea 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -14546,7 +14546,7 @@ "other": "其他…", "otherPlaceholder": "输入你的回答", "cancel": "取消", - "send": "发送回答", + "send": "提交", "next": "下一步", "skip": "跳过", "sending": "正在发送…" diff --git a/tests/e2e/native-chat-ask-user-question-card.spec.ts b/tests/e2e/native-chat-ask-user-question-card.spec.ts index a4cc2d7c4..a3788e5aa 100644 --- a/tests/e2e/native-chat-ask-user-question-card.spec.ts +++ b/tests/e2e/native-chat-ask-user-question-card.spec.ts @@ -146,10 +146,10 @@ test.describe('Desktop chat AskUserQuestion card (#11761)', () => { // The submit button reads "Skip" until an option is chosen; picking one is // what proves the card is answerable rather than merely rendered. await orcaPage.getByRole('button', { name: /Spaces/ }).click() - await expect(orcaPage.getByRole('button', { name: 'Send answer' })).toBeVisible() + await expect(orcaPage.getByRole('button', { name: 'Submit' })).toBeVisible() await orcaPage.screenshot({ path: path.join(screenshotDir, '02-option-selected.png') }) - await orcaPage.getByRole('button', { name: 'Send answer' }).click() + await orcaPage.getByRole('button', { name: 'Submit' }).click() // The card owns the composer slot, so its disappearance is the visible // signal that the answer was accepted and chat input came back. await expect(orcaPage.getByText(QUESTION)).toHaveCount(0, { timeout: 20_000 })