Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): improve trace tab ui and behavior #3575

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions web/src/components/ResizablePanels/ResizablePanels.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {withPulseAnimation} from '../PulseButton';

export const GlobalStyle = createGlobalStyle`
.spaces-resize-handle {
background-color: ${({theme}) => theme.color.borderLight};
width: 3px !important;
border-left: 1px solid ${({theme}) => theme.color.borderLight};
z-index: 10;
}

Expand Down Expand Up @@ -41,7 +40,6 @@ export const SplitterContainer = styled.div``;

export const PanelContainer = styled.div<{$isOpen: boolean}>`
background-color: ${({theme}) => theme.color.white};
box-shadow: 0 20px 24px rgba(153, 155, 168, 0.18);
height: 100%;
overflow: visible;
overflow-y: scroll;
Expand Down
26 changes: 2 additions & 24 deletions web/src/components/RunDetailTest/RunDetailTest.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Badge} from 'antd';
import styled, {css} from 'styled-components';
import styled from 'styled-components';

export const Container = styled.div`
display: flex;
Expand All @@ -13,12 +13,12 @@ export const Section = styled.div`

export const SectionLeft = styled(Section)`
background-color: ${({theme}) => theme.color.background};
box-shadow: inset 20px 0px 24px -20px rgba(153, 155, 168, 0.18), inset -20px 0 24px -20px rgba(153, 155, 168, 0.18);
z-index: 1;
`;

export const SectionRight = styled(Section)`
background-color: ${({theme}) => theme.color.white};
box-shadow: 0 20px 24px rgba(153, 155, 168, 0.18);
overflow: hidden;
position: relative;
z-index: 2;
Expand Down Expand Up @@ -53,25 +53,3 @@ export const CountBadge = styled(Badge)`
color: ${({theme}) => theme.color.text};
}
`;

export const SpanDetailContainer = styled.div<{$isOpen: boolean}>`
background-color: ${({theme}) => theme.color.white};
box-shadow: 0 20px 24px rgba(153, 155, 168, 0.18);
height: 100%;
overflow: visible;
position: relative;

> div {
opacity: 0;
pointer-events: none;
}

${({$isOpen}) =>
$isOpen &&
css`
> div {
opacity: 1;
pointer-events: auto;
}
`}
`;
12 changes: 4 additions & 8 deletions web/src/components/RunDetailTrace/RunDetailTrace.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ export const Section = styled.div`
z-index: 1;
`;

export const SectionLeft = styled(Section)`
export const SectionLeft = styled(Section)<{$hasShadow?: boolean}>`
background-color: ${({theme}) => theme.color.background};
box-shadow: ${({$hasShadow}) =>
$hasShadow &&
`inset 20px 0px 24px -20px rgba(153, 155, 168, 0.18), inset -20px 0 24px -20px rgba(153, 155, 168, 0.18)`};
z-index: 1;
`;

export const SectionRight = styled(Section)<{$shouldScroll: boolean}>`
background-color: ${({theme}) => theme.color.white};
box-shadow: 0 20px 24px rgba(153, 155, 168, 0.18);
overflow-y: ${({$shouldScroll}) => ($shouldScroll ? 'scroll' : 'hidden')};
z-index: 2;
`;

export const VisualizationContainer = styled.div`
height: calc(100% - 52px);
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/RunDetailTrace/TracePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const TracePanel = ({run, testId, runEvents, skipTraceCollection}: TProps) => {
return (
<FillPanel>
<S.Container>
<S.SectionLeft>
<S.SectionLeft $hasShadow>
<S.SearchContainer>
<Search runId={run.id} testId={testId} />
</S.SearchContainer>
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/RunDetailTrace/Visualization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const Visualization = ({runEvents, runState, spans, type}: IProps) => {
const onNodesChange = useCallback((changes: NodeChange[]) => dispatch(changeNodes({changes})), [dispatch]);

const onNodeClick = useCallback(
(event, {id}: Node) => {
(event: React.MouseEvent, {id}: Node) => {
event.stopPropagation();
TraceDiagramAnalyticsService.onClickSpan(id);
dispatch(selectSpan({spanId: id}));
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import {useState} from 'react';
import {useEffect, useState} from 'react';
import TraceAnalyzerAnalytics from 'services/Analytics/TraceAnalyzer.service';
import {TAnalyzerError} from 'types/TestRun.types';
import AnalyzerErrorsPopover from './AnalyzerErrorsPopover';
import * as S from './AnalyzerErrors.styled';

interface IProps {
errors: TAnalyzerError[];
isSelected: boolean;
}

const AnalyzerErrors = ({errors}: IProps) => {
const AnalyzerErrors = ({errors, isSelected}: IProps) => {
const [isOpen, setIsOpen] = useState(false);

useEffect(() => {
if (isSelected) setIsOpen(true);
}, [isSelected]);

return (
<>
<S.ErrorIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TraceSpanNode = ({data, id, selected}: IProps) => {
return (
<BaseSpanNode
className={data.isMatched ? 'matched' : ''}
footer={analyzerErrors && <AnalyzerErrors errors={analyzerErrors} />}
footer={analyzerErrors && <AnalyzerErrors errors={analyzerErrors} isSelected={selected} />}
id={id}
isMatched={data.isMatched}
isSelected={selected}
Expand Down