Skip to content

Find and replace for markdown editors

What does this MR do and why?

Implements Find and Replace functionality for the Markdown Editor

This is the initial commit of a commit-series for implementing the find and replace functionality to our markdown editors. This commit registers the shortcuts behind a feature flag, and displays a simple input on the top-right of the editor whenever CMD+F is pressed on a focused markdown editor.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

find-and-replace

How to set up and validate locally

  1. Enable the feature flag: echo "Feature.enable(:find_and_replace)" | rails c
  2. Visit any markdown editor (for instance an issue page)
  3. Toggle the edit mode
  4. Press CMD+F
  5. Expect an input to be shown on top-right of the editor

Things to test:

  • CMD+F should open the browser find window when a text editor is not being focused
  • CMD+F should open the find and replace bar of the relevant text editor (when there are multiple text editors in the same page)
  • CMD+F should open the find and replace bar only when a text editor is being focused
  • Escape should close the find and replace bar
  • CMD+F shortcut should be registered only when find_and_replace feature flag is turned on

Related to #481521 (closed)

Edited by Savas Vedova

Merge request reports

Loading