diff --git a/gradle/changelog/adjust_file_diff_tree_height.yaml b/gradle/changelog/adjust_file_diff_tree_height.yaml new file mode 100644 index 0000000000..74c19ca47b --- /dev/null +++ b/gradle/changelog/adjust_file_diff_tree_height.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Entries are shown correctly diff --git a/scm-ui/ui-components/src/repos/LoadingDiff.tsx b/scm-ui/ui-components/src/repos/LoadingDiff.tsx index dd9c6554a1..9aa1e9c367 100644 --- a/scm-ui/ui-components/src/repos/LoadingDiff.tsx +++ b/scm-ui/ui-components/src/repos/LoadingDiff.tsx @@ -26,7 +26,7 @@ import { DiffObjectProps } from "./DiffTypes"; import DiffStatistics from "./DiffStatistics"; import { DiffDropDown } from "../index"; import DiffFileTree from "./diff/DiffFileTree"; -import { DiffContent, Divider, FileTreeContent } from "./diff/styledElements"; +import { DiffContent, Divider, FileTreeContent, StickyFileDiffContainer } from "./diff/styledElements"; import { useHistory, useLocation } from "react-router-dom"; import { getFileNameFromHash } from "./diffs"; import LayoutRadioButtons from "./LayoutRadioButtons"; @@ -111,7 +111,7 @@ const LoadingDiff: FC = ({ url, limit, refetchOnWindowFocus, ...props })
-
= ({ url, limit, refetchOnWindowFocus, ...props }) tree={data.tree} currentFile={decodeURIComponent(getFileNameFromHash(location.hash) ?? "")} setCurrentFile={setFilePath} + gap={12} /> )} -
+ void }; +type Props = { tree: FileTree; currentFile: string; setCurrentFile: (path: string) => void; gap?: number }; const StyledIcon = styled(Icon)` min-width: 1.5rem; `; -const DiffFileTree: FC = ({ tree, currentFile, setCurrentFile }) => { +const DiffFileTree: FC = ({ tree, currentFile, setCurrentFile, gap = 15 }) => { return ( - + {Object.keys(tree.children).map((key) => ( ` overflow: auto; - @supports (-moz-appearance: none) { - max-height: calc(100vh - 11rem); + ${(props) => { + if (props.gap) { + return ` + @supports (-moz-appearance: none) { + max-height: calc(100vh - ${props.gap}rem); } - max-height: calc(100svh - 11rem); + max-height: calc(100svh - ${props.gap}rem); + `; + } + }}; `; export const Divider = styled.div`