diff --git a/src/components/ComposerQueuedMessages.test.ts b/src/components/ComposerQueuedMessages.test.ts index 7fec099cb3..0d3d4cf19c 100644 --- a/src/components/ComposerQueuedMessages.test.ts +++ b/src/components/ComposerQueuedMessages.test.ts @@ -134,14 +134,16 @@ describe("QueuedComposerMessages", () => { expect(withoutEdit).not.toContain("Edit queued message"); }); - it("says the fallback Steer stops the running turn when the engine cannot steer live", () => { + it("shows Stop and send on the button when the engine cannot steer live", () => { const base = { items: oneItem, onSteer: () => undefined, onCancel: () => undefined } as const; const liveMarkup = renderToStaticMarkup(createElement(QueuedComposerMessages, base)); expect(liveMarkup).toContain("aria-label=\"Steer queued message now\""); const interruptMarkup = renderToStaticMarkup( createElement(QueuedComposerMessages, { ...base, steerInterrupts: true }), ); - expect(interruptMarkup).toContain("aria-label=\"Stop the running turn and send this message now\""); + expect(interruptMarkup).toContain(">Stop and send"); + expect(interruptMarkup).toContain('aria-label="Stop and send"'); + expect(interruptMarkup).toContain('title="Stop the running turn and send this message now"'); expect(interruptMarkup).not.toContain("aria-label=\"Steer queued message now\""); }); @@ -174,10 +176,24 @@ describe("QueuedComposerMessages", () => { onCancel: () => undefined, }), ); - expect(markup).toContain("aria-label=\"Stop the running turn and send the next queued message now\""); + expect(markup).toContain(">Stop and send next"); + expect(markup).toContain('aria-label="Stop and send next"'); + expect(markup).toContain('title="Stop the running turn and send the next queued message now"'); expect(markup).not.toContain("aria-label=\"Steer the next queued message now\""); }); + it("shows Stop and send all when the action will stop the turn and drain the direct queue", () => { + const markup = renderToStaticMarkup(createElement(QueuedComposerMessages, { + items: [{ queueId: "q1", text: "first" }, { queueId: "q2", text: "second" }], + onSteer: () => undefined, + onCancel: () => undefined, + steerInterrupts: true, + })); + expect(markup).toContain(">Stop and send all"); + expect(markup).toContain('aria-label="Stop and send all"'); + expect(markup).toContain('title="Stop the running turn and send all 2 queued messages now"'); + }); + it("puts the queue-level Steer action on the head only and keeps every delete distinct", () => { const markup = renderToStaticMarkup( createElement(QueuedComposerMessages, { diff --git a/src/components/ComposerQueuedMessages.tsx b/src/components/ComposerQueuedMessages.tsx index 7768c957c9..f776d6fd19 100644 --- a/src/components/ComposerQueuedMessages.tsx +++ b/src/components/ComposerQueuedMessages.tsx @@ -68,11 +68,15 @@ export function QueuedComposerMessages({ const multiple = items.length > 1; const steerLabel = steering ? t("composer.queued.steering") - : multiple - ? steerMode === "all" - ? t("composer.queued.steerAll") - : t("composer.queued.steerNext") - : t("composer.queued.steer"); + : steerInterrupts + ? multiple + ? t(steerMode === "all" ? "composer.queued.stopAndSendAll" : "composer.queued.stopAndSendNext") + : t("composer.queued.stopAndSend") + : multiple + ? steerMode === "all" + ? t("composer.queued.steerAll") + : t("composer.queued.steerNext") + : t("composer.queued.steer"); const steerDescription = steerInterrupts ? multiple ? steerMode === "all" @@ -122,7 +126,7 @@ export function QueuedComposerMessages({ type="button" onClick={onSteer} disabled={steering} - aria-label={steering ? t("composer.queued.steeringAria") : steerDescription} + aria-label={steering ? t("composer.queued.steeringAria") : steerInterrupts ? steerLabel : steerDescription} title={steerDescription} className="flex h-7 shrink-0 items-center gap-1 rounded-lg px-2 text-[13px] font-medium text-ink-secondary outline-none hover:bg-raised-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-accent/60 disabled:cursor-wait disabled:opacity-60" > diff --git a/src/locales/en.json b/src/locales/en.json index 6963ba8aec..66cb808afd 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -2941,6 +2941,9 @@ "composer.queued.steerAll": "Steer all", "composer.queued.steerNext": "Steer next", "composer.queued.steer": "Steer", + "composer.queued.stopAndSend": "Stop and send", + "composer.queued.stopAndSendAll": "Stop and send all", + "composer.queued.stopAndSendNext": "Stop and send next", "composer.queued.steerAllHint": "Steer all {count} queued messages now", "composer.queued.steerNextHint": "Steer the next queued message now", "composer.queued.steerHint": "Steer queued message now", diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json index 3f69f25714..5bc5b30d6a 100644 --- a/src/locales/pt-br.json +++ b/src/locales/pt-br.json @@ -2806,6 +2806,9 @@ "composer.queued.steerAll": "Enviar todas agora", "composer.queued.steerNext": "Enviar a próxima agora", "composer.queued.steer": "Enviar agora", + "composer.queued.stopAndSend": "Parar e enviar", + "composer.queued.stopAndSendAll": "Parar e enviar todas", + "composer.queued.stopAndSendNext": "Parar e enviar a próxima", "composer.queued.steerAllHint": "Enviar agora todas as {count} mensagens na fila", "composer.queued.steerNextHint": "Enviar agora a próxima mensagem da fila", "composer.queued.steerHint": "Enviar agora a mensagem da fila", diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.json index 768b9ddf2d..9449e25373 100644 --- a/src/locales/source-hashes.json +++ b/src/locales/source-hashes.json @@ -26453,6 +26453,9 @@ "composer.queued.steerAll": "3dbef7d2b69f32c426094bec3d3001a2e9f1abe560012c9d9cded8d0cbc2985d", "composer.queued.steerNext": "bbe9e8b657832c304ffe5e845ae93dca1e1c706af1fa7f2304bb575845d6cfca", "composer.queued.steer": "1cf39ed452541de41e0b1688ef67a1eb19c8823d8de23e2a05a5e9b95192901b", + "composer.queued.stopAndSend": "87c1a8d4e59f78757cd4549151cb0d736016067816c2ff780b121616144f9331", + "composer.queued.stopAndSendAll": "58414c1551260488f933d956477c5fef7a27cbcf9ed1614b688bb81b79fe4350", + "composer.queued.stopAndSendNext": "02338a95dff6690ac551c64e81e1765afc5e69326918bca87ee64b189e074a6e", "composer.queued.steerAllHint": "74ec9088c53719d75e98026973d2ddfe69602cf824de02935641b84d49fe031b", "composer.queued.steerNextHint": "e16f53cc7499a295cc0e1fc8ed25a8970e84e35bb9e488f688c68ffeb8c2ec5d", "composer.queued.steerHint": "27b97eb3726a423c9e471a8020b68426f1f429da79d131099c1e67340c5d9348", @@ -42757,6 +42760,9 @@ "composer.queued.steerAll": "3dbef7d2b69f32c426094bec3d3001a2e9f1abe560012c9d9cded8d0cbc2985d", "composer.queued.steerNext": "bbe9e8b657832c304ffe5e845ae93dca1e1c706af1fa7f2304bb575845d6cfca", "composer.queued.steer": "1cf39ed452541de41e0b1688ef67a1eb19c8823d8de23e2a05a5e9b95192901b", + "composer.queued.stopAndSend": "87c1a8d4e59f78757cd4549151cb0d736016067816c2ff780b121616144f9331", + "composer.queued.stopAndSendAll": "58414c1551260488f933d956477c5fef7a27cbcf9ed1614b688bb81b79fe4350", + "composer.queued.stopAndSendNext": "02338a95dff6690ac551c64e81e1765afc5e69326918bca87ee64b189e074a6e", "composer.queued.steerAllHint": "74ec9088c53719d75e98026973d2ddfe69602cf824de02935641b84d49fe031b", "composer.queued.steerNextHint": "e16f53cc7499a295cc0e1fc8ed25a8970e84e35bb9e488f688c68ffeb8c2ec5d", "composer.queued.steerHint": "27b97eb3726a423c9e471a8020b68426f1f429da79d131099c1e67340c5d9348", diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json index 18e2562c16..1cc3901900 100644 --- a/src/locales/zh-tw.json +++ b/src/locales/zh-tw.json @@ -2875,6 +2875,9 @@ "composer.queued.steerAll": "全部引導", "composer.queued.steerNext": "引導下一則", "composer.queued.steer": "引導", + "composer.queued.stopAndSend": "停止並傳送", + "composer.queued.stopAndSendAll": "停止並傳送全部", + "composer.queued.stopAndSendNext": "停止並傳送下一則", "composer.queued.steerAllHint": "立即引導佇列中全部 {count} 則訊息", "composer.queued.steerNextHint": "立即引導佇列中的下一則訊息", "composer.queued.steerHint": "立即引導佇列中的訊息",