fix: polish English settings UI

This commit is contained in:
xmanrui 2026-08-25 23:13:09 +08:00
parent 40b5a46516
commit f79375a0b0
5 changed files with 30 additions and 8 deletions

View file

@ -308,7 +308,7 @@ var EN = Object.freeze({
"IM\u673A\u5668\u4EBA": "IM bots",
"IM\u673A\u5668\u4EBA\u8BBE\u7F6E": "IM bot settings",
"IM \u6E20\u9053": "IM channels",
"\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA": "DeepSeek Harness, always within reach",
"\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA": "Connecting DeepSeek Harness",
"\u5F53\u524D\u7248\u672C": "Current version",
"AI Office": "AI Office",
"\uFF08\u5B9E\u9A8C\u529F\u80FD\uFF09": "(Experimental)",
@ -818,6 +818,9 @@ var EN = Object.freeze({
"QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6": "QQ did not return QR setup progress",
"QQ \u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1": "QQ did not return a valid setup attempt",
"QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38": "QQ WebSocket connection is healthy",
"QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002": "The QQ connection is not ready; the plugin will retry automatically.",
"QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5": "The QQ connection is not ready; the plugin will retry automatically",
"QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF": "The QQ connection is currently offline",
"QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868": "QQ did not return a valid bot list",
"\u5C1A\u672A\u7ED1\u5B9A QQ \u673A\u5668\u4EBA": "No QQ bot connected yet",
"\u7528\u4E8E\u7ED1\u5B9A QQ \u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801": "One-time QR code for connecting a QQ bot",
@ -10336,7 +10339,7 @@ var CSS11 = String.raw`
.dim-githubLink:hover { border-color: #aeb3bb; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
.dim-githubLink:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 70%, white); outline-offset: 2px; }
.dim-githubArrow { font-size: 13px; line-height: 1; }
.dim-githubTooltip { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(220px, 80vw); padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.dim-githubTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: max-content; max-width: min(220px, 80vw); padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.dim-githubAction:hover .dim-githubTooltip, .dim-githubAction:focus-within .dim-githubTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
.dim-layout { display: grid; grid-template-columns: 174px 1px minmax(0, 1fr); gap: 24px; align-items: start; }
.dim-rail { max-height: 520px; display: grid; align-content: start; gap: 8px; overflow-y: auto; padding: 1px 4px 1px 1px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-border-l2, #dfe1e5) transparent; }

File diff suppressed because one or more lines are too long

View file

@ -7,7 +7,7 @@ const EN = Object.freeze({
'IM机器人': 'IM bots',
'IM机器人设置': 'IM bot settings',
'IM 渠道': 'IM channels',
'让 DeepSeek Harness 触手可及': 'DeepSeek Harness, always within reach',
'让 DeepSeek Harness 触手可及': 'Connecting DeepSeek Harness',
'当前版本': 'Current version',
'AI Office': 'AI Office',
'(实验功能)': '(Experimental)',
@ -517,6 +517,9 @@ const EN = Object.freeze({
'QQ 服务没有返回扫码绑定进度': 'QQ did not return QR setup progress',
'QQ 扫码服务没有返回有效的绑定任务': 'QQ did not return a valid setup attempt',
'QQ WebSocket 长连接运行正常': 'QQ WebSocket connection is healthy',
'QQ 连接未就绪,插件会自动重试。': 'The QQ connection is not ready; the plugin will retry automatically.',
'QQ 连接未就绪,插件会自动重试': 'The QQ connection is not ready; the plugin will retry automatically',
'QQ 连接当前离线': 'The QQ connection is currently offline',
'QQ 服务没有返回有效的机器人列表': 'QQ did not return a valid bot list',
'尚未绑定 QQ 机器人': 'No QQ bot connected yet',
'用于绑定 QQ 机器人的一次性二维码': 'One-time QR code for connecting a QQ bot',

View file

@ -24,7 +24,7 @@ const CSS = String.raw`
.dim-githubLink:hover { border-color: #aeb3bb; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
.dim-githubLink:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 70%, white); outline-offset: 2px; }
.dim-githubArrow { font-size: 13px; line-height: 1; }
.dim-githubTooltip { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(220px, 80vw); padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.dim-githubTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: max-content; max-width: min(220px, 80vw); padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.dim-githubAction:hover .dim-githubTooltip, .dim-githubAction:focus-within .dim-githubTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
.dim-layout { display: grid; grid-template-columns: 174px 1px minmax(0, 1fr); gap: 24px; align-items: start; }
.dim-rail { max-height: 520px; display: grid; align-content: start; gap: 8px; overflow-y: auto; padding: 1px 4px 1px 1px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-border-l2, #dfe1e5) transparent; }

View file

@ -142,7 +142,7 @@ test('IM settings renders nine IM channels plus the AI Office connector', async
assert.match(styles, /\.dim-brand:hover \.dim-versionTooltip, \.dim-brand:focus \.dim-versionTooltip \{[^}]*opacity: 1;[^}]*visibility: visible;/);
assert.doesNotMatch(styles, /\.dim-brandLogo/);
assert.match(styles, /\.dim-githubLink \{[^}]*border: 1px solid var\(--dsw-alias-border-l2, #dfe1e5\);[^}]*text-decoration: none;/);
assert.match(styles, /\.dim-githubTooltip \{[^}]*bottom: calc\(100% \+ 8px\);[^}]*transform: translateY\(3px\);/);
assert.match(styles, /\.dim-githubTooltip \{[^}]*top: calc\(100% \+ 8px\);[^}]*transform: translateY\(-3px\);/);
assert.match(styles, /\.dim-githubAction:hover \.dim-githubTooltip, \.dim-githubAction:focus-within \.dim-githubTooltip \{[^}]*opacity: 1;[^}]*visibility: visible;/);
assert.doesNotMatch(markup, /\d+ 个渠道|dim-channelCount/);
assert.match(markup, />微信</);
@ -754,7 +754,7 @@ test('client registers one top-level bilingual IM settings section with a direct
registrations[0].component,
injected,
));
assert.match(markup, /DeepSeek Harness, always within reach/);
assert.match(markup, /Connecting DeepSeek Harness/);
assert.match(markup, new RegExp(
`<span>Current version<\\/span><strong>v${IM_PLUGIN_VERSION.replaceAll('.', '\\.')}`,
));
@ -839,6 +839,22 @@ test('all nine channel settings and connected cards render English copy', () =>
assert.match(cardMarkup, /Check connection/);
assert.match(cardMarkup, /Remove connection/);
assert.doesNotMatch(cardMarkup, /[\p{Script=Han}]/u);
const qqRetryMarkup = renderToStaticMarkup(React.createElement(QqAccountCard, {
...sharedCardProps,
removing: false,
account: {
...account,
state: 'error',
connected: false,
error: {
code: 'connection-failed',
message: 'QQ 连接未就绪,插件会自动重试。',
},
},
}));
assert.match(qqRetryMarkup, /The QQ connection is not ready; the plugin will retry automatically\./);
assert.doesNotMatch(qqRetryMarkup, /[\p{Script=Han}]/u);
} finally {
setImTranslator(null);
}