[PR #1004] [MERGED] refac: delete message logic #20556

Closed
opened 2026-04-20 03:02:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 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: devHead: refac/delete-message


📝 Commits (6)

  • f9f3fe5 refac delete logic
  • 2250387 retain the message in history object
  • 8c01197 refac: reassign grandchildren of deleted message as children of parent message
  • 03907f9 check if deleted message response has sibling responses for multi model chats
  • a9d74b6 refac
  • 2b016ad revert

📊 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: 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
image


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 ![image](https://github.com/open-webui/open-webui/assets/45186464/aab415a0-11bf-4926-b883-bdd01f9be618) --- ### 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>
GiteaMirror added the pull-request label 2026-04-20 03:02:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#20556