[✓] Description: Briefly describe the changes 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?
[N/A] Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Description
EDIT (03/04/2024): We decided that the best user experience is to only delete the message/response pair (not all subsequent messages). This pull request manipulates the message history object to remove the deleted message/response pair and update the parent/child message relationships. Refer to below diagram by @tjbck
Changelog Entry
Added
Fixed
Changed
Refactored the message deletion logic by directly manipulating the history object, removing message/response pairs and updating parent/child relationships to replace the existing implementation that uses a isDeleted flag.
Removed
N/A
🔄 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/1004
**Author:** [@dannyl1u](https://github.com/dannyl1u)
**Created:** 3/3/2024
**Status:** ✅ Merged
**Merged:** 3/6/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `refac/delete-message`
---
### 📝 Commits (6)
- [`f9f3fe5`](https://github.com/open-webui/open-webui/commit/f9f3fe5ec02ef63259e1ad3ac2fa1de7335f9e54) refac delete logic
- [`2250387`](https://github.com/open-webui/open-webui/commit/225038738294f35228003ba497d3378c0aaa3a8e) retain the message in history object
- [`8c01197`](https://github.com/open-webui/open-webui/commit/8c011974834dcb2f5b4d72bc6e22843e647bc3b5) refac: reassign grandchildren of deleted message as children of parent message
- [`03907f9`](https://github.com/open-webui/open-webui/commit/03907f9a8adde951a855e665bc61e6fbc265a42a) check if deleted message response has sibling responses for multi model chats
- [`a9d74b6`](https://github.com/open-webui/open-webui/commit/a9d74b669e71d5db989f8766f9535620f20238c5) refac
- [`2b016ad`](https://github.com/open-webui/open-webui/commit/2b016adc6e27913108a3de5591c9c054f1fb61c4) revert
### 📊 Changes
**3 files changed** (+121 additions, -76 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/chat/Messages.svelte` (+117 -72)
📝 `src/routes/(app)/+page.svelte` (+2 -2)
📝 `src/routes/(app)/c/[id]/+page.svelte` (+2 -2)
</details>
### 📄 Description
## Pull Request Checklist
- [✓] **Description:** Briefly describe the changes in this pull request.
- [✓] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [✓] **Documentation:** Have you updated relevant documentation?
- [N/A] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
---
## Description
EDIT (03/04/2024): We decided that the best user experience is to only delete the message/response pair (not all subsequent messages). This pull request manipulates the message `history` object to remove the deleted message/response pair and update the parent/child message relationships. Refer to below diagram by @tjbck

---
### Changelog Entry
### Added
### Fixed
### Changed
- Refactored the message deletion logic by directly manipulating the `history` object, removing message/response pairs and updating parent/child relationships to replace the existing implementation that uses a `isDeleted` flag.
### Removed
- N/A
---
<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/1004
Author: @dannyl1u
Created: 3/3/2024
Status: ✅ Merged
Merged: 3/6/2024
Merged by: @tjbck
Base:
dev← Head:refac/delete-message📝 Commits (6)
f9f3fe5refac delete logic2250387retain the message in history object8c01197refac: reassign grandchildren of deleted message as children of parent message03907f9check if deleted message response has sibling responses for multi model chatsa9d74b6refac2b016adrevert📊 Changes
3 files changed (+121 additions, -76 deletions)
View changed files
📝
src/lib/components/chat/Messages.svelte(+117 -72)📝
src/routes/(app)/+page.svelte(+2 -2)📝
src/routes/(app)/c/[id]/+page.svelte(+2 -2)📄 Description
Pull Request Checklist
Description
EDIT (03/04/2024): We decided that the best user experience is to only delete the message/response pair (not all subsequent messages). This pull request manipulates the message

historyobject to remove the deleted message/response pair and update the parent/child message relationships. Refer to below diagram by @tjbckChangelog Entry
Added
Fixed
Changed
historyobject, removing message/response pairs and updating parent/child relationships to replace the existing implementation that uses aisDeletedflag.Removed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.