fix(ui): compact embedded chat URLs (#2431)

* fix(ui): keep embedded session chat URLs compact

* test(ui): guard embedded session chat URL length

* fix(ui): sync embedded custom themes

Bootstrap custom themes from parent window so iframe URLs stay compact.

Refs #2423

* docs(ui): clarify theme sync precedence
This commit is contained in:
Kai Yang
2026-07-26 15:33:04 +03:00
committed by GitHub
parent ae40f0fe7d
commit 023ec2362e
6 changed files with 135 additions and 22 deletions
@@ -2457,6 +2457,10 @@ export const ContextPanel: React.FC = () => {
}
const data = event.data as { type?: unknown };
if (data?.type === 'openchamber:theme-sync-request') {
postThemeSyncToEmbeddedChat();
return;
}
if (data?.type === 'openchamber:chat-settings-request') {
postChatSettingsSyncToEmbeddedChat();
return;
@@ -2473,7 +2477,7 @@ export const ContextPanel: React.FC = () => {
window.addEventListener('message', handleMessage);
return () => window.removeEventListener('message', handleMessage);
}, [postChatSettingsSyncToEmbeddedChat, setThemeMode, themeMode]);
}, [postChatSettingsSyncToEmbeddedChat, postThemeSyncToEmbeddedChat, setThemeMode, themeMode]);
React.useLayoutEffect(() => {
const hasAnyChatTab = tabs.some((tab) => tab.mode === 'chat');