Skip to content

Add support for content editor in comments

Himanshu Kapoor requested to merge 345072-ce-in-comments into master

What does this MR do and why?

Adds support for content editor in issue and MR comments.

Note: The support is currently added only for the comment box at the bottom of the issue/MR page in this MR. Support for content editor in replies is added in !114557 (merged).

Screenshots or screen recordings

Before (or with FF disabled) Current
Screen_Recording_2023-03-14_at_14.08.09 Screen_Recording_2023-03-14_at_13.56.01

How to set up and validate locally

  1. Enable feature flag :content_editor_on_issues:

    echo "Feature.enable(:content_editor_on_issues)" | rails c
  2. Visit any issue or MR.

  3. Notice that the comment box at the bottom of the page has a switcher reading "Viewing markdown" (bottom right corner) to switch between markdown/rich text.

  4. Edit some text in each editor, switch back and forth and notice that the contents are preserved.

  5. Refresh the page and notice that the contents are still preserved using a local storage draft.

  6. Save or Cancel the form, it should work as expected.


If the feature flag is disabled, the switcher to switch between the editors is not visible.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #345072 (closed)

Edited by Himanshu Kapoor

Merge request reports