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

[Refactor] Make InstallModal global with state moved to zustand #4268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 Etaash-mathamsetty, a team, flavioislima, CommandMC, Nocccer and imLinguin and removed request for a team January 12, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

1 participant