diff --git a/web/src/components/RunDetailTest/TestPanel.tsx b/web/src/components/RunDetailTest/TestPanel.tsx index 34d17c6485..ed5633a040 100644 --- a/web/src/components/RunDetailTest/TestPanel.tsx +++ b/web/src/components/RunDetailTest/TestPanel.tsx @@ -38,7 +38,7 @@ interface IProps { const TestPanel = ({run, testId, runEvents}: IProps) => { const [query, updateQuery] = useSearchParams(); - const {selectedSpan, onSetFocusedSpan, onSelectSpan} = useSpan(); + const {selectedSpan, onSetFocusedSpan} = useSpan(); const {remove, revert, selectedTestSpec, setSelectedSpec, setSelectorSuggestions, setPrevSelector, specs} = useTestSpecs(); const {isOpen: isTestSpecFormOpen, formProps, onSubmit, open, close, isValid, onIsValid} = useTestSpecForm(); diff --git a/web/src/components/TestSpecDetail/Content.tsx b/web/src/components/TestSpecDetail/Content.tsx index 4ad20d8bcf..f7c7a7644b 100644 --- a/web/src/components/TestSpecDetail/Content.tsx +++ b/web/src/components/TestSpecDetail/Content.tsx @@ -1,5 +1,5 @@ -import {useEffect, useMemo, useRef} from 'react'; -import {FixedSizeList as List} from 'react-window'; +import {useCallback, useEffect, useMemo, useRef} from 'react'; +import {VariableSizeList as List} from 'react-window'; import AutoSizer, {Size} from 'react-virtualized-auto-sizer'; import {useAppSelector} from 'redux/hooks'; @@ -10,6 +10,7 @@ import {TAssertionResultEntry} from 'models/AssertionResults.model'; import Header from './Header'; import ResultCard from './ResultCard'; import Search from './Search'; +import * as S from './TestSpecDetail.styled'; interface IProps { onClose(): void; @@ -53,51 +54,58 @@ const Content = ({ } }, [results, selectedSpan]); - const itemSize = useMemo(() => { - const [, checkResults = []] = results[0]; + const getItemSize = useCallback( + index => { + const [, checkResults = []] = results[index]; - return checkResults.length * 72.59 + 40 + 16; - }, [results]); + return checkResults.length * 72.59 + 40 + 16; + }, + [results] + ); return ( <> -
{ - onDelete(testSpec.selector); - onClose(); - }} - onEdit={() => { - onEdit(testSpec, name); - }} - onRevert={() => { - onRevert(originalSelector); - }} - selector={selector} - title={!selector && !name ? 'All Spans' : name} - /> +
+
{ + onDelete(testSpec.selector); + onClose(); + }} + onEdit={() => { + onEdit(testSpec, name); + }} + onRevert={() => { + onRevert(originalSelector); + }} + selector={selector} + title={!selector && !name ? 'All Spans' : name} + /> - + +
- - {({height, width}: Size) => ( - - {ResultCard} - - )} - + + + {({height, width}: Size) => ( + + {ResultCard} + + )} + + ); }; diff --git a/web/src/components/TestSpecDetail/TestSpecDetail.styled.ts b/web/src/components/TestSpecDetail/TestSpecDetail.styled.ts index 24b00e82fc..651e9a7ae0 100644 --- a/web/src/components/TestSpecDetail/TestSpecDetail.styled.ts +++ b/web/src/components/TestSpecDetail/TestSpecDetail.styled.ts @@ -37,6 +37,15 @@ export const CardContainer = styled(Card)<{$isSelected: boolean; $type: Semantic export const DrawerContainer = styled(Drawer)` position: absolute; overflow: hidden; + + .ant-drawer-body { + display: flex; + flex-direction: column; + } +`; + +export const DrawerRow = styled.div` + flex: 1; `; export const GridContainer = styled.div`