[go: up one dir, main page]

Skip to content

Refactor snippets to use the repository Source Viewer

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Currently, the Snippets view uses its own Source Viewer. This issue proposes that we use the same Source Viewer that we use to view repository files.

Alternatively, we could explore using the virtual scrolling we have in the MR changes tab. However, using virtual scrolling we'll lose functionality such as jumping to a line number and native find (⌘ + F).

Snippets Source Viewer Repository Source Viewer
sample file sample file
Screenshot_2023-01-11_at_11.06.30 Screenshot_2023-01-11_at_11.06.14

Improvements

  • Improved syntax highlighting.
  • Improved performance.
  • We don't have to maintain two ways of viewing source code.

Risks

  • Currently, the repository Source Viewer is built specifically for the repository, so it might not work in the context of the snippets view right away.
  • Might need to disable some features on the snippets view (blame links etc.)

Involved components

Intended side effects

  • Improved performance, especially for large snippets.
  • Improved syntax highlighting.
Edited by 🤖 GitLab Bot 🤖