Repository navigation
Chat: edit, delete, moderation and reply with a quote (#95) - #104
Merged
Merged
Conversation
Authors edit ("(edited)") and delete ("This message was deleted.", files
too) their own messages; Teachers and the Superuser delete any. Replies quote
the original and scroll to it. Open chats poll for changes since a revision,
so edits and deletions appear live.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #95 (spec #91).
What's new
chat_revisionsequence; an open chat now asks for everything changedsincethe last number it saw, so edits and deletions appear within ~2 s. Changing or deleting a message also renumbers the replies quoting it, so their quotes update too. ADR 0008 updated.0017:reply_to_id(SET NULL),edited_at,deleted_at,revision(existing messages numbered in order; checked locally by downgrading to 0016 with messages and upgrading).CONTEXT.md: Reply, Deleted message; changelog row.API
PUT /api/chat/messages/{id}(author),DELETE /api/chat/messages/{id}(author or staff),reply_to_idform field on send.GET .../chat/messagestakessince(a revision) instead ofafter(a message id); messages getrevision,edited,deleted,reply_to {id, author_name, first_line, deleted},can_edit,can_delete.Also fixed
An open chat moved its "last seen" mark to your own just-sent message, so a message someone else sent a moment earlier could be skipped until the page was reloaded. Now only what a poll fetched moves the mark.
Tests
test_chat_edit_delete.py(edit own + live viasince, nobody edits others', delete own incl. files and Unread, staff delete any / Student only own, outsiders and archived chats, reply quote, quote of a deleted message, replies only in the same chat).test_chat_edit_delete.py(reply with a quote, edit and delete your own, others' edits and deletions appear live, a Teacher deletes a Student's message and the quote says so).🤖 Generated with Claude Code