Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
73 stars 32 forks source link

Fix up instead of reload the page when a mod deletes a comment #419

Closed happy-river closed 2 years ago

happy-river commented 2 years ago

If a mod has navigated deep into a comment discussion, and deletes a comment, we've been reloading the page, which causes the mod to have to re-navigate to the same place to review the next comment. Remove the reload, and fix up the styling to show the comment as deleted. The response callback was attempting to change the text of the delete link, but since this callback is wrapped in a call to TextConfirm which is doing its own modification of the targeted element, and which clobbers anything the response callback does to it, that wasn't working. Instead I chose to replace the list of comment action links with "comment removed" or the error message if there is one.

Make it easier for mods to navigate to replies in discussions with deleted comments, by showing mods mod-deleted comments expanded instead of collapsed when the page is loaded.