Skip to content

feat(trace): Change state priority on trace drawer resize #67885

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

Closed
wants to merge 1 commit into from

Conversation

scttcper
Copy link
Member

Fixes the lag from resizing the trace drawer by removing render batching on the size updates and lowering the priority of state updates in a parent component.

fixes https://github.com/getsentry/frontend-tsc/issues/61

Fixes the lag from resizing the trace drawer by removing render batching on the size updates and lowering the priority of state updates in a parent component.

fixes getsentry/frontend-tsc#61
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 28, 2024
Comment on lines +72 to +74
flushSync(() => {
setSize(newSize);
});
Copy link
Member Author

Choose a reason for hiding this comment

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

keeps the drawer close to the cursor, removes batching

cancelAnimationTimeout(resizeAnimationTimeoutRef.current);
}
resizeAnimationTimeoutRef.current = requestAnimationTimeout(() => {
startTransition(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

marks this state update as low priority https://react.dev/reference/react/startTransition

Copy link
Member Author

Choose a reason for hiding this comment

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

this function doesn't seem to exist on 17

@getsantry
Copy link
Contributor

getsantry bot commented Apr 19, 2024

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Apr 19, 2024
@scttcper scttcper closed this Apr 19, 2024
@scttcper scttcper deleted the scttcper/18-trace-drawer-start-transition branch April 19, 2024 16:31
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant