+
-
- {/* Card: Danger Zone */}
- {canManage && (
-
-
-
- {t('bots.dangerZone')}
-
-
- {t('bots.dangerZoneDescription')}
-
-
-
-
-
-
- {t('bots.deleteBotAction')}
-
-
- {t('bots.deleteBotHint')}
-
-
-
-
-
-
- )}
diff --git a/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx b/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx
index 17c362c16..f144653e2 100644
--- a/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx
+++ b/web/src/app/home/bots/components/bot-form/AdapterEventDebugDialog.tsx
@@ -192,12 +192,11 @@ export default function AdapterEventDebugDialog({
diff --git a/web/src/app/home/bots/components/bot-form/BotForm.tsx b/web/src/app/home/bots/components/bot-form/BotForm.tsx
index fd9b66630..9585d1582 100644
--- a/web/src/app/home/bots/components/bot-form/BotForm.tsx
+++ b/web/src/app/home/bots/components/bot-form/BotForm.tsx
@@ -21,8 +21,8 @@ import { systemInfo } from '@/app/infra/http';
import { Agent, Bot } from '@/app/infra/entities/api';
import { getAdapterDocUrl } from '@/app/infra/entities/adapter-docs';
import { ExternalLink, ChevronDown, ChevronRight } from 'lucide-react';
+import { cn } from '@/lib/utils';
import EventBindingsEditor from './EventBindingsEditor';
-import AdapterEventDebugDialog from './AdapterEventDebugDialog';
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
@@ -101,10 +101,17 @@ interface BotFormProps {
onFormSubmit: (value: z.infer
>) => void;
onNewBotCreated: (botId: string) => void;
onDirtyChange?: (dirty: boolean) => void;
+ onAdapterLabelChange?: (label: string) => void;
}
const BotForm = forwardRef(function BotForm(
- { initBotId, onFormSubmit, onNewBotCreated, onDirtyChange },
+ {
+ initBotId,
+ onFormSubmit,
+ onNewBotCreated,
+ onDirtyChange,
+ onAdapterLabelChange,
+ },
ref,
) {
const { t } = useTranslation();
@@ -153,6 +160,12 @@ const BotForm = forwardRef(function BotForm(
// Watch adapter and adapter_config for filtering
const currentAdapter = form.watch('adapter');
+ const adapterLabel =
+ adapterNameList.find((adapter) => adapter.value === currentAdapter)
+ ?.label ?? '';
+ useEffect(() => {
+ onAdapterLabelChange?.(adapterLabel);
+ }, [adapterLabel, onAdapterLabelChange]);
const currentAdapterConfig = form.watch('adapter_config');
// Group adapters by category for the Select dropdown. Legacy adapters are
@@ -440,10 +453,15 @@ const BotForm = forwardRef(function BotForm(
id="bot-form"
onSubmit={form.handleSubmit(onDynamicFormSubmit)}
aria-busy={isLoading}
- className="w-full min-w-0 max-w-full"
+ className={cn('w-full min-w-0 max-w-full', initBotId && 'lg:h-full')}
>