Skip to content

Add text viewer feature flag

Jacques Erasmus requested to merge 340999-text-viewer-ff into master

What does this MR do and why?

In #324326 (closed) we added a text viewer as part of the ongoing blob refactor.

Since then there has been a lot of discussions around whether we should render text files with monaco (currently refactored to use monaco), highlightjs, custom solution, or stick with Rogue (pre-refactor solution).

This MR adds ensures the text viewer is behind a feature flag and the legacy text viewer will be loaded if the feature flag is disabled.

Note: this change is part of a bigger effort to refactor the blob viewer.

Screenshots or screen recordings

No visual changes are expected.

How to set up and validate locally

This feature is behind the :refactor_blob_viewer and :refactor_text_viewer feature flag.

  1. run rails c in the project root
  2. run Feature.enable(:refactor_blob_viewer) in the rails console
  3. run Feature.enable(:refactor_text_viewer) in the rails console
  4. upload a text file (e.g source code) to a repository
  5. view the uploaded file

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 #340999 (closed)

Edited by Jacques Erasmus

Merge request reports