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

Devtools React Profiler: Shrink flamegraph window's width to make room for scrollbar #17339

Closed
wants to merge 1 commit into from
Closed
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
Expand Up @@ -8,3 +8,12 @@
stroke: var(--color-commit-did-not-render-pattern);
stroke-width: 1;
}

.FixedSizeList {
overflow-y: scroll;
}

.InnerElement {
/* since width is controlled by react-window, need to set !important or it will be overridden */
width: calc(100% - var(--scrollbar-width)) !important;
}
Expand Up @@ -142,6 +142,7 @@ function CommitFlamegraph({chartData, commitTree, height, width}: Props) {

return (
<FixedSizeList
className={styles.FixedSizeList}
height={height}
innerElementType={InnerElementType}
itemCount={chartData.depth}
Expand All @@ -154,7 +155,7 @@ function CommitFlamegraph({chartData, commitTree, height, width}: Props) {
}

const InnerElementType = forwardRef(({children, ...rest}, ref) => (
<svg ref={ref} {...rest}>
<svg ref={ref} className={styles.InnerElement} {...rest}>
<defs>
<pattern
id="didNotRenderPattern"
Expand Down
3 changes: 3 additions & 0 deletions packages/react-devtools-shared/src/devtools/views/root.css
Expand Up @@ -169,6 +169,9 @@
/* Constant values shared between JS and CSS */
--interaction-commit-size: 10px;
--interaction-label-width: 200px;

/* Scrollbar */
--scrollbar-width: 11px;
}

* {
Expand Down