Skip to content

Conversation

@arielj
Copy link
Collaborator

@arielj arielj commented Dec 29, 2024

This PR adds an alternative "Play Now (with logs)" action right next to the normal Play Now button in the details page behind a small dropdown.

The idea is that users can easily select to launch a game with and without logs enabled for debugging purposes (and it's easier to instruct to do that and easier to discover).

The main action will be the last one used so users can clearly see if they are running the game with/without logs as a reminder that they can disable them, and both actions will change the game's settings so it's persisted (this way it can be used for things like running as a non-steam game and log things at the same time).

This depends on my previous PR making the logs configurable in a game-by-game basis.

play-logs.mp4

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 Dec 29, 2024
@arielj arielj requested review from a team, CommandMC, Etaash-mathamsetty, Nocccer, flavioislima and imLinguin and removed request for a team December 29, 2024 00:00
src={art_background || art_cover}
className="backgroundImage"
<SettingsContext.Provider value={settingsContextValues}>
<div className="gameConfigContainer">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the diff here is a mess, but I'm just wrapping things in a SettingsContext wrapper, nothing changed inside this

Copy link
Member

Choose a reason for hiding this comment

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

The "Hide whitespace" checkbox in the settings of GitHub's diff view is helpful here

max-width: 560px;
}

& .playButtons {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this CSS is partially duplicated on purpose for both old and new design, eventually we'll remove the old styles and it's easier to do that with duplications

Base automatically changed from improve-logs-ux to main March 1, 2025 17:15
@arielj arielj force-pushed the launch-with-logs branch from 63a098b to 12c07e5 Compare March 4, 2025 15:43
afterLaunchScriptPath: '',
disableUMU: false,
verboseLogs: false
verboseLogs: true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

enabled by default, since they can be disabled+play at the same time with a single action now

but by default we can get more logs for new users

Copy link
Member

@CommandMC CommandMC left a comment

Choose a reason for hiding this comment

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

A couple of nitpicks
The feature itself sounds & looks good to me!

Comment on lines 77 to 104
function showAltPlayAction() {
if (
is.syncing ||
is.installingRedist ||
is.installingWinetricksPackages ||
is.launching ||
is.playing
) {
return false
}

return true
}

function getAltPlayLabel() {
if (
is.syncing ||
is.installingRedist ||
is.installingWinetricksPackages ||
is.launching ||
is.playing
) {
return <></>
}

if (verboseLogs) {
return (
<span className="buttonWithIcon">
<PlayArrow data-icon="play" />
{t('label.playing.start')}
</span>
)
}

return (
<span className="buttonWithIcon">
<PlayArrow data-icon="play" />
{t('label.playing.start_with_logs', 'Play Now (with logs)')}
</span>
)
}

Copy link
Member

Choose a reason for hiding this comment

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

Consider making these memoized values to avoid computing them every re-render

Comment on lines 79 to 83
is.syncing ||
is.installingRedist ||
is.installingWinetricksPackages ||
is.launching ||
is.playing
Copy link
Member

Choose a reason for hiding this comment

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

Maybe factor this out into its own variable? Seems like this condition (although with some variation on which is values are considered) is used 3 times now

Comment on lines 196 to 207
disabled={
is.reparing ||
is.moving ||
is.updating ||
is.uninstalling ||
is.syncing ||
is.launching ||
is.installingWinetricksPackages ||
is.installingRedist
}
autoFocus={true}
onClick={async () => handlePlay(gameInfo)}
Copy link
Member

Choose a reason for hiding this comment

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

These moved from before the className prop to after it. Not a problem, just wanted to mention it since it seems unintentional (nothing apart from the position was changed)

src={art_background || art_cover}
className="backgroundImage"
<SettingsContext.Provider value={settingsContextValues}>
<div className="gameConfigContainer">
Copy link
Member

Choose a reason for hiding this comment

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

The "Hide whitespace" checkbox in the settings of GitHub's diff view is helpful here

@arielj arielj mentioned this pull request May 21, 2025
4 tasks
@arielj arielj force-pushed the launch-with-logs branch from 83adbef to 86ebe41 Compare June 4, 2025 03:25
@arielj arielj force-pushed the launch-with-logs branch 2 times, most recently from 8d034af to d642add Compare June 19, 2025 03:10
@flavioislima flavioislima added this to the 2.18.0 milestone Jul 11, 2025
@arielj arielj force-pushed the launch-with-logs branch from d642add to a361058 Compare July 14, 2025 23:30
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.

Tested here, looks good.

@arielj arielj merged commit ea2e1c5 into main Jul 17, 2025
9 checks passed
@arielj arielj deleted the launch-with-logs branch July 17, 2025 00:58
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Jul 17, 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.

4 participants