Indicate when a comment was last edited, and also indicate if a moderator edited it
Broadening of https://meta.codidact.com/questions/277431.
Comments can be edited, but the UI currently doesn't indicate that. This could be confusing when comments are edited in the midst of comment conversations (which might be happening quickly). Could we have an indication that a comment was edited, with a tooltip (or touch-screen equivalent) showing the timestamp of the edit?
Further, moderators can edit comments, which can have the effect of putting words into someone else's mouth. If the last edit was by a moderator we should show that, perhaps by varying the "this was edited" symbol. (If it was edited after the moderator edited it, then that edit was presumably by the author and so the author can "claim" it again. The concern here is about a moderator making a change the author would object to; if the author edited further, we can presume the author is satisfied with the final state.)
I think (hope) we are keeping edit history in the database even if we don't expose it. I'm not asking for the edit history to be visible (might want that for mods later, but don't worry about it now). If we aren't keeping edit history then this becomes a larger piece of work, but if we are keeping it, I'm hoping exposing this bit of info is not too hard.
How exactly should it be indicated?
We have the comment info part "xyz wrote 4 days ago" and that could be changed or extended accordingly, but I'm not completely sure about the best way. What about:
"xyz (4 days ago, last modified 2 days ago)" : possibly quite long "xyz (2 days ago)" : only shows last modified date and exact dates in tooltip "created at ISO-date, last modified at ISO-date" "xyz (last modified 2 days ago)" : but what to show there if the comment was never edited
Or a symbol like a pen, if the comment was edited.
I would use the pen symbol (which we also use on posts), so something like "xyz wrote 4 days ago (pen) 2 days ago" or, in the case of a mod edit, "... 2 days ago by moderator". Timestamp in tooltip like with the existing time. If the comment hasn't been edited, nothing changes.
This would show the info for the latest edit. If a mod edited it and then the author edited it again, that mod attribution drops out -- no longer relevant, as the author has validated it. Only the author and mods can edit comments, so in the usual case of author edits there's no point in saying the author did it -- we can note the unusual case instead and otherwise not clutter up the UI with self-attributions.
I'm proposing a literal "by moderator" here, not the name of the moderator. Ideally we would want moderators to see who specifically edited it, but to the public, the moderators are a team and we shouldn't do something that lets angry users individually target them. By analogy, suspension messages aren't individually signed. Mods are always free to identify themselves and could do so here too, but let's not do it for them. (Similarly, the "private contact" change that's being tested on a branch now uses "mod team" instead of names.)
Does that sound good?
Sounds good to me. On mobile there might not be much space, but that is not the major problem here and I could implement it right away.
The major problem is that it seems that no edit history is saved for comments. There are only created_at, updated_at, content, user_id and some reference... (which I do not understand) fields. There is no table like comments_histories as for posts (post_histories) and there does not seem to be any way to store if a moderator edited a comment.
Do we want an edit history for comments? Or just the user_id of the last updater?
Oh, I thought we had history of everything in the DB, if not in the UI! Yes, we want to record history; eventually we'll want to be able to show mods what changed in an edit, like if somebody left an abusive comment, it was flagged, and before the flag was seen the person edited it. I think figuring out the UI for all that is a problem for another day, but that and this do both depend on having some history, which I didn't realize we didn't. If that make this too big to tackle then I guess we could record last editor now and do it right later, but if you can actually record the history as part of this, that'd be great.
I initially thought that comments aren't that important, so keeping a history of them might be kind of a waste, but your point about abuse of the edit feature to hide some problematic comment is a good one. I can check again, but I'm pretty sure there is no history kept of comment edits.
I would quickly do a PR that simply displays if and when a comment was edited and then maybe this issue here is either rewritten (or closed and another one opened) to include the creation of a comment edit history. We could discuss then if for example people should be able to see the history of their comments and for example see earlier versions.
I submitted a PR that does the edited message. This issue could now be extended to describe what a comment history would include. Btw. we might also need a "user history" (for example for transparent name changes).
We can keep this issue focused on reporting the info we have (last edit), and make a separate one for adding true edit history for comments. (Also user history, yes -- and not just for mods; users should have access to their own edit history for their "about" text, for instance. But that's separate from this issue.)
Since this feature was (partially) implemented, should this issue be closed? We can extend it with last editor information (by xyz) relatively easily, but more requires proper edit history.
Spun off identifying the editor into a separate issue.