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

The palette rerenders too much #2646

Closed
mcharfadi opened this issue Nov 28, 2023 · 0 comments · Fixed by #2651
Closed

The palette rerenders too much #2646

mcharfadi opened this issue Nov 28, 2023 · 0 comments · Fixed by #2651

Comments

@mcharfadi
Copy link
Contributor

mcharfadi commented Nov 28, 2023

Steps to reproduce

Log something in the DiagramElementPalette or DiagramPalette composant.

Expected behavior

When the palette is closed, we should not see any logs.

Actual behavior

Since we're using the useViewport(); hook, the palette re renders when the viewport changes, meaning the palette gets re rendered a lot during a move.

What to do

We should get the value of the viewport directly from the store instead of using the useViewport() hook.

  const store = useStoreApi();
 const [viewportX, viewportY, viewportZoom] = [...transform];
@mcharfadi mcharfadi changed the title The Palette rerender when it's closed The Palette rerender too much Nov 28, 2023
@mcharfadi mcharfadi self-assigned this Nov 28, 2023
@mcharfadi mcharfadi added this to the 2023.12.0 milestone Nov 28, 2023
@mcharfadi mcharfadi linked a pull request Nov 28, 2023 that will close this issue
39 tasks
mcharfadi added a commit that referenced this issue Nov 28, 2023
Bug: #2646
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
mcharfadi added a commit that referenced this issue Nov 28, 2023
Bug: #2646
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
mcharfadi added a commit that referenced this issue Nov 28, 2023
Bug: #2646
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
mcharfadi added a commit that referenced this issue Nov 29, 2023
Bug: #2646
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
mcharfadi added a commit that referenced this issue Nov 29, 2023
Bug: #2646
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
sbegaudeau pushed a commit that referenced this issue Nov 29, 2023
Bug: #2646
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
@sbegaudeau sbegaudeau changed the title The Palette rerender too much The Palette rerenders too much Nov 30, 2023
@sbegaudeau sbegaudeau changed the title The Palette rerenders too much The palette rerenders too much Nov 30, 2023
sbegaudeau pushed a commit that referenced this issue Nov 30, 2023
Bug: #2646
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants