fix(web): hide duplicate connection mode control (#2621)

* fix(web): hide duplicate connection mode control

* fix(web): restore event processor guide target

---------

Co-authored-by: RockChinQ <[email protected]>
This commit is contained in:
Dongchuan Fu
2026-10-09 00:35:00 +08:00
committed by GitHub
co-authored by RockChinQ
parent ec3a396f1d
commit 4c7592887d
5 changed files with 46 additions and 2 deletions
+2 -1
View File
@@ -203,7 +203,8 @@ test('bot guide starts on the detail page after adapter-only creation', async ({
const adapterCard = page.locator('[data-slot="card"]').filter({
has: page.getByText('Adapter Configuration', { exact: true }),
});
await expect(adapterCard.getByRole('switch')).toBeChecked();
await expect(adapterCard.getByRole('switch')).toHaveCount(0);
await expect(page.getByRole('radio', { name: /^Webhook/ })).toBeChecked();
await guide.getByRole('button', { name: 'Next' }).click();
await expect(
@@ -17,6 +17,9 @@ const homeSidebarSource = readSource(
const botFormSource = readSource(
'src/app/home/bots/components/bot-form/BotForm.tsx',
);
const dynamicFormSource = readSource(
'src/app/home/components/dynamic-form/DynamicFormComponent.tsx',
);
const kbFormSource = readSource(
'src/app/home/knowledge/components/kb-form/KBForm.tsx',
);
@@ -52,6 +55,27 @@ test('keeps bot forms spaced with responsive setup and detail columns', () => {
assert.match(kbFormSource, /<form[\s\S]*?className="space-y-6"/);
});
test('hides the manifest connection switch behind the dedicated selector', () => {
assert.match(
botFormSource,
/webhookField\?\.show_if\?\.field\s*\?\s*\[webhookField\.show_if\.field\]/,
);
assert.match(
botFormSource,
/hiddenItemNames=\{connectionModeControllerNames\}/,
);
assert.match(
dynamicFormSource,
/if \(hiddenItemNames\?\.includes\(config\.name\)\) return null/,
);
assert.doesNotMatch(
dynamicFormSource.match(
/const editableItems = useMemo\([\s\S]*?\n \);/,
)?.[0] ?? '',
/hiddenItemNames/,
);
});
test('does not expose storage analysis in Cloud settings or via a deep link', () => {
assert.match(
homeSidebarSource,