Fixes the thread sidebar remaining open and interactable after the parent message is deleted, creating orphaned threads
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
🔄 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/22854
**Author:** [@alvinttang](https://github.com/alvinttang)
**Created:** 3/19/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix/thread-sidebar-orphan-on-delete`
---
### 📝 Commits (1)
- [`75f893d`](https://github.com/open-webui/open-webui/commit/75f893d49a54c5ccbd6d44ff97ebc029ba39ebb5) fix: close thread sidebar when parent message is deleted
### 📊 Changes
**1 file changed** (+5 additions, -0 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/channel/Channel.svelte` (+5 -0)
</details>
### 📄 Description
## Summary
- Fixes the thread sidebar remaining open and interactable after the parent message is deleted, creating orphaned threads
- 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
Fixes #22781
## Test plan
- [ ] Open any channel and create a message with thread replies
- [ ] Open the thread sidebar for that message
- [ ] Delete the parent message
- [ ] Verify the thread sidebar closes automatically
- [ ] Verify deleting a non-thread message does not affect the open thread sidebar
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
<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/22854
Author: @alvinttang
Created: 3/19/2026
Status: ❌ Closed
Base:
main← Head:fix/thread-sidebar-orphan-on-delete📝 Commits (1)
75f893dfix: close thread sidebar when parent message is deleted📊 Changes
1 file changed (+5 additions, -0 deletions)
View changed files
📝
src/lib/components/channel/Channel.svelte(+5 -0)📄 Description
Summary
message:deleteevent handler inChannel.svelteto resetthreadIdtonullwhen the deleted message matches the currently open thread's parent IDFixes #22781
Test plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.