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

[UX] Improve Download Toast #558

Closed
wants to merge 33 commits into from
Closed

Conversation

BrettCleary
Copy link
Collaborator

@BrettCleary BrettCleary commented Sep 27, 2023

WIP


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)

🐛 Issue Addressed

Linked Issue: Install modal does not display extracting - PR Main issue
Linked Issue: Disk space check does not account for extraction space


✅ Other Fixed Issues

  • Progress on Download does not start from 0, generally was started either from previous queued progress if it was canceled earlier
  • Disk Space is another issue mentioned by @nyghtstalker, and fixed with suggest of @flavioislima. Currently, we are utilizing a basic function to estimate disk space. Typically, the estimated size is doubled and then increased by 0.05-0.01%, depending on whether it is being compressed on a Mac (higher percentage) or on Windows and other operating systems.
  • Upon relaunch the download modal appears again even though there is nothing downloading. This should be fixed, although @nyghtstalker, please make sure to check it out as soon this PR read for review

🚀 Props API Update for Components

  • Updated GameState to handle the new status of inExtraction
  • Updated DownloadToast with a new downloadStatus type: 'inExtraction'

☕ New PCI Handlers

  • cancelExtraction | window.api.cancelExtraction(appName: string). This method allows you to cancel an extraction, generally would require an extraction in progress.

📌 PR Blocked From Issue Below

HyperPlay-Gaming/hyperplay-ui#101


🗺️ Approach Taken

Our aim is to start using classes because we have a lot of code that is intertwined and makes debugging, fixing, or enhancing the code time-consuming. For instance, we have developed an ExtractZipService class that handles zip extraction-related functionalities, including the decompressed total bytes for later use. Our approach enables us to test the class independently, providing us with a better guarantee that everything is working as expected. Additionally, we always apply the SOC Principle, which helps us avoid days of debugging. 🙌


🛠️ Testing Steps

Before diving in, ensure you have access to both hyperplay-ui and hyplerplay-store repositories.

  1. Navigate to the feature branch:
git fetch && git checkout 455-update-game-card-and-download-toast-for-extraction && git pull
  1. If you haven't already, clone the hyperplay-ui:
git clone https://github.com/HyperPlay-Gaming/hyperplay-ui.git
  1. Switch to the relevant branch in hyperplay-ui:
git fetch && git 455-update-game-card-and-download-toast-for-extraction && git pull
  1. Link hyperplay-ui to hyperplay-desktop-client:
yarn add path/to/your/hyperplay-ui
  1. Fire up the development server:
yarn start
  1. Next head to Store > Find Megaweapon > Add to Library
  2. Next head to your library
  3. Tap Download Icon
  4. Install Model will show, which generally you would be already able to see the uncompressed size (estimated)
  5. Tap Install
  6. Wait until the extraction process
  7. Wait until it does install

⚠️ Review Tests

Please make sure to test all the following, please feel free to edit the PR readme in case there are more ways we should test

Pages

  • Check on Library
  • Check on game page
  • Check on the Download Manager page
  • I don't know how we can test it yet, but try to install it through the store

Toast, Download Bar on Game Card, Game Actions on Download Manager, Buttons on Game Page (Cancel Extraction, Cancel Download, etc)

  • Pause Download
  • Pause Download & Cancel
  • Pause Download & Cancel & Reinitiate
  • Resume Download
  • Resume Download & Cancel
  • Resume Download & Cancel & Reinitiate the download
  • Cancel Extraction
  • Cancel Extraction & Reinitiate the download

UI

  • Download Toast must have Pause or Resume Button, Cancel Button
  • Download Bar Game Card must have Pause or Resume Button, Cancel Button
  • Extraction Toast must only Cancel Button
  • Extraction Bar Game Card must have Pause or Resume Button, Cancel Button
  • Extraction Game Page must have Cancel Download Button
  • Extraction Game Page must only Cancel Extraction Button

📣 Important Note

This fix pinpoints where pause, resume are generally controlled by a status on hyperplay-ui lib, which we had to add. Once we're all aligned, let's ensure to

@BrettCleary BrettCleary self-assigned this Sep 27, 2023
@red-game-dev red-game-dev force-pushed the ux/improve_download_toast branch from 2c249d1 to 5ba4bd8 Compare October 24, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants