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
How to set up and validate locally
- Enable the feature flag:
echo "Feature.enable(:find_and_replace)" | rails c - Visit any markdown editor (for instance an issue page)
- Toggle the edit mode
- Press CMD+F
- Expect an input to be shown on top-right of the editor
Things to test:
-
CMD+Fshould open the browser find window when a text editor is not being focused -
CMD+Fshould open the find and replace bar of the relevant text editor (when there are multiple text editors in the same page) -
CMD+Fshould open the find and replace bar only when a text editor is being focused -
Escapeshould close the find and replace bar -
CMD+Fshortcut should be registered only whenfind_and_replacefeature flag is turned on
Related to #481521 (closed)
Edited by Savas Vedova