Repository navigation
Per-game activity, part 1: Steam downloads and removals per game - #53
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-game activity, part 1: Steam downloads and removals per game
Background operations move out of the single global
AppStateinto a registry of activities keyed by game id. This PR covers the Steam half: every available Steam game is polled at once, so a download, an update or a removal is visible on its own game from the moment the launcher starts, and it no longer blocks selecting, installing or launching other games. It replaces the stopgap fromce6dd03(alpha.5), which pinned the state on the downloading game.What changes
src/shared/activity.ts,src/main/activity-registry.ts):GameActivityper game id. Pushes a full snapshot onactivity:updateand seeds viaactivity:request. Only real changes are announced.SteamActivityWatch(replacessteam-install-watch.ts): one recursive timer over all available Steam games. Per tick it does onelocateSteamplus one library listing (steamInstallStatusesbatch insteam.ts). The cadence comes fromPLAYHOOK_STEAM_POLL_MS(default 5000).scanNow()runs after a card or PC library load, card removal,steam://installandsteam://uninstall.steam-installing. installed → downloading:steam-updating, and finishing it sends no "installed" notification.steamBusyIdis gone.onGameChanged(id)rebuildsGameInfoand re-checks the state after the await before replacing it; otherwise it only refreshes the browse info of the game on screen.isBusy(id?). A game with an activity is not launched or uninstalled; another game's activity doesn't matter.GameInfolosessteamInstalling / steamPaused / steamPausedProgress / steamUninstalling.data-busy), the newdata-activityattribute, the Details install toggle and the Play button come from the activity of the game on screen. The carousel and library pulse every busy game (setBusyGames). Customize's Delete / Move gate is by id.errors.steamBusyOther, addedlauncher.state.updating/updatingPaused(en + ru).Tests
test/activity-registry.test.ts,test/steam-activity-watch.test.ts(the whole transition table, two parallel downloads, uninstall request and timeout, the session game, cleanup),test/state-view.test.ts.test/game-controller.test.ts: a download is visible at startup withoutaction:select; selecting another game during a download; launching another game during a download and its completion mid-session (the state journal is untouched); update without a notification; Steam uninstall as an activity.test/renderer/controls.test.ts: the focus ring and Play with an activity on the game on screen vs another game's activity.typecheck,lint,vitest(1388) andnpm run buildare green locally.Not covered here
onSelectRequesteddoes not re-validate the state after its awaits, so a very fast Play right after entering a detail screen could be overwritten by the late select.