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

feat(trace-viewer): Improve spacing and layout in and between network details sections #35425

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cpAdm
Copy link
Contributor

@cpAdm cpAdm commented Mar 31, 2025

  • Sections inside a tab can now be collapsed (and is remember in storage)
    • Shows number of items when collapsed for request/response headers
  • key-values can now easier be distinguished by the new spacing
  • (keeps the current order intact, will re-order in next PR)

image

References: #35214

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

2 flaky ⚠️ [firefox-page] › tests/page/page-evaluate.spec.ts:424:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [webkit-page] › tests/page/page-screenshot.spec.ts:345:5 › page screenshot › should work while navigating @webkit-ubuntu-22.04-node18

39017 passed, 805 skipped
✔️✔️✔️

Merge workflow run.

@Skn0tt Skn0tt requested a review from agg23 April 1, 2025 09:44
Copy link
Contributor

@agg23 agg23 left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! I have a few design comments.

const keyLength = Object.keys(data).length;

return (
<details className='network-details' open={isOpen} aria-label={title}>
Copy link
Contributor

Choose a reason for hiding this comment

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

The chevron is misaligned. It should be aligned with the close button in the top bar.
Screenshot 2025-04-02 at 7 56 53 AM

event.preventDefault();
setIsOpen(!isOpen);
}}>
{title} {!isOpen && showCountWhenCollapsed && `(${keyLength})`}
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be more spacing between the title and the chevron.

event.preventDefault();
setIsOpen(!isOpen);
}}>
{title} {!isOpen && showCountWhenCollapsed && `(${keyLength})`}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just leave the count onscreen at all times.


{requestBody && <div className='network-request-details-header'>Request Body</div>}
{requestBody && <CodeMirrorWrapper text={requestBody.text} mimeType={requestBody.mimeType} readOnly lineNumbers={true}/>}
<DetailsSection title='General' data={Object.entries({
Copy link
Contributor

Choose a reason for hiding this comment

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

Memo this entries object.

- 'row "param1: value2"'
- 'row "param2: value2"'
`
);

await page.getByText('endpoint').click();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add at least one test dealing with expansion and collapse of the new DetailsSections.

overflow: hidden;
margin-left: 10px;
}
.network-details {
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably should scope this class name better, as it's more generic than we typically have.

event.preventDefault();
setIsOpen(!isOpen);
}}>
{title} {!isOpen && showCountWhenCollapsed && `(${keyLength})`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Disable text selection on these headers.

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