mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #10994] [CLOSED] Refactor Sidebar's "new chat" from global element querying to event propagation and function call #22635
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/10994
Author: @thlehmann-ionos
Created: 2/28/2025
Status: ❌ Closed
Base:
dev← Head:tl/refactor-sidebar-new-chat📝 Commits (2)
ab4b326chore(app): refactor Sidebar from +layout to +pages3d94173chore(Chat): start new chat though explicit function call📊 Changes
10 files changed (+31 additions, -7 deletions)
View changed files
📝
src/lib/components/chat/Chat.svelte(+5 -0)📝
src/lib/components/layout/Sidebar.svelte(+4 -3)📝
src/routes/(app)/+layout.svelte(+0 -2)📝
src/routes/(app)/+page.svelte(+5 -1)📝
src/routes/(app)/admin/+layout.svelte(+3 -0)📝
src/routes/(app)/c/[id]/+page.svelte(+5 -1)📝
src/routes/(app)/channels/[id]/+page.svelte(+2 -0)📝
src/routes/(app)/playground/+layout.svelte(+3 -0)📝
src/routes/(app)/workspace/+layout.svelte(+3 -0)📝
src/routes/(app)/workspace/+page.svelte(+1 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.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 for validating the changes?(no tests)Changelog Entry
Description
It was refactored how a new chat is started from the sidebar to not rely on the presence of the new chat button in the top toolbar. This reduces inter-component dependencies and makes the code easier to read.
Added
Changed
getElementById('new-chat-button').click()of the link in the Navbar (top menubar) to propagating an event up and calling a new chat start function (newChat()) on the Chat component explicitly.Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Manual test cases
"New chat" via sidebar successfully tested in:
"New chat" via top menubar (Navbar) (with Sidebar closed) successfully tested in:
Second "New chat" after "New chat" with submitting the chat successfully tested for:
Not tested:
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.