Skip to content

Add UI to load the full file for `renamed`-type files

What does this MR do?

For #205401 (closed)

Adds a link to renamed diffs to expand the full file inline, or - for binary files - a link to the full file at the current commit.

I want to break that down, because there are notable exceptions:

  • Only fundamentally text files will get the ability to upgrade their diff inline. That means source code, markdown, bare text, etc.
  • Any binary blob (images, videos, compiled programs, etc.) will get a link so they're not left adrift in the UI, but that link just points them to our existing single-file viewer for the current commit.
  • The addition is a link in the renamed viewer (which normally just shows File moved).
  • Without JavaScript, this link points to the same location the "View file @ [commit SHA]" button points to.
  • With JavaScript, the link loads the full diff and replaces the renamed viewer with a text viewer
    • In this MR, the only thing that happens is a Vuex action is triggered. The rest of the behavior happens in Vuex actions / mutations already in the repository.

Screenshots

Description Screenshot
Before (current master) master_388b143b
Feature feature
Feature (network request errors) upgradeRenamedFailure-compressed
Feature (load succeeds) upgradeRenamedSuccess-compressed
Documentation documentation

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 🤖 GitLab Bot 🤖

Merge request reports