This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent unnecessary re-renders in 3D panel when selecting source (#7413)
**User-Facing Changes** <!-- will be used as a changelog entry --> - Prevent unnecessary re-renders in 3D panel after selecting a source **Description** The ThreeDeePanel would render 3 times when a source was selected when it only needs to rerender once. This is because after the player is set for the source, a new messagepipleine store is created and the player along with its source need to get initialized. To limit rerenders in Extension panels while initializing a new player I've added some logic to not call `initPanel` when the player `presence` is `INITIALIZING`. I also had to update `defaultPlayerState` in the messagepipeline store to take an optional parameter of whether it was initialized with the player so that it can initialize the default player state to `INITIALIZING` when there is a player present for the store or `NOT_PRESENT` when there is not a player (on startup). A drawback of this solution is that it only applies to extension panels, but might be useful for other panels as well. One other consideration might be to prevent rendering the mosaic layout while the player is initializing to prevent thrashing and show a loading indicator instead. I wasn't sure what the right place to leverage this would be or if it would be desirable. <!-- link relevant GitHub issues --> FG-6410 <!-- add `docs` label if this PR requires documentation updates --> <!-- add relevant metric tracking for experimental / new features -->
- Loading branch information
Showing
3 changed files
with
26 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters