fix(desktop): editor bug fixes — codeblock escaping, thread edit leak, channel links, and edit cancel#553
Merged
Merged
Conversation
Three editor/rendering bugs: 1. Codeblock rendering broken: prosemirror-markdown's esc() backslash-escapes markdown special characters (backticks, asterisks, etc.) in text nodes. Added post-processing in getMarkdownFromEditor() to unescape them so code fences, inline code, bold/italic syntax survive the editor roundtrip. 2. Thread edit leaks to main: single editTarget was passed to both the main channel composer and thread panel composer. Added isEditInThread check to scope editTarget to the correct composer based on whether the message being edited lives in the thread or main timeline. 3. Channel link (and @mention) not rendering when sole message content: createRemarkPrefixPlugin's walkChildren only spliced replacements when parts.length > 1, skipping the case where the entire text node is a single match. Fixed guard to also splice when the single part is a non-text node. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When cancelling a message edit, the composer retained the edit content instead of restoring whatever the user had typed before. Added preEditContentRef to save the current draft before entering edit mode and restore it (or clear to empty) when edit mode exits via cancel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced May 28, 2026
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.
Summary
esc()backslash-escapes markdown special characters in text nodes. Added post-processing ingetMarkdownFromEditor()to unescape them so code fences, inline code, bold/italic survive the editor roundtrip.editTargetwas passed to both the main channel composer and thread panel composer. AddedisEditInThreadcheck to scopeeditTargetto the correct composer based on whether the message lives in the thread or main timeline.createRemarkPrefixPlugin'swalkChildrenonly spliced replacements whenparts.length > 1, skipping single-match text nodes. Fixed the guard.preEditContentRefto save/restore the draft around edit mode transitions.Test plan
#channel-name— renders as a link🤖 Generated with Claude Code