mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #15194] [CLOSED] feat: Improve folders to act like ChatGPT "projects" #39380
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/15194
Author: @Classic298
Created: 6/21/2025
Status: ❌ Closed
Base:
dev← Head:projects📝 Commits (10+)
83910e6Create e7f8a9b2c5d1_add_system_prompt_to_folder.py9e7735eUpdate chats.py92af07aUpdate folders.py93991b8Update folders.py4cd0119Update chat.py05ffb93Update index.tse97bd47Update index.ts62ff79dUpdate Chat.sveltec6fc09bUpdate ChatPlaceholder.svelte8f01f72Update Placeholder.svelte📊 Changes
16 files changed (+486 additions, -175 deletions)
View changed files
➕
backend/open_webui/migrations/versions/e7f8a9b2c5d1_add_system_prompt_to_folder.py(+22 -0)📝
backend/open_webui/models/chats.py(+2 -0)📝
backend/open_webui/models/folders.py(+47 -0)📝
backend/open_webui/routers/folders.py(+16 -16)📝
backend/open_webui/utils/chat.py(+25 -0)📝
src/lib/apis/chats/index.ts(+4 -1)📝
src/lib/apis/folders/index.ts(+6 -4)📝
src/lib/components/chat/Chat.svelte(+16 -9)📝
src/lib/components/chat/ChatPlaceholder.svelte(+24 -1)📝
src/lib/components/chat/Placeholder.svelte(+25 -1)📝
src/lib/components/layout/Sidebar.svelte(+40 -21)📝
src/lib/components/layout/Sidebar/Folders.svelte(+65 -2)➕
src/lib/components/layout/Sidebar/Folders/EditFolderModal.svelte(+139 -0)📝
src/lib/components/layout/Sidebar/Folders/FolderMenu.svelte(+2 -2)📝
src/lib/components/layout/Sidebar/RecursiveFolder.svelte(+48 -118)📝
src/lib/stores/index.ts(+5 -0)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
This pull request introduces a highly requested evolution of the existing folder system, transforming folders into powerful, project-like workspaces. This work is a direct response to a significant number of community discussions and feature requests calling for project-based organization, custom instructions per folder, and more streamlined workflows, similar to features found in OpenAI ChatGPT's projects feature or in Claude's folders where you can also adjust them similarly.
By enhancing folders with dedicated system prompts and improving the user experience for chat creation, this PR addresses the core feedback from a wide range of community discussions. The community has clearly expressed a desire for more structured and contextualized chat management, and this implementation delivers a foundational and robust solution.
Added
system_promptcolumn to thefoldertable.Changed
Tim: feel free to change this if you like, but during my heavy testing, i found this new name for newly created folders to be visually much better and more clearly differentiated from the rest of the UI and it allowed me to more quickly identify folders in the sidebar.
folders,refreshSidebar) for consistent and reactive updates.POST /api/folders/{id}/updatehas been enhanced to accept bothnameandsystem_promptfields.Deprecated
Removed
update_folder_details_by_id_and_user_idfunction.Security
$user?.role === 'admin' || ($user?.permissions.chat?.system_prompt ?? true)), ensuring that only authorized users can view or edit the system prompt field.Breaking Changes
Additional Information
Community Context & Discussion References
This work is a direct response to extensive community feedback. The core improvements in this PR are directly linked to the following discussions and issues:
#12620 - feat: Projects
#14299 - enh: folders are like projects
#13040 - Implement a "Project" feature
#12597 - feat: Projects (Issue)
#15132 - Feature Request: System Prompt Profiles
#10562 - feat: Enhance Folder Management with "New Chat in Folder" and "Create Subfolder" Options
https://github.com/open-webui/open-webui/issues/12084
This feature request is related to https://github.com/open-webui/open-webui/issues/10562 and also asks for an ability to create new chats directly within a folder.
Technical Notes
A significant part of this effort involved refactoring the sidebar's state management. We moved the folder list from a local component variable into a global Svelte store (
$folders). This was essential to fix reactivity bugs and allow components likeChat.svelteto trigger a sidebar refresh via a second global store,$refreshSidebar. This creates a robust, decoupled architecture that is easier to maintain and extend in the future.Screenshots or Videos
https://github.com/user-attachments/assets/8eef986d-8e51-492f-8a59-fd812a7edb6b
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.