You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/08/25 16:38:37 UTC

(maka) branch main updated: test(ui): pin the humanized provider retry banner copy across locales and scales (#3701)

This is an automated email from the ASF dual-hosted git repository.

Astro-Han pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/maka.git


The following commit(s) were added to refs/heads/main by this push:
     new d2754b1ee test(ui): pin the humanized provider retry banner copy across locales and scales (#3701)
d2754b1ee is described below

commit d2754b1eeb955f6914f400ca223ddcf382dfc23a
Author: Zhang <96...@users.noreply.github.com>
AuthorDate: Wed Aug 26 00:38:32 2026 +0800

    test(ui): pin the humanized provider retry banner copy across locales and scales (#3701)
---
 .../ui/src/__tests__/conversation-copy.test.ts     | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/packages/ui/src/__tests__/conversation-copy.test.ts b/packages/ui/src/__tests__/conversation-copy.test.ts
index 08b6d1250..9f165f92b 100644
--- a/packages/ui/src/__tests__/conversation-copy.test.ts
+++ b/packages/ui/src/__tests__/conversation-copy.test.ts
@@ -24,3 +24,35 @@ import { getConversationCopy } from '../conversation-copy.js';
 test('labels the Chinese default thinking level as default', () => {
   assert.equal(getConversationCopy('zh').model.defaultLevel, '默认');
 });
+
+/**
+ * A subscription quota window can hand the runtime an hour-scale Retry-After;
+ * the banner must count down in humanized d/h/m/s units rather than a raw
+ * five-digit second count that reads as a frozen hang (#3401).
+ */
+test('providerRetryScheduled humanizes hour-scale delays in both locales', () => {
+  const zh = getConversationCopy('zh').messages.providerRetryScheduled;
+  const en = getConversationCopy('en').messages.providerRetryScheduled;
+
+  // Sub-second and zero inputs still read as one second (never "0秒后重试").
+  assert.equal(zh(0, 2, 10), '1秒后重试(2/10)');
+  assert.equal(en(0, 2, 10), 'Retrying in 1s (2/10)');
+
+  // Short delays keep the compact seconds-only form.
+  assert.equal(zh(1, 2, 10), '1秒后重试(2/10)');
+  assert.equal(en(1, 2, 10), 'Retrying in 1s (2/10)');
+  assert.equal(zh(45, 2, 10), '45秒后重试(2/10)');
+  assert.equal(en(45, 2, 10), 'Retrying in 45s (2/10)');
+
+  // Minute-, hour-, and day-scale delays spell out the units.
+  assert.equal(zh(75, 2, 10), '1分 15秒后重试(2/10)');
+  assert.equal(en(75, 2, 10), 'Retrying in 1m 15s (2/10)');
+  assert.equal(zh(16_083, 2, 10), '4小时 28分 3秒后重试(2/10)');
+  assert.equal(en(16_083, 2, 10), 'Retrying in 4h 28m 3s (2/10)');
+  assert.equal(zh(90_061, 2, 10), '1天 1小时 1分 1秒后重试(2/10)');
+  assert.equal(en(90_061, 2, 10), 'Retrying in 1d 1h 1m 1s (2/10)');
+
+  // Zero-order units are skipped, not rendered as "0分".
+  assert.equal(zh(3_600, 2, 10), '1小时后重试(2/10)');
+  assert.equal(en(86_400, 2, 10), 'Retrying in 1d (2/10)');
+});


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org