-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use new variable for 8px size * wip - grid * tooltip timechart * layout on selected request * styling clean up * remove scroll to selected request * collapse all besides General * update test snapshots * remove unused deps * adjust layout * option to hide waterfall * remove react-window dep * decrease padding and font-size * adjust styling for request details * clean up * virtualize network table body
- Loading branch information
Showing
49 changed files
with
1,025 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
@import "./../../styles/variables.scss"; | ||
|
||
.network-table-header { | ||
display: flex; | ||
width: 100%; | ||
|
||
padding: $size-xs-s; | ||
font-size: $font-size-small; | ||
font-weight: 700; | ||
text-transform: uppercase; | ||
border-bottom: $border; | ||
color: $brand-primary-gray; | ||
align-content: center; | ||
|
||
&:last-child { | ||
padding-right: 0; | ||
} | ||
} | ||
|
||
.table-column { | ||
display:flex; | ||
width: 12%; | ||
align-self: center; | ||
padding-right: $size-xs-s; | ||
|
||
&:last-child { | ||
padding-right: 0; | ||
} | ||
|
||
&.show-waterfall { | ||
width: 9%; | ||
} | ||
|
||
&.file { | ||
width: 25%; | ||
|
||
&.limited-cols { | ||
width: 100%; | ||
} | ||
} | ||
|
||
&.domain, | ||
&.waterfall{ | ||
width: 15%; | ||
} | ||
} | ||
|
||
.network-table-row { | ||
display: flex; | ||
width: 100%; | ||
overflow: hidden; | ||
|
||
cursor: pointer; | ||
padding: $size-xs $size-xs-s; | ||
border-bottom: $border; | ||
color: $brand-primary-dark-gray; | ||
font-size: $font-size-small; | ||
|
||
&.pending { | ||
color: $white-66; | ||
} | ||
|
||
&.error { | ||
color: $brand-danger; | ||
} | ||
|
||
&:hover { | ||
background: $white-90; | ||
} | ||
|
||
&.highlight { | ||
background: $dark-gray; | ||
color: $white-100; | ||
} | ||
} | ||
.value-text { | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
word-break: break-all; | ||
} | ||
|
||
.network-table-footer { | ||
border-top: $border; | ||
width: 100%; | ||
background: $bg-gray-90; | ||
padding: $size-xs $size-s; | ||
display: inline-flex; | ||
vertical-align: middle; | ||
|
||
span { | ||
flex: 1 1 auto; | ||
justify-content: center; | ||
display: inline-flex; | ||
align-items: center; | ||
border-right: 1px solid $white-80; | ||
padding: 0 $size-xs; | ||
overflow: hidden; | ||
|
||
&:last-child { | ||
border-right: none; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React, { useEffect, useRef } from 'react'; | ||
import { FixedSizeList } from 'react-window'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { useNetwork } from '../../state/network/Context'; | ||
import NetworkTableRow from './NetworkTableRow'; | ||
import { TABLE_ENTRY_HEIGHT } from '../../constants'; | ||
import { useResizeObserver } from '../../hooks/useResizeObserver'; | ||
|
||
const virtualizedTableRow = ({ | ||
data, | ||
index, | ||
style, | ||
}) => { | ||
const { | ||
listData, | ||
totalNetworkTime, | ||
handleReqSelect, | ||
selectedReqIndex, | ||
} = data; | ||
const item = listData.get(index); | ||
|
||
return ( | ||
<NetworkTableRow | ||
key={index} | ||
entry={item} | ||
maxTime={totalNetworkTime} | ||
onSelect={handleReqSelect} | ||
scrollHighlight={selectedReqIndex === index} | ||
style={style} | ||
/> | ||
); | ||
}; | ||
|
||
const NetworkTableBody = ({ height }) => { | ||
const { | ||
state, | ||
actions, | ||
callbacks, | ||
} = useNetwork(); | ||
const data = state.get('data'); | ||
const totalNetworkTime = state.get('totalNetworkTime'); | ||
const selectedReqIndex = state.get('selectedReqIndex'); | ||
|
||
const ref = useRef(null); | ||
const { elementDims } = useResizeObserver(ref); | ||
useEffect(() => actions.setTableHeaderWidth(elementDims.width), [elementDims]); | ||
|
||
const handleReqSelect = (payload) => { | ||
actions.updateScrollToIndex(payload.index); | ||
actions.selectRequest(payload); | ||
callbacks.onRequestSelect(payload); | ||
}; | ||
|
||
return ( | ||
<FixedSizeList | ||
ref={ref} | ||
height={height} | ||
itemCount={data.size} | ||
itemData={{ | ||
listData: data, | ||
totalNetworkTime, | ||
handleReqSelect, | ||
selectedReqIndex, | ||
}} | ||
itemSize={TABLE_ENTRY_HEIGHT} | ||
> | ||
{virtualizedTableRow} | ||
</FixedSizeList> | ||
); | ||
}; | ||
|
||
NetworkTableBody.propTypes = { | ||
height: PropTypes.number.isRequired, | ||
}; | ||
|
||
export default NetworkTableBody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
src/Components/NetworkTable/NetworkTableFooter.styles.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.