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

[ui] Add min-height to breadcrumbs to fix layout loop caused by MiddleTruncate RAF #26127

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

bengotow
Copy link
Collaborator

Summary & Motivation

Fixes the flickering observed in https://dagsterlabs.slack.com/archives/C03CZRZCZQQ/p1732546935350479. When the sizing is async, the height of the element was briefly reduced to the height of the •••, which causes an infinite loop of re-rendering. The "30px" minimum height is the default value that would be set if we were not overriding it here.

Also added a storybook so we can easily verify this behavior in the future:

image

How I Tested These Changes

I added a storybook with the same code as the header and verified the flickering is no longer an issue.

@bengotow bengotow changed the title [ui] Switch MiddleTruncate back to immediate useLayoutEffect for compat [ui] Add min-height to breadcrumbs to fix layout loop caused by MiddleTruncate RAF Nov 25, 2024
Copy link

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-1bkr2d7md-elementl.vercel.app
https://bengotow-2024-11-revert-raf.components-storybook.dagster-docs.io

Built with commit 3a2bf15.
This pull request is being automatically deployed with vercel-action

Copy link

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-hkpq91f5d-elementl.vercel.app
https://bengotow-2024-11-revert-raf.core-storybook.dagster-docs.io

Built with commit 3a2bf15.
This pull request is being automatically deployed with vercel-action

Copy link
Member

@hellendag hellendag left a comment

Choose a reason for hiding this comment

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

Thanks!

@bengotow bengotow merged commit d67be67 into master Nov 26, 2024
3 checks passed
@bengotow bengotow deleted the bengotow-2024-11/revert-raf branch November 26, 2024 19:55
cmpadden pushed a commit that referenced this pull request Dec 5, 2024
…eTruncate RAF (#26127)

## Summary & Motivation

Fixes the flickering observed in
https://dagsterlabs.slack.com/archives/C03CZRZCZQQ/p1732546935350479.
When the sizing is async, the height of the element was briefly reduced
to the height of the `•••`, which causes an infinite loop of
re-rendering. The "30px" minimum height is the default value that would
be set if we were not overriding it here.

Also added a storybook so we can easily verify this behavior in the
future:

<img width="931" alt="image"
src="https://github.com/user-attachments/assets/5430f23a-f437-407c-97a1-336b6e09c67e">


## How I Tested These Changes

I added a storybook with the same code as the header and verified the
flickering is no longer an issue.

Co-authored-by: bengotow <[email protected]>
pskinnerthyme pushed a commit to pskinnerthyme/dagster that referenced this pull request Dec 16, 2024
…eTruncate RAF (dagster-io#26127)

## Summary & Motivation

Fixes the flickering observed in
https://dagsterlabs.slack.com/archives/C03CZRZCZQQ/p1732546935350479.
When the sizing is async, the height of the element was briefly reduced
to the height of the `•••`, which causes an infinite loop of
re-rendering. The "30px" minimum height is the default value that would
be set if we were not overriding it here.

Also added a storybook so we can easily verify this behavior in the
future:

<img width="931" alt="image"
src="https://github.com/user-attachments/assets/5430f23a-f437-407c-97a1-336b6e09c67e">


## How I Tested These Changes

I added a storybook with the same code as the header and verified the
flickering is no longer an issue.

Co-authored-by: bengotow <[email protected]>
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