update method in MessageModel to allow message updates by ID.deleteAfter method to remove messages in a conversation created after a specified message.EditableMessage component for inline editing.UpdateMessage schema for message updates.This enhances the chat functionality by allowing users to modify their messages and manage conversation history more effectively.
Fixes #1282 /claim #1282
[!NOTE] Adds PATCH/DELETE message APIs and integrates inline message editing that can prune subsequent messages and regenerate replies.
- Backend:
- Message model: add
findById,update(id, data), anddeleteAfter(conversationId, messageId); useand,gtfilters.- Routes: add
PATCH /api/chat/messages/:id(updates message) andDELETE /api/chat/messages/:id/after(deletes later messages) with org ownership checks; wire schemasSelectMessageSchema,UpdateMessageSchema.- Access Control: add route IDs
updateChatMessageanddeleteChatMessagesAfter.- Types:
- Add
UpdateMessageSchemaandUpdateMessagetype; exportSelectMessageSchemafor responses.- Frontend:
- ChatMessages: support editing via new props (
conversationId,sendMessage,onMessageEdit); hide messages below while editing; on save, calls update API and optionally deletes later messages then resubmits user message.- New component:
EditableMessagefor inline editing (save/cancel, keyboard shortcuts).- Queries: add hooks
useUpdateMessageanduseDeleteMessagesAfter.- Chat page: passes new props and updates local state after edits.
Written by Cursor Bugbot for commit 893c9ff08b960fbfcc8a74b13565b6fd6629e620. This will update automatically on new commits. Configure here.
Pranjal Negi
@Pranjal6955
Archestra
@archestra-ai