Skip to content

Commit c158d78

Browse files
authored
[Release] 2.17.0 Franky (#4549)
* fix: log screen * fix: games with launch options * feat: add eslint-plugin-react-hooks for improved React hooks linting * fix: dialog padding * fix: update LaunchOptions component initialization and remove duplicate instance * fix: update stable version name in package.json * fix: remove unused launch options section from gamepage.json * fix: logs truncated position * fix: lint * fix: update electron to version 36.2.1 * fix: correct typo in welcome message for library tour --------- Co-authored-by: Flavio F Lima <flavioislima@users.noreply.github.com>
1 parent eee3ca0 commit c158d78

File tree

11 files changed

+99
-73
lines changed

11 files changed

+99
-73
lines changed

eslint.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import eslint from '@eslint/js'
44
import tseslint from 'typescript-eslint'
55
import react from 'eslint-plugin-react'
6+
import reactHooks from 'eslint-plugin-react-hooks'
67
import prettier from 'eslint-config-prettier'
78
import importPlugin from 'eslint-plugin-import-x'
89

@@ -14,6 +15,9 @@ export default tseslint.config(
1415
{
1516
files: ['**/*.ts', '**/*.tsx'],
1617
rules: {
18+
// React hooks rules
19+
'react-hooks/rules-of-hooks': 'warn',
20+
1721
// FIXME: All of these rules should be errors instead
1822
'@typescript-eslint/no-base-to-string': 'warn',
1923
'@typescript-eslint/no-floating-promises': 'warn',
@@ -39,7 +43,8 @@ export default tseslint.config(
3943
},
4044

4145
plugins: {
42-
import: importPlugin
46+
import: importPlugin,
47+
'react-hooks': reactHooks
4348
},
4449
languageOptions: {
4550
parserOptions: {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "heroic",
33
"version": "2.17.0",
44
"versionNames": {
5-
"stable": "Scopper Gaban",
5+
"stable": "Cutty Flam Franky",
66
"beta": "Caesar Clown"
77
},
88
"private": false,
@@ -132,13 +132,14 @@
132132
"@types/tmp": "^0.2.6",
133133
"@vitejs/plugin-react-swc": "^3.9.0",
134134
"cross-env": "^7.0.3",
135-
"electron": "^36.1.0",
135+
"electron": "^36.2.1",
136136
"electron-builder": "^26.0.12",
137137
"electron-vite": "^3.1.0",
138138
"eslint": "^9.25.1",
139139
"eslint-config-prettier": "^9.1.0",
140140
"eslint-plugin-import-x": "^3.1.0",
141141
"eslint-plugin-react": "^7.37.5",
142+
"eslint-plugin-react-hooks": "^5.2.0",
142143
"fast-xml-parser": "^4.5.3",
143144
"husky": "^8.0.3",
144145
"i18next-parser": "^9.3.0",

pnpm-lock.yaml

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/locales/en/gamepage.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@
210210
},
211211
"winetricks": "Installing Winetricks Packages"
212212
},
213-
"launch": {
214-
"options": "Launch Options..."
215-
},
216213
"modifyInstall": {
217214
"dlcsCollapsible": "DLC",
218215
"nodlcs": "No DLC available",

public/locales/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@
911911
"viewToggle": "Switch between grid and list view for your games.",
912912
"welcome": {
913913
"intro": "Welcome to the Heroic Library! This is where you can see all your games across different stores.",
914-
"intro2": "If the library is empty, make sure to login with your accounts usinge the Manage accounts on the sidebar or add your own games using the Add Game button above.",
914+
"intro2": "If the library is empty, make sure to login with your accounts using the Manage accounts on the sidebar or add your own games using the Add Game button above.",
915915
"title": "Welcome to Heroic!",
916916
"title2": "Managing the library!"
917917
}

src/frontend/components/UI/Dialog/index.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,5 @@
112112
display: flex;
113113
gap: 16px;
114114
justify-content: end;
115-
padding: 0 var(--dialog-margin-horizontal) var(--dialog-margin-vertical)
116-
var(--dialog-margin-horizontal);
115+
padding-top: var(--space-md);
117116
}

src/frontend/screens/Game/GamePage/components/LaunchOptions.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useCallback, useContext, useEffect, useState } from 'react'
22
import GameContext from '../../GameContext'
33
import { GameInfo, LaunchOption } from 'common/types'
4-
import { useTranslation } from 'react-i18next'
54
import { SelectField } from 'frontend/components/UI'
65
import { MenuItem } from '@mui/material'
76

@@ -11,23 +10,14 @@ interface Props {
1110
}
1211

1312
const LaunchOptions = ({ gameInfo, setLaunchArguments }: Props) => {
14-
const { t } = useTranslation('gamepage')
1513
const { appName, runner } = useContext(GameContext)
1614
const [launchOptions, setLaunchOptions] = useState<LaunchOption[]>([])
17-
const [selectedLaunchOptionIndex, setSelectedLaunchOptionIndex] = useState(-1)
15+
const [selectedLaunchOptionIndex, setSelectedLaunchOptionIndex] = useState(0)
1816

1917
useEffect(() => {
20-
window.api.getLaunchOptions(appName, runner).then(setLaunchOptions)
18+
void window.api.getLaunchOptions(appName, runner).then(setLaunchOptions)
2119
}, [gameInfo])
2220

23-
if (!gameInfo.is_installed) {
24-
return null
25-
}
26-
27-
if (!launchOptions.length) {
28-
return null
29-
}
30-
3121
const labelForLaunchOption = useCallback((option: LaunchOption) => {
3222
switch (option.type) {
3323
case undefined:
@@ -40,6 +30,14 @@ const LaunchOptions = ({ gameInfo, setLaunchArguments }: Props) => {
4030
}
4131
}, [])
4232

33+
if (!gameInfo.is_installed) {
34+
return null
35+
}
36+
37+
if (!launchOptions.length) {
38+
return null
39+
}
40+
4341
return (
4442
<SelectField
4543
htmlId="launch_options"
@@ -54,7 +52,6 @@ const LaunchOptions = ({ gameInfo, setLaunchArguments }: Props) => {
5452
}
5553
}}
5654
value={selectedLaunchOptionIndex.toString()}
57-
prompt={t('launch.options', 'Launch Options...')}
5855
>
5956
{launchOptions.map((option, index) => (
6057
<MenuItem key={index} value={index}>

src/frontend/screens/Game/GamePage/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,17 +434,17 @@ export default React.memo(function GamePage(): JSX.Element | null {
434434
handleUpdate={handleUpdate}
435435
hasUpdate={hasUpdate}
436436
/>
437+
<LaunchOptions
438+
gameInfo={gameInfo}
439+
setLaunchArguments={setLaunchArguments}
440+
/>
437441
<div className="buttons">
438442
<MainButton
439443
gameInfo={gameInfo}
440444
handlePlay={handlePlay}
441445
handleInstall={handleInstall}
442446
/>
443447
</div>
444-
<LaunchOptions
445-
gameInfo={gameInfo}
446-
setLaunchArguments={setLaunchArguments}
447-
/>
448448
{wikiLink}
449449
</div>
450450
</div>

src/frontend/screens/Library/components/LibraryTour.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const LibraryTour: React.FC = () => {
3434
{
3535
intro: t(
3636
'tour.library.welcome.intro2',
37-
'If the library is empty, make sure to login with your accounts usinge the Manage accounts on the sidebar or add your own games using the Add Game button above.'
37+
'If the library is empty, make sure to login with your accounts using the Manage accounts on the sidebar or add your own games using the Add Game button above.'
3838
),
3939
title: t('tour.library.welcome.title2', 'Managing the library!')
4040
}

src/frontend/screens/Settings/sections/LogSettings/index.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
display: grid;
77
grid-template-columns: min-content 1fr;
88
grid-template-rows: 1fr;
9-
column-gap: 0.5rem;
9+
gap: 0.5rem;
1010
height: 25em;
1111
width: 100%;
1212

@@ -35,6 +35,13 @@
3535
}
3636
}
3737

38+
.logs-wrapper.game-log {
39+
display: flex;
40+
flex-direction: column;
41+
gap: var(--space-md);
42+
max-width: 50vw;
43+
}
44+
3845
dialog .logs-wrapper {
3946
grid-template-columns: 1fr;
4047
flex-grow: 1;

0 commit comments

Comments
 (0)