diff --git a/scm-ui/ui-components/src/repos/DiffFile.tsx b/scm-ui/ui-components/src/repos/DiffFile.tsx index c977e228a4..e98d6fc39f 100644 --- a/scm-ui/ui-components/src/repos/DiffFile.tsx +++ b/scm-ui/ui-components/src/repos/DiffFile.tsx @@ -415,30 +415,31 @@ class DiffFile extends React.Component { const { file, collapsed, sideBySide, diffExpander, expansionError } = this.state; const viewType = sideBySide ? "split" : "unified"; - let body = null; + const fileAnnotations = fileAnnotationFactory ? fileAnnotationFactory(file) : null; + const innerContent = ( +
+ {fileAnnotations} + + {(hunks: HunkType[]) => + hunks?.map((hunk, n) => { + return this.renderHunk(file, diffExpander.getHunk(n), n); + }) + } + +
+ ); let icon = "angle-right"; + let body = null; if (!collapsed) { - const fileAnnotations = fileAnnotationFactory ? fileAnnotationFactory(file) : null; icon = "angle-down"; - body = ( -
- {fileAnnotations} - - {(hunks: HunkType[]) => - hunks?.map((hunk, n) => { - return this.renderHunk(file, diffExpander.getHunk(n), n); - }) - } - -
- ); + body = innerContent; } const collapseIcon = this.hasContent(file) ? : null; const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : null; const openInFullscreen = file?.hunks?.length ? ( {body}} + modalBody={{innerContent}} /> ) : null; const sideBySideToggle = file?.hunks?.length && (