Skip to content

Highlight currently focused/viewed file in file tree

David O'Regan requested to merge 24629 into master

What does this MR do?

This MR is based on issue #24629 (closed)

It can be considered a utterly MVC to get this update underway. The merge attempts to get the ball rolling for the change with a method that removes the highlighted class when the file name has been clicked based on the previous work done here: gitlab-foss!29030 (closed)

Note

This follow up MR is based on this comment: !27703 (comment 310715576)

Where it turns out the file_row.vue is a shared component between the Web IDE and the Diff section, so we are lifting the logic up into the parent state to create a clear separation of concerns and only passing down a extra prop to the child which is not needed by default.

This merge feature UI sits behind a feature flag, to enable it please run:

Feature.enable(:highlight_current_diff_row)

Further work needed:

  • Update file tree via the IntersectionObserver API as suggested here: gitlab-foss!29030 (comment 177129131)
  • Finish removing CSS from the file_row.vue component in favour of more utility classes! This though can be a follow up 😄 => Careful. There be dragons here as this is a shared file.

Screenshots

Screenshot_2020-03-31_at_06.07.36

Screenshot_2020-03-31_at_06.07.30

Screenshot_2020-03-31_at_06.07.46

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by David O'Regan

Merge request reports