legacyViewerLoaded not updated for BLAME_VIEWER type

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

Summary

The legacyViewerLoaded computed property in app/assets/javascripts/repository/components/blob_content_viewer.vue does not account for BLAME_VIEWER, only checking SIMPLE_BLOB_VIEWER and RICH_BLOB_VIEWER:

legacyViewerLoaded() {
  return (
    (this.activeViewerType === SIMPLE_BLOB_VIEWER && this.legacySimpleViewer) ||
    (this.activeViewerType === RICH_BLOB_VIEWER && this.legacyRichViewer)
  );
},

This was pre-existing but became observable after !244836 (merged) fixed inline blame for legacy files.

Potential consequences

  1. Duplicate fetches: The early-return guard in loadLegacyViewer (if (this.legacyViewerLoaded || this.isLoadingLegacyViewer) return;) won't prevent a re-fetch after the first request completes, since isLoadingLegacyViewer is reset to false in .finally() and legacyViewerLoaded remains false.
  2. CodeIntelligence won't render: The template condition v-if="blobViewer || legacyViewerLoaded" on <code-intelligence> will remain false, so code navigation won't activate for blame on legacy files.

Proposed fix

Add (this.activeViewerType === BLAME_VIEWER && this.legacySimpleViewer) to the legacyViewerLoaded computed property.

References

Edited by 🤖 GitLab Bot 🤖