From 96905a8933c1900abf273383218759774b802bb4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 24 Nov 2025 16:50:01 +0000 Subject: [PATCH] Adds a theme selection option (light/dark) to the embed dialog when `Fullscreen Chat (Traditional iframe)` is selected. --- web/src/components/embed-dialog/index.tsx | 39 ++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/web/src/components/embed-dialog/index.tsx b/web/src/components/embed-dialog/index.tsx index 34197ada0..0481b1f67 100644 --- a/web/src/components/embed-dialog/index.tsx +++ b/web/src/components/embed-dialog/index.tsx @@ -36,6 +36,7 @@ const FormSchema = z.object({ locale: z.string(), embedType: z.enum(['fullscreen', 'widget']), enableStreaming: z.boolean(), + theme: z.enum(['light', 'dark']), }); type IProps = IModalProps & { @@ -61,6 +62,7 @@ function EmbedDialog({ locale: '', embedType: 'fullscreen' as const, enableStreaming: false, + theme: 'light' as const, }, }); @@ -74,7 +76,7 @@ function EmbedDialog({ }, []); const generateIframeSrc = useCallback(() => { - const { visibleAvatar, locale, embedType, enableStreaming } = values; + const { visibleAvatar, locale, embedType, enableStreaming, theme } = values; const baseRoute = embedType === 'widget' ? Routes.ChatWidget @@ -91,6 +93,9 @@ function EmbedDialog({ if (enableStreaming) { src += '&streaming=true'; } + if (theme && embedType === 'fullscreen') { + src += `&theme=${theme}`; + } return src; }, [beta, from, token, values]); @@ -181,6 +186,38 @@ function EmbedDialog({ )} /> + {values.embedType === 'fullscreen' && ( + ( + + Theme + + +
+ + +
+
+ + +
+
+
+ +
+ )} + /> + )}