[PR #21852] [CLOSED] feat: add dropdown toggle to filter buttons in chat #41934

Closed
opened 2026-04-25 14:01:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: devHead: filter-dropdown


📝 Commits (3)

  • 8621455 feat: add dropdown toggle to filter buttons in chat (#167)
  • b649843 Merge branch 'dev' into filter-dropdown
  • 3711eaa Merge branch 'dev' into filter-dropdown

📊 Changes

7 files changed (+178 additions, -73 deletions)

View changed files

📝 backend/open_webui/main.py (+1 -0)
📝 backend/open_webui/utils/chat.py (+1 -0)
📝 backend/open_webui/utils/filter.py (+7 -0)
📝 backend/open_webui/utils/models.py (+16 -11)
📝 src/lib/components/chat/Chat.svelte (+39 -1)
📝 src/lib/components/chat/MessageInput.svelte (+4 -0)
📝 src/lib/components/chat/MessageInput/IntegrationsMenu.svelte (+110 -61)

📄 Description

Discussed: https://github.com/open-webui/open-webui/discussions/21849

  • Filters can now define toggle_options and toggle_default class attributes to show a dropdown selector inside their toggle button area in the chat IntegrationsMenu
  • When a filter with options is toggled ON, a dropdown appears below it; toggling OFF hides it
  • The selected dropdown value is passed end-to-end to the filter's inlet/outlet/stream handler via a new selected_option parameter

Filter definition (Python):

class Filter:
    toggle = True
    toggle_options = ["low", "medium", "high"]
    toggle_default = "medium"

    async def inlet(self, body, __selected_option__=None):
        # __selected_option__ is "low", "medium", or "high"
        return body

Label/value pairs are also supported:

toggle_options = [
    {"value": "gpt-4", "label": "GPT-4"},
    {"value": "gpt-3.5", "label": "GPT-3.5"}
]

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/21852 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 2/25/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `filter-dropdown` --- ### 📝 Commits (3) - [`8621455`](https://github.com/open-webui/open-webui/commit/86214555d5cc810cc31ab243e23a758ee73bd90a) feat: add dropdown toggle to filter buttons in chat (#167) - [`b649843`](https://github.com/open-webui/open-webui/commit/b649843b293995d8039bd4a0eb899e3854b68b3d) Merge branch 'dev' into filter-dropdown - [`3711eaa`](https://github.com/open-webui/open-webui/commit/3711eaa7994c23973246e477bf23c33d379aa3bb) Merge branch 'dev' into filter-dropdown ### 📊 Changes **7 files changed** (+178 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/main.py` (+1 -0) 📝 `backend/open_webui/utils/chat.py` (+1 -0) 📝 `backend/open_webui/utils/filter.py` (+7 -0) 📝 `backend/open_webui/utils/models.py` (+16 -11) 📝 `src/lib/components/chat/Chat.svelte` (+39 -1) 📝 `src/lib/components/chat/MessageInput.svelte` (+4 -0) 📝 `src/lib/components/chat/MessageInput/IntegrationsMenu.svelte` (+110 -61) </details> ### 📄 Description Discussed: https://github.com/open-webui/open-webui/discussions/21849 - Filters can now define toggle_options and toggle_default class attributes to show a dropdown selector inside their toggle button area in the chat IntegrationsMenu - When a filter with options is toggled ON, a dropdown appears below it; toggling OFF hides it - The selected dropdown value is passed end-to-end to the filter's inlet/outlet/stream handler via a new __selected_option__ parameter Filter definition (Python): ``` class Filter: toggle = True toggle_options = ["low", "medium", "high"] toggle_default = "medium" async def inlet(self, body, __selected_option__=None): # __selected_option__ is "low", "medium", or "high" return body ``` Label/value pairs are also supported: ``` toggle_options = [ {"value": "gpt-4", "label": "GPT-4"}, {"value": "gpt-3.5", "label": "GPT-3.5"} ] ``` ### 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-04-25 14:01:13 -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#41934