feat(settings): move IM bot to top-level menu

Remove the legacy Plugins-tab registrations, keep the channel-logo navigation, and harden upgrade/package verification.
This commit is contained in:
xmanrui 2026-08-25 22:42:41 +08:00
parent 892e18db77
commit 1ce8126edb
30 changed files with 815 additions and 842 deletions

View file

@ -5,15 +5,11 @@ import test from 'node:test';
const CLIENT_URL = new URL('../../../plugin-src/client/channels/dingtalk/index.js', import.meta.url);
const STYLES_URL = new URL('../../../plugin-src/client/channels/dingtalk/styles.js', import.meta.url);
test('standalone client exports a reusable settings component and registration', async () => {
test('channel client exports a reusable settings component without a standalone settings registration', async () => {
const source = await readFile(CLIENT_URL, 'utf8');
assert.match(source, /export const name = 'dingtalk-settings'/);
assert.match(source, /export const inject = \['slots', 'connection'\]/);
assert.match(source, /export function DingtalkSettingsTab\(\{ rpcCall \}\)/);
assert.match(source, /export function apply\(ctx\)/);
assert.match(source, /ctx\.connection\.rpc\.call\(DINGTALK_RPC_CHANNEL/);
assert.match(source, /id: 'dingtalk'/);
assert.match(source, /label: '钉钉'/);
assert.doesNotMatch(source, /export function apply\(ctx\)/);
assert.doesNotMatch(source, /settings\.plugins\.tab/);
});
test('QR guidance describes the complete official DingTalk authorization flow', async () => {

View file

@ -993,7 +993,7 @@ test('bridge tells users to grant im:message:readonly when Feishu rejects image
assert.match(sent[0], /im:message:readonly/);
assert.match(sent[0], /\/repair/);
assert.match(sent[0], /发布新版本/);
assert.match(sent[0], /插件页面/);
assert.match(sent[0], /「IM机器人」设置页/);
assert.match(sent[0], /补全权限/);
assert.doesNotMatch(sent[0], /99991672|HTTP 400|secret-shaped|private\/path/);
});

View file

@ -184,7 +184,7 @@ test('Feishu image loading maps the missing message scope to an actionable error
assert.equal(error.code, 'feishu-image-permission-required');
assert.match(error.userMessage, /im:message:readonly/);
assert.match(error.userMessage, /\/repair/);
assert.match(error.userMessage, /插件页面/);
assert.match(error.userMessage, /「IM机器人」设置页/);
assert.match(error.userMessage, /补全权限/);
assert.match(error.userMessage, /发布新版本/);
assert.equal(error.cause, providerError);

View file

@ -791,7 +791,7 @@ test('connection test uses the selected bot runtime and shared message copy', as
await fx.controller.initialize();
assert.deepEqual(await fx.controller.sendConnectionTest(healthy.id), { sent: true });
assert.deepEqual(fx.runtimes.get(healthy.id)[0].sentTests, [
'✅ DeepSeek Harness 连接测试成功\n这条消息由插件页面中的“机器人 healthy(cli_heal••••7890)”机器人卡片发出。',
'✅ DeepSeek Harness 连接测试成功\n这条消息由「IM机器人」设置页中的“机器人 healthy(cli_heal••••7890)”机器人卡片发出。',
]);
await fx.controller.close();
});

View file

@ -1378,7 +1378,7 @@ test('WhatsApp controller delegates connection test copy to the current runtime'
await controller.initialize();
assert.deepEqual(await controller.sendConnectionTest(config.botId), { sent: true });
assert.deepEqual(sent, [
'✅ DeepSeek Harness 连接测试成功\n这条消息由插件页面中的“Harness WhatsApp(1650••••0123)”机器人卡片发出。',
'✅ DeepSeek Harness 连接测试成功\n这条消息由「IM机器人」设置页中的“Harness WhatsApp(1650••••0123)”机器人卡片发出。',
]);
});