Fixes#22781: When a parent message is deleted in a channel, the thread sidebar now automatically closes instead of remaining open with an orphaned thread.
Adds a check in the message:delete event handler in Channel.svelte to reset threadId to null when the deleted message matches the currently open thread's parent ID.
Test plan
Open any channel (public, group, or DM)
Send a message and open a thread on it via "Reply in Thread"
Delete the parent message while the thread sidebar is open
Verify the thread sidebar closes automatically
Verify normal message deletion (non-thread-parent) still works correctly
Verify closing thread sidebar manually still works
🔄 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/22824
**Author:** [@xr843](https://github.com/xr843)
**Created:** 3/19/2026
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `fix/22781-thread-sidebar-orphan`
---
### 📝 Commits (1)
- [`8d06b18`](https://github.com/open-webui/open-webui/commit/8d06b18362754e934b8af45da1eccf636710ac2e) fix: close thread sidebar when parent message is deleted (#22781)
### 📊 Changes
**1 file changed** (+3 additions, -0 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/channel/Channel.svelte` (+3 -0)
</details>
### 📄 Description
## Summary
- Fixes #22781: When a parent message is deleted in a channel, the thread sidebar now automatically closes instead of remaining open with an orphaned thread.
- Adds a check in the `message:delete` event handler in `Channel.svelte` to reset `threadId` to `null` when the deleted message matches the currently open thread's parent ID.
## Test plan
- [ ] Open any channel (public, group, or DM)
- [ ] Send a message and open a thread on it via "Reply in Thread"
- [ ] Delete the parent message while the thread sidebar is open
- [ ] Verify the thread sidebar closes automatically
- [ ] Verify normal message deletion (non-thread-parent) still works correctly
- [ ] Verify closing thread sidebar manually still works
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22824
Author: @xr843
Created: 3/19/2026
Status: ❌ Closed
Base:
dev← Head:fix/22781-thread-sidebar-orphan📝 Commits (1)
8d06b18fix: close thread sidebar when parent message is deleted (#22781)📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
src/lib/components/channel/Channel.svelte(+3 -0)📄 Description
Summary
message:deleteevent handler inChannel.svelteto resetthreadIdtonullwhen the deleted message matches the currently open thread's parent ID.Test plan
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.