Skip to content

Conversation

@arielj
Copy link
Collaborator

@arielj arielj commented Jan 12, 2025

This PR moves how we handle the InstallModal rendering and moves the state to Zustand. This helps removing some repeated code and makes opening and closing the modal to produce fewer re-renderings.

This PR changes:

  • Currently we have the component rendered inside different components: Library, GamePage, SubMenu, etc. This was like this I imagine to avoid having it global to avoid too many re-rendering, but with the cost of duplicating code for the render and the state
  • Even with the previous consideration, the state was still producing unintentional re-renderings, like... clicking the install button on a game in the library would re-render the whole library, or clicking the install button in the game page would re-render the whole page, or clicking Add Game in the library would re-render the whole library. With this PR it won't re-render extra components
  • Similar to the game settings PR, I took the opportunity to make the method names and state more declarative, so instead of doing something like setShowModal(false) we can now call closeInstallGameModal()

I tested all the places I could see:

  • Install in library
  • Install in game page from body
  • Install in game page from 3-dots menu
  • Edit sideloaded app
  • Add sideloaded app
  • Install EA game

I think they all work as expected, not sure if I'm missing something to test.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@arielj arielj added the pr:ready-for-review Feature-complete, ready for the grind! :P label Jan 12, 2025
@arielj arielj requested review from a team, CommandMC, Etaash-mathamsetty, Nocccer, flavioislima and imLinguin and removed request for a team January 12, 2025 18:28
@arielj arielj force-pushed the zustand-install-game-modal branch from 4373af8 to 59c150f Compare March 4, 2025 18:03
@arielj arielj force-pushed the zustand-install-game-modal branch from 59c150f to 0e46284 Compare March 28, 2025 18:14
@arielj arielj force-pushed the zustand-install-game-modal branch from 0e46284 to d876eeb Compare June 19, 2025 02:06
Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

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

LGTM

@arielj arielj force-pushed the zustand-install-game-modal branch from d876eeb to 4cdee54 Compare July 14, 2025 22:54
@arielj arielj merged commit 9a6278b into main Jul 14, 2025
9 checks passed
@arielj arielj deleted the zustand-install-game-modal branch July 14, 2025 22:57
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Jul 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

pr:ready-for-review Feature-complete, ready for the grind! :P

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants