[PR #16082] [CLOSED] feat: add folder, pinned, shared and archived tags functionality for chat search modal #47075

Closed
opened 2026-04-29 22:07:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/16082
Author: @silentoplayz
Created: 7/28/2025
Status: Closed

Base: devHead: folders-and-pinned-tags-for-chat-search


📝 Commits (4)

  • 9982b7f feat: more search tags
  • b99660a feat: Add archived and shared search options
  • aba82b2 fix: search tag options closing on click. Click now = search
  • cfb8893 fix: search by folder name

📊 Changes

5 files changed (+152 additions, -13 deletions)

View changed files

📝 backend/open_webui/models/chats.py (+46 -2)
📝 backend/open_webui/models/folders.py (+11 -0)
📝 src/lib/components/layout/SearchModal.svelte (+1 -0)
📝 src/lib/components/layout/Sidebar/SearchInput.svelte (+93 -11)
📝 src/lib/stores/index.ts (+1 -0)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests to validate the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • This pull request introduces a powerful new search functionality in the Search Chats modal, allowing you to filter chats by folders, pinned status, shared status, and archived status. This enhancement significantly improves your ability to navigate and manage your chats.

Added

  • New Search Prefixes:
    • folder:<folder_name>: Search for chats within a specific folder. (currently not working for folder names that contain spaces)
    • pinned:true: Search for pinned chats.
    • shared:true: Search for shared chats.
    • archived:true: Search for archived chats.
  • Search Options Dropdown:
    • The dropdown dynamically displays available tags and folders when you have typed out tag: or folder: in the search bar or have clicked on either tag in the dropdown itself.
  • Clickable Search Options:
  • You can now click on tags, folders, and other search options in the dropdown to automatically add them to the search bar.

Changed

  • get_chats_by_user_id_and_search_text in backend/open_webui/models/chats.py:
    • Updated to parse and handle the new search prefixes (tag:, folder:, pinned:, shared:, archived:).
  • get_folder_ids_by_names_and_user_id in backend/open_webui/models/folders.py:
    • Updated to perform a case-insensitive search for folder names.
  • SearchInput.svelte in src/lib/components/layout/Sidebar/:
    • Updated to include the new search options in the dropdown menu.
    • Added logic to handle the selection of tags and folders from the dropdown.
  • SearchModal.svelte in src/lib/components/layout/:
    • Updated to handle the new search prefixes and call the appropriate API functions.

Fixed

  • Clickable Search Options: Fixed the issue where the search options dropdown menu would close upon selection of tag:; before a selection could be made.

Screenshots or Videos

image image

Known Issues: The folder search functionality does not currently work for folder names that contain spaces. This is a known issue that I was not able to successfully address. I'm sorry, but I must confess that I've tried my best.

Known Issue 2 (NOT INTRODUCED WITH THIS PR): This is a small issue that I've come across and is present on the latest dev commit of OWUI, from the time at which I created this PR. The issue is that there is an overlay of a code block's buttons (from the chat preview) being displayed over the search options dropdown menu, which isn't ideal.

image

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.


🔄 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/16082 **Author:** [@silentoplayz](https://github.com/silentoplayz) **Created:** 7/28/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `folders-and-pinned-tags-for-chat-search` --- ### 📝 Commits (4) - [`9982b7f`](https://github.com/open-webui/open-webui/commit/9982b7f718895f873983663a6ad0ccdcff0d9dc8) feat: more search tags - [`b99660a`](https://github.com/open-webui/open-webui/commit/b99660a853f9e5f210a47bb50c71e37ecbe54277) feat: Add archived and shared search options - [`aba82b2`](https://github.com/open-webui/open-webui/commit/aba82b28c8c29e7efc50853b6e3190ed74f9a928) fix: search tag options closing on click. Click now = search - [`cfb8893`](https://github.com/open-webui/open-webui/commit/cfb88936359ca4eb0daca43a898514393db0c32a) fix: search by folder name ### 📊 Changes **5 files changed** (+152 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/chats.py` (+46 -2) 📝 `backend/open_webui/models/folders.py` (+11 -0) 📝 `src/lib/components/layout/SearchModal.svelte` (+1 -0) 📝 `src/lib/components/layout/Sidebar/SearchInput.svelte` (+93 -11) 📝 `src/lib/stores/index.ts` (+1 -0) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [X] **Target branch:** Please verify that the pull request targets the `dev` branch. - [X] **Description:** Provide a concise description of the changes made in this pull request. - [X] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [X] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [X] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [X] **Testing:** Have you written and run sufficient tests to validate the changes? - [X] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [X] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description - This pull request introduces a powerful new search functionality in the Search Chats modal, allowing you to filter chats by folders, pinned status, shared status, and archived status. This enhancement significantly improves your ability to navigate and manage your chats. ### Added - **New Search Prefixes:** - `folder:<folder_name>`: Search for chats within a specific folder. **(currently not working for folder names that contain spaces)** - `pinned:true`: Search for pinned chats. - `shared:true`: Search for shared chats. - `archived:true`: Search for archived chats. - **Search Options Dropdown:** - The dropdown dynamically displays available tags and folders when you have typed out `tag:` or `folder:` in the search bar or have clicked on either tag in the dropdown itself. - **Clickable Search Options:** - You can now click on tags, folders, and other search options in the dropdown to automatically add them to the search bar. ### Changed - **get_chats_by_user_id_and_search_text** in `backend/open_webui/models/chats.py`: - Updated to parse and handle the new search prefixes (`tag:`, `folder:`, `pinned:`, `shared:`, `archived:`). - **get_folder_ids_by_names_and_user_id** in `backend/open_webui/models/folders.py`: - Updated to perform a case-insensitive search for folder names. - **SearchInput.svelte** in `src/lib/components/layout/Sidebar/`: - Updated to include the new search options in the dropdown menu. - Added logic to handle the selection of tags and folders from the dropdown. - **SearchModal.svelte** in `src/lib/components/layout/`: - Updated to handle the new search prefixes and call the appropriate API functions. ### Fixed - **Clickable Search Options:** Fixed the issue where the search options dropdown menu would close upon selection of `tag:`; before a selection could be made. ### Screenshots or Videos <img width="1120" height="268" alt="image" src="https://github.com/user-attachments/assets/4bc88387-3212-4817-9d80-5a30825a506d" /> <img width="1121" height="194" alt="image" src="https://github.com/user-attachments/assets/0f42e9ae-27d7-452d-83b3-fb450c88d29f" /> ### Known Issues: The folder search functionality does not currently work for folder names that contain spaces. This is a known issue that I was not able to successfully address. I'm sorry, but I must confess that I've tried my best. ### Known Issue 2 (NOT INTRODUCED WITH THIS PR): This is a small issue that I've come across and is present on the latest dev commit of OWUI, from the time at which I created this PR. The issue is that there is an overlay of a code block's buttons (from the chat preview) being displayed over the search options dropdown menu, which isn't ideal. <img width="1126" height="135" alt="image" src="https://github.com/user-attachments/assets/37b63fdf-db9e-45cf-8ee5-04f1d4e140f1" /> ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <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-29 22:07:44 -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#47075