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

Redesign main table #139

Merged
merged 17 commits into from
Aug 10, 2024
Merged

Redesign main table #139

merged 17 commits into from
Aug 10, 2024

Conversation

yuyi-sl
Copy link
Contributor

@yuyi-sl yuyi-sl commented Aug 9, 2024

Description

Redesign of main table component to display network logs.

  • general styling changes
  • fixed table header
  • option to show/hide waterfall
  • layout for requested details
  • make network table body virtualized (only render visible rows)

Types of Changes

What types of changes does your code introduce? Keep the ones that apply:

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Refactor/improvements

yuyi-sl added 17 commits August 5, 2024 17:37
# Conflicts:
#	examples/package-lock.json
#	examples/package.json
#	package-lock.json
#	package.json
#	src/Components/Common/Tooltip/Tooltip.jsx
#	src/Components/NetworkTable/NetworkCellValue.jsx
#	src/Components/NetworkTable/NetworkTableHeader.jsx
#	src/Components/NetworkTable/NetworkTableHeader.styles.scss
#	src/Components/NetworkTable/NetworkTableRow.jsx
#	src/Components/NetworkTable/TimeChart.jsx
#	src/Components/NetworkTable/TimeChart.styles.scss
#	src/Components/NetworkTable/TimeChartTooltip.jsx
#	src/Containers/NetworkTableContainer.jsx
#	src/NetworkViewer.jsx
#	tests/__tests__/Components/Import/__snapshots__/ImportHar.spec.jsx.snap
#	tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap
#	tests/__tests__/Containers/__snapshots__/FilterContainer.spec.jsx.snap
#	tests/__tests__/Containers/__snapshots__/MainContainer.spec.jsx.snap
#	tests/__tests__/__snapshots__/NetworkViewer.spec.jsx.snap
@yuyi-sl yuyi-sl merged commit 7c0da02 into main Aug 10, 2024
2 checks passed
@yuyi-sl yuyi-sl deleted the redesign-main-table branch August 10, 2024 17:24
const selectedReqIndex = state.get('selectedReqIndex');

const ref = useRef(null);
const { elementDims } = useResizeObserver(ref);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Autosizer from react-window that is made to handle dynamic width and height,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using Autosizer for the virtualized table dimensions but it didn't work so well with the current layout.

The ResizeObserver here is used to get the width of the table-body to set it for the table-header. This is necessary because of the scrollbar that can appear for the table-body causing the width of the body to the smaller than the header.


/* eslint no-underscore-dangle: 0 */

export const useResizeObserver = (elementRef) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might not need it with resize observer with AutoSizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants