[PR #21694] [CLOSED] feat: make Action Rich UI (embed) placement configurable per-action #129869

Closed
opened 2026-05-21 13:30:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21694
Author: @Classic298
Created: 2/21/2026
Status: ❌ Closed

Base: dev ← Head: configurable-rich-ui-placement


📝 Commits (1)

  • c7a21e8 feat: make Action Rich UI (embed) placement configurable per-action

📊 Changes

4 files changed (+30 additions, -4 deletions)

View changed files

📝 backend/open_webui/socket/main.py (+9 -3)
📝 backend/open_webui/utils/actions.py (+1 -0)
📝 src/lib/components/chat/Chat.svelte (+3 -0)
📝 src/lib/components/chat/Messages/ResponseMessage.svelte (+17 -1)

📄 Description

Description

Follow-up to discussion #21482.

Makes Action Rich UI (embed) placement configurable per-action. Actions now default to rendering embeds below the assistant message, near the action button. Developers can override this by specifying placement in the embed event data.

Tool Rich UI is unaffected — it already renders inline at the tool call invocation point.

Why

As discussed in #21482, the previous fixed "top" placement caused UX issues:

  • For long messages, clicking an action button appeared broken because the Rich UI rendered out of view at the top
  • The result (Rich UI) should follow its source (the message content), matching natural derivation logic
  • Tool Rich UI already renders inline at the invocation point — Action Rich UI should similarly appear near the action button
  • Community consensus strongly favored "bottom" as the default

What changed

Backend:

  • actions.py: Sends placement alongside embeds in the event data (default: bottom)
  • socket/main.py: Persists embed_placement on the message from the event data

Frontend:

  • Chat.svelte: Reads placement from the embed event and stores it on the message
  • ResponseMessage.svelte: Renders embeds above or below content based on the message's embed_placement (defaults to bottom when unset)

Developer usage

Placement is controlled per-action. The default for actions is bottom. Developers who manually emit embeds via the event emitter can specify placement:

await __event_emitter__({"type": "embeds", "data": {"embeds": [...], "placement": "top"}})

### Contributor License Agreement

<!--
🚨 DO NOT DELETE THE TEXT BELOW 🚨
Keep the "Contributor License Agreement" confirmation text intact.
Deleting it will trigger the CLA-Bot to INVALIDATE your PR.
-->

By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.

> [!NOTE]
> Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/21694 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 2/21/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `configurable-rich-ui-placement` --- ### 📝 Commits (1) - [`c7a21e8`](https://github.com/open-webui/open-webui/commit/c7a21e809896787b26feae6a8bfaf02f7898bf5d) feat: make Action Rich UI (embed) placement configurable per-action ### 📊 Changes **4 files changed** (+30 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/socket/main.py` (+9 -3) 📝 `backend/open_webui/utils/actions.py` (+1 -0) 📝 `src/lib/components/chat/Chat.svelte` (+3 -0) 📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+17 -1) </details> ### 📄 Description ### Description Follow-up to discussion #21482. Makes Action Rich UI (embed) placement configurable per-action. Actions now default to rendering embeds below the assistant message, near the action button. Developers can override this by specifying placement in the embed event data. Tool Rich UI is unaffected — it already renders inline at the tool call invocation point. ### Why As discussed in #21482, the previous fixed "top" placement caused UX issues: - For long messages, clicking an action button appeared broken because the Rich UI rendered out of view at the top - The result (Rich UI) should follow its source (the message content), matching natural derivation logic - Tool Rich UI already renders inline at the invocation point — Action Rich UI should similarly appear near the action button - Community consensus strongly favored "bottom" as the default ### What changed **Backend:** - actions.py: Sends placement alongside embeds in the event data (default: bottom) - socket/main.py: Persists embed_placement on the message from the event data **Frontend:** - Chat.svelte: Reads placement from the embed event and stores it on the message - ResponseMessage.svelte: Renders embeds above or below content based on the message's embed_placement (defaults to bottom when unset) ### Developer usage Placement is controlled per-action. The default for actions is bottom. Developers who manually emit embeds via the event emitter can specify placement: ```python await __event_emitter__({"type": "embeds", "data": {"embeds": [...], "placement": "top"}}) ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. --> By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 13:30:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#129869