Skip to content

Commit 678dbba

Browse files
committed
Fix milisecond diffs
1 parent 47e0b44 commit 678dbba

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/components/Waterfall/Waterfall.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ const PortInput = styled.input`
3232
font-weight: normal;
3333
height: 30px;
3434
border: 1px solid ${p => p.theme.border};
35-
background: rgba(0, 0, 0, 0.03);
3635
border-radius: 3px;
3736
margin: 0;
3837
padding: 0 10px;
3938
width: 80px;
4039
outline: 0;
4140
font-weight: bold;
41+
&:hover,
42+
&:focus {
43+
border-color: ${p => p.theme.primary};
44+
}
4245
`;
4346

4447
const BtnGroup = styled.div`

src/components/Waterfall/WaterfallItem.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,32 @@ export default function WaterfallItem({
7272
condensed,
7373
index,
7474
}) {
75-
const prevOffset = previousItem ? item.ts - previousItem.ts : 0;
75+
let prevOffset = 0;
76+
if (previousItem && previousItem.end <= item.ts) {
77+
prevOffset = item.ts - previousItem.end;
78+
} else if (previousItem && previousItem.end > item.ts) {
79+
prevOffset = item.ts - previousItem.ts;
80+
}
81+
7682
let gapWidth = (item.ts - start) * zoomFactor;
7783
if (condensed) {
7884
gapWidth = index * 10;
7985
}
8086

87+
const color = stc(item.path);
8188
return (
8289
<Root>
8390
<Gap style={{ width: gapWidth }} />
8491
<Item>
8592
<DurationBar
8693
style={{
8794
width: item.duration * zoomFactor,
88-
background: stc(item.path),
95+
background: color,
8996
}}
9097
/>
9198
<Method method={item.method}>{item.method}</Method>
9299
{item.path}
93-
<Duration>{item.duration}ms</Duration>
100+
<Duration style={{ color }}>{item.duration}ms</Duration>
94101
{previousItem && <small>+{prevOffset}ms</small>}
95102
</Item>
96103
</Root>

src/globalStyles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const GlobalStyle = createGlobalStyle`
1010
body {
1111
margin: 0;
1212
padding: 0;
13-
font-family: sans-serif;
13+
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
1414
line-height: 1.5;
1515
color: ${theme.text};
1616
font-size: 16px;

0 commit comments

Comments
 (0)