feat(pipes): update richui mode to send raw HTML content instead of an iframe tag

This commit is contained in:
fujie
2026-02-28 13:11:03 +08:00
parent dcfde9c0dc
commit 8001ab18ee

View File

@@ -1239,9 +1239,13 @@ class Pipe:
# Note: Emission is now delayed until session.idle to avoid UI flicker and ensure reliability. # Note: Emission is now delayed until session.idle to avoid UI flicker and ensure reliability.
if is_html and embed_type == "richui" and rich_ui_supported: if is_html and embed_type == "richui" and rich_ui_supported:
try: try:
# For Rich UI Integrated view, we pass a bare iframe. # For Rich UI Mode, OpenWebUI expects the raw HTML of the component itself
# We let the OpenWebUI system control styling, height, and sandboxing. # The system will wrap this in its own managed iframe.
embed_content = f'<iframe src="{view_url}"></iframe>' embed_content = await asyncio.to_thread(
lambda: target_path.read_text(
encoding="utf-8", errors="replace"
)
)
if pending_embeds is not None: if pending_embeds is not None:
pending_embeds.append( pending_embeds.append(