refine bot delivery settings labels

This commit is contained in:
xmanrui 2026-08-30 13:03:57 +08:00
parent b90cb805c7
commit 32c6d48857
7 changed files with 33 additions and 23 deletions

View file

@ -839,6 +839,7 @@ var EN = Object.freeze({
"$locale": "en",
"IM\u673A\u5668\u4EBA": "IM bots",
"IM\u673A\u5668\u4EBA\u8BBE\u7F6E": "IM bot settings",
"\u66F4\u591A\u673A\u5668\u4EBA\u8BBE\u7F6E": "More bot settings",
"IM \u6E20\u9053": "IM channels",
"\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA": "Connecting DeepSeek Harness",
"\u5F53\u524D\u7248\u672C": "Current version",
@ -1580,7 +1581,6 @@ var EN = Object.freeze({
"\u6253\u5F00\u4E3B\u52A8\u6295\u9012\u4F7F\u7528\u6587\u6863": "Open the proactive delivery guide",
"\u5F53\u524D\u6E20\u9053\u6682\u4E0D\u652F\u6301\u6295\u9012\u76EE\u6807\u3002": "Delivery targets are not supported for this channel.",
"\u5DF2\u590D\u5236 Bot ID": "Bot ID copied",
"\u8C03\u7528\u6807\u8BC6": "Call identifiers",
"\u590D\u5236": "Copy",
"\u6295\u9012\u76EE\u6807": "Delivery targets",
"\u673A\u5668\u4EBA\u5F53\u524D\u79BB\u7EBF\uFF1B\u4ECD\u53EF\u914D\u7F6E\u76EE\u6807\uFF0C\u6062\u590D\u8FDE\u63A5\u540E\u518D\u6D4B\u8BD5\u3002": "The bot is offline. You can still configure targets and test them after reconnection.",
@ -3089,7 +3089,7 @@ function BotSettingsButton({ channel: channel4, botId, botName, connected }) {
type: "button",
className: "dim-botSettingsButton",
"data-delivery-channel": channel4,
"aria-label": "\u673A\u5668\u4EBA\u8BBE\u7F6E",
"aria-label": "\u66F4\u591A\u673A\u5668\u4EBA\u8BBE\u7F6E",
"aria-describedby": tooltipId,
onClick: () => openBotSettings?.({
channel: channel4,
@ -3102,7 +3102,7 @@ function BotSettingsButton({ channel: channel4, botId, botName, connected }) {
id: tooltipId,
className: "dim-botSettingsTooltip",
role: "tooltip"
}, "\u673A\u5668\u4EBA\u8BBE\u7F6E")
}, "\u66F4\u591A\u673A\u5668\u4EBA\u8BBE\u7F6E")
);
}
function messageErrorTime(value) {
@ -12393,17 +12393,20 @@ function DeliveryTargetSettingsPage({ channel: channel4, account, rpcCall, onBac
},
h2("span", null, "\u4F7F\u7528\u6587\u6863"),
h2("span", { "aria-hidden": "true" }, "\u2197")
),
h2("h2", null, account.botName || "\u673A\u5668\u4EBA\u8BBE\u7F6E")
)
)
),
h2(
"section",
{ className: "dim-deliveryIdentity", "aria-labelledby": "dim-delivery-identity-title" },
{ className: "dim-deliveryIdentity", "aria-labelledby": "dim-delivery-bot-title" },
h2(
"div",
null,
h2("h3", { id: "dim-delivery-identity-title" }, "\u8C03\u7528\u6807\u8BC6")
h2(
"h2",
{ id: "dim-delivery-bot-title", className: "dim-deliveryBotName" },
account.botName || "\u673A\u5668\u4EBA\u8BBE\u7F6E"
)
),
h2(
"div",
@ -12911,7 +12914,6 @@ var CSS11 = String.raw`
.dim-deliveryPage { min-width: 0; display: grid; gap: 14px; }
.dim-deliveryHeader { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dim-deliveryHeaderMeta { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: right; }
.dim-deliveryHeader h2 { min-width: 0; overflow: hidden; margin: 0; font-size: 18px; line-height: 24px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.dim-deliveryDocsLink { min-height: 30px; flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 7px; color: var(--dsw-alias-state-business-primary, #3370ff); font-size: 12px; line-height: 18px; text-decoration: none; white-space: nowrap; }
.dim-deliveryDocsLink:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #3370ff) 8%, transparent); }
.dim-deliveryDocsLink:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #3370ff); outline-offset: 2px; }
@ -12923,7 +12925,7 @@ var CSS11 = String.raw`
.dim-deliveryButton[data-kind="danger"] { color: var(--dsw-alias-state-error-primary, #d54941); }
.dim-deliveryBack { flex: none; border-color: transparent; background: transparent; }
.dim-deliveryIdentity, .dim-deliveryTargets { min-width: 0; padding: 16px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 12px; background: var(--dsw-alias-bg-layer-3, #fff); }
.dim-deliveryIdentity > div:first-child h3, .dim-deliverySectionHeading h3 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 650; }
.dim-deliveryBotName, .dim-deliverySectionHeading h3 { min-width: 0; overflow: hidden; margin: 0; font-size: 15px; line-height: 22px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.dim-deliveryIdentity > div:first-child p, .dim-deliverySectionHeading p { margin: 2px 0 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
.dim-deliveryBotId { min-width: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
.dim-deliveryBotId > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; }

File diff suppressed because one or more lines are too long

View file

@ -30,7 +30,7 @@ export function BotSettingsButton({ channel, botId, botName, connected }) {
type: 'button',
className: 'dim-botSettingsButton',
'data-delivery-channel': channel,
'aria-label': '机器人设置',
'aria-label': '更多机器人设置',
'aria-describedby': tooltipId,
onClick: () => openBotSettings?.({
channel,
@ -43,7 +43,7 @@ export function BotSettingsButton({ channel, botId, botName, connected }) {
id: tooltipId,
className: 'dim-botSettingsTooltip',
role: 'tooltip',
}, '机器人设置'));
}, '更多机器人设置'));
}
function messageErrorTime(value) {

View file

@ -669,11 +669,11 @@ export function DeliveryTargetSettingsPage({ channel, account, rpcCall, onBack }
'aria-label': '打开主动投递使用文档',
},
h('span', null, '使用文档'),
h('span', { 'aria-hidden': 'true' }, '↗')),
h('h2', null, account.botName || '机器人设置'))),
h('section', { className: 'dim-deliveryIdentity', 'aria-labelledby': 'dim-delivery-identity-title' },
h('span', { 'aria-hidden': 'true' }, '↗')))),
h('section', { className: 'dim-deliveryIdentity', 'aria-labelledby': 'dim-delivery-bot-title' },
h('div', null,
h('h3', { id: 'dim-delivery-identity-title' }, '调用标识')),
h('h2', { id: 'dim-delivery-bot-title', className: 'dim-deliveryBotName' },
account.botName || '机器人设置')),
h('div', { className: 'dim-deliveryBotId' },
h('span', null, 'Bot ID'),
h('code', { title: account.botId }, account.botId),

View file

@ -6,6 +6,7 @@ const EN = Object.freeze({
'$locale': 'en',
'IM机器人': 'IM bots',
'IM机器人设置': 'IM bot settings',
'更多机器人设置': 'More bot settings',
'IM 渠道': 'IM channels',
'让 DeepSeek Harness 触手可及': 'Connecting DeepSeek Harness',
'当前版本': 'Current version',
@ -747,7 +748,6 @@ const EN = Object.freeze({
'打开主动投递使用文档': 'Open the proactive delivery guide',
'当前渠道暂不支持投递目标。': 'Delivery targets are not supported for this channel.',
'已复制 Bot ID': 'Bot ID copied',
'调用标识': 'Call identifiers',
'复制': 'Copy',
'投递目标': 'Delivery targets',
'机器人当前离线;仍可配置目标,恢复连接后再测试。': 'The bot is offline. You can still configure targets and test them after reconnection.',

View file

@ -367,7 +367,6 @@ const CSS = String.raw`
.dim-deliveryPage { min-width: 0; display: grid; gap: 14px; }
.dim-deliveryHeader { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dim-deliveryHeaderMeta { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: right; }
.dim-deliveryHeader h2 { min-width: 0; overflow: hidden; margin: 0; font-size: 18px; line-height: 24px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.dim-deliveryDocsLink { min-height: 30px; flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 7px; color: var(--dsw-alias-state-business-primary, #3370ff); font-size: 12px; line-height: 18px; text-decoration: none; white-space: nowrap; }
.dim-deliveryDocsLink:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #3370ff) 8%, transparent); }
.dim-deliveryDocsLink:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #3370ff); outline-offset: 2px; }
@ -379,7 +378,7 @@ const CSS = String.raw`
.dim-deliveryButton[data-kind="danger"] { color: var(--dsw-alias-state-error-primary, #d54941); }
.dim-deliveryBack { flex: none; border-color: transparent; background: transparent; }
.dim-deliveryIdentity, .dim-deliveryTargets { min-width: 0; padding: 16px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 12px; background: var(--dsw-alias-bg-layer-3, #fff); }
.dim-deliveryIdentity > div:first-child h3, .dim-deliverySectionHeading h3 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 650; }
.dim-deliveryBotName, .dim-deliverySectionHeading h3 { min-width: 0; overflow: hidden; margin: 0; font-size: 15px; line-height: 22px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.dim-deliveryIdentity > div:first-child p, .dim-deliverySectionHeading p { margin: 2px 0 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
.dim-deliveryBotId { min-width: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
.dim-deliveryBotId > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; }

View file

@ -121,10 +121,10 @@ test('all nine robot cards add one accessible settings gear beside existing cont
for (const [channel, Card, props] of cards) {
const markup = renderToStaticMarkup(React.createElement(Card, props));
assert.equal((markup.match(/aria-label="机器人设置"/g) ?? []).length, 1);
assert.equal((markup.match(/aria-label="更多机器人设置"/g) ?? []).length, 1);
assert.match(markup, /class="dim-botCardTools"/);
assert.match(markup, new RegExp(`data-delivery-channel="${channel}"`));
assert.match(markup, /role="tooltip"[^>]*>机器人设置</);
assert.match(markup, /role="tooltip"[^>]*>更多机器人设置</);
}
});
@ -177,15 +177,24 @@ test('the card gear opens a bot-scoped page in the current channel panel and ret
const card = renderer.root.findByProps({ 'data-bot-id': 'wx_stable_bot' });
await act(async () => {
card.findByProps({ 'aria-label': '机器人设置' }).props.onClick();
card.findByProps({ 'aria-label': '更多机器人设置' }).props.onClick();
await flush();
});
const page = renderer.root.findByProps({ className: 'dim-deliveryPage' });
assert.match(textOf(page), /微信通知助手/);
assert.doesNotMatch(textOf(page), /调用标识/);
assert.equal(
page.findByProps({ className: 'dim-deliveryHeader' }).findAllByType('span').length,
2,
);
assert.equal(
page.findByProps({ className: 'dim-deliveryHeader' }).findAllByType('h2').length,
0,
);
assert.equal(
textOf(page.findByProps({ className: 'dim-deliveryIdentity' }).findByType('h2')),
'微信通知助手',
);
const docsLink = page.findByProps({ className: 'dim-deliveryDocsLink' });
assert.equal(textOf(docsLink), '使用文档↗');
assert.equal(