before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
* (so the most "local" one) excluding local variables.
* \brief Avoid using apart when a scope must be forced.
*/
const VariablesContainer *GetBottomMostVariablesContainer() const {
if (variablesContainers.empty())
return nullptr;
return variablesContainers.at(firstLocalVariableContainerIndex -... | Could have been worth naming things in the other way:
FromVariableOrPropertyOrParameterName
FromVariableOrPropertyNameOnly
FromVariableNameOnly
to mimick the parameter type names | * (so the most "local" one) excluding local variables.
* \brief Avoid using apart when a scope must be forced.
*/
const VariablesContainer *GetBottomMostVariablesContainer() const {
if (variablesContainers.empty())
return nullptr;
return variablesContainers.at(firstLocalVariableContainerIndex -... | @@ -115,11 +115,23 @@ class GD_CORE_API VariablesContainersList {
}
/**
- * Get the variables container for a given variable.
+ * Get the variables container for a given variable or property or parameter.
*/
const VariablesContainer &
GetVariablesContainerFromVariableName(const gd::String &variabl... | Core/GDCore/Project/VariablesContainersList.h | 26 | C/C++ | 0.571 | style | 186 | 51 | 51 | false | Fix conflict between variable or property and parameter in variable setters | 7,329 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C/C++
File: Core/GDCore/Project/VariablesContainersList.h
PR Title: Fix conflict between variable or property and parameter in variable setters
BEFORE CODE: * (so the most "local" one) excluding local variables.
* \brief Avoid using apart when a scope must be forced.... | Could have been worth naming things in the other way:
FromVariableOrPropertyOrParameterName
FromVariableOrPropertyNameOnly
FromVariableNameOnly
to mimick the parameter type names | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
id={
props.parameterIndex !== undefined
? `parameter-${props.parameterIndex}-scene-variable-field`
: undefined
}
onInstructionTypeChanged={onInstructionTypeChanged}
getVariableSourceFromVariableName={getVariableSourceFromVariableName}
... | Same: name this
getVariableSourceFromVariableNameExcludingParametersAndProperties
or
getVariableSourceFromVariableNameOnly | id={
props.parameterIndex !== undefined
? `parameter-${props.parameterIndex}-scene-variable-field`
: undefined
}
onInstructionTypeChanged={onInstructionTypeChanged}
getVariableSourceFromIdentifier={getVariableSourceFromIdentifier}
/... | @@ -139,5 +140,20 @@ export default React.forwardRef<ParameterFieldProps, ParameterFieldInterface>(
}
);
+export const getVariableSourceFromVariableName = ( | newIDE/app/src/EventsSheet/ParameterFields/AnyVariableField.js | 26 | JavaScript | 0.357 | suggestion | 131 | 43 | 41 | false | Fix conflict between variable or property and parameter in variable setters | 7,329 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsSheet/ParameterFields/AnyVariableField.js
PR Title: Fix conflict between variable or property and parameter in variable setters
BEFORE CODE: id={
props.parameterIndex !== undefined
? `parameter-${pro... | Same: name this
getVariableSourceFromVariableNameExcludingParametersAndProperties
or
getVariableSourceFromVariableNameOnly | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
id={
props.parameterIndex !== undefined
? `parameter-${props.parameterIndex}-scene-variable-field`
: undefined
}
onInstructionTypeChanged={onInstructionTypeChanged}
getVariableSourceFromVariableName={getVariableSourceFromVariableName}
... | Same:
getVariableSourceFromVariableNameExcludingParameters
or
getVariableSourceFromVariableOrPropertyNameOnly | id={
props.parameterIndex !== undefined
? `parameter-${props.parameterIndex}-scene-variable-field`
: undefined
}
onInstructionTypeChanged={onInstructionTypeChanged}
getVariableSourceFromIdentifier={getVariableSourceFromIdentifier}
/... | @@ -137,6 +138,22 @@ export default React.forwardRef<ParameterFieldProps, ParameterFieldInterface>(
}
);
+export const getVariableSourceFromVariableName = ( | newIDE/app/src/EventsSheet/ParameterFields/AnyVariableOrPropertyField.js | 26 | JavaScript | 0.357 | suggestion | 120 | 45 | 42 | false | Fix conflict between variable or property and parameter in variable setters | 7,329 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsSheet/ParameterFields/AnyVariableOrPropertyField.js
PR Title: Fix conflict between variable or property and parameter in variable setters
BEFORE CODE: id={
props.parameterIndex !== undefined
? `param... | Same:
getVariableSourceFromVariableNameExcludingParameters
or
getVariableSourceFromVariableOrPropertyNameOnly | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
id={
props.parameterIndex !== undefined
? `parameter-${props.parameterIndex}-scene-variable-field`
: undefined
}
onInstructionTypeChanged={onInstructionTypeChanged}
getVariableSourceFromVariableName={getVariableSourceFromVariableName}
... | Same (depends on what you do in C++):
getVariableSourceFromVariableName
or
getVariableSourceFromVariableOrPropertyOrParameterName | id={
props.parameterIndex !== undefined
? `parameter-${props.parameterIndex}-scene-variable-field`
: undefined
}
onInstructionTypeChanged={onInstructionTypeChanged}
getVariableSourceFromIdentifier={getVariableSourceFromIdentifier}
/... | @@ -131,6 +134,20 @@ export default React.forwardRef<ParameterFieldProps, ParameterFieldInterface>(
}
);
+export const getVariableSourceFromVariableName = ( | newIDE/app/src/EventsSheet/ParameterFields/AnyVariableOrPropertyOrParameterField.js | 26 | JavaScript | 0.357 | suggestion | 138 | 43 | 44 | false | Fix conflict between variable or property and parameter in variable setters | 7,329 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsSheet/ParameterFields/AnyVariableOrPropertyOrParameterField.js
PR Title: Fix conflict between variable or property and parameter in variable setters
BEFORE CODE: id={
props.parameterIndex !== undefined
... | Same (depends on what you do in C++):
getVariableSourceFromVariableName
or
getVariableSourceFromVariableOrPropertyOrParameterName | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { LineStackLayout } from '../../UI/Layout';
import GlobalVariableIcon from '../../UI/CustomSvgIcons/GlobalVariable';
import SceneVariableIcon from '../../UI/CustomSvgIcons/SceneVariable';
import ObjectVariableIcon from '../../UI/CustomSvgIcons/ObjectVariable';
import LocalVariableIcon from '../../UI/CustomSvgIco... | Let's call this:
```suggestion
getVariableSourceFromIdentifierName: (
identifierName: string,
projectScopedContainers: gdProjectScopedContainers
) => VariablesContainer_SourceType,
```
to emphasis that we don't know if it's a variable name, a property name or a parameter name, and it could be a m... | import { LineStackLayout } from '../../UI/Layout';
import GlobalVariableIcon from '../../UI/CustomSvgIcons/GlobalVariable';
import SceneVariableIcon from '../../UI/CustomSvgIcons/SceneVariable';
import ObjectVariableIcon from '../../UI/CustomSvgIcons/ObjectVariable';
import LocalVariableIcon from '../../UI/CustomSvgIco... | @@ -55,6 +54,10 @@ type Props = {
...ParameterFieldProps,
isObjectVariable: boolean,
variablesContainers: Array<gdVariablesContainer>,
+ getVariableSourceFromVariableName: (
+ variableRootName: string,
+ projectScopedContainers: gdProjectScopedContainers
+ ) => VariablesContainer_SourceType, | newIDE/app/src/EventsSheet/ParameterFields/VariableField.js | 26 | JavaScript | 1 | suggestion | 323 | 51 | 51 | false | Fix conflict between variable or property and parameter in variable setters | 7,329 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsSheet/ParameterFields/VariableField.js
PR Title: Fix conflict between variable or property and parameter in variable setters
BEFORE CODE: import { LineStackLayout } from '../../UI/Layout';
import GlobalVariableIcon from '../../UI/Custo... | Let's call this:
```suggestion
getVariableSourceFromIdentifierName: (
identifierName: string,
projectScopedContainers: gdProjectScopedContainers
) => VariablesContainer_SourceType,
```
to emphasis that we don't know if it's a variable name, a property name or a parameter name, and it could be a m... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
nodeIds.length > 0 ? nodeIds[nodeIds.length - 1] : null;
nodeIds.push(getInstructionGroupId(categoryName, parentId));
return nodeIds;
},
[]
)
: []
);
// All the instructions, to be used when searching, so that the search is do... | should we remove this or comment it as it's just for debugging purpose? | nodeIds.length > 0 ? nodeIds[nodeIds.length - 1] : null;
nodeIds.push(getInstructionGroupId(categoryName, parentId));
return nodeIds;
},
[]
)
: []
);
// All the instructions, to be used when searching, so that the search is do... | @@ -283,6 +285,7 @@ const InstructionOrObjectSelector = React.forwardRef<
const instructionSearchApiRef = React.useRef<Fuse>(
new Fuse(allInstructionsInfoRef.current, {
...sharedFuseConfiguration,
+ includeScore: true, | newIDE/app/src/EventsSheet/InstructionEditor/InstructionOrObjectSelector.js | 26 | JavaScript | 0.429 | bug | 71 | 51 | 51 | false | Return exact matches when searching for an instruction | 7,330 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsSheet/InstructionEditor/InstructionOrObjectSelector.js
PR Title: Return exact matches when searching for an instruction
BEFORE CODE: nodeIds.length > 0 ? nodeIds[nodeIds.length - 1] : null;
nodeIds.push(ge... | should we remove this or comment it as it's just for debugging purpose? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//@ts-check
/// <reference path="../JsExtensionTypes.d.ts" />
/**
* This is a declaration of an extension for GDevelop 5.
*
* ℹ️ Changes in this file are watched and automatically imported if the editor
* is running. You can also manually run `node import-GDJS-Runtime.js` (in newIDE/app/scripts).
*
* The file mus... | This is to avoid to have 2 strings with only a case difference. | //@ts-check
/// <reference path="../JsExtensionTypes.d.ts" />
/**
* This is a declaration of an extension for GDevelop 5.
*
* ℹ️ Changes in this file are watched and automatically imported if the editor
* is running. You can also manually run `node import-GDJS-Runtime.js` (in newIDE/app/scripts).
*
* The file mus... | @@ -20,7 +20,7 @@ module.exports = {
extension
.setExtensionInformation(
'Physics3D',
- _('3D Physics Engine'),
+ _('3D physics engine'), | Extensions/Physics3DBehavior/JsExtension.js | 23 | JavaScript | 0.286 | suggestion | 63 | 48 | 48 | false | Fix a few typo in Physics3D | 7,332 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: JavaScript
File: Extensions/Physics3DBehavior/JsExtension.js
PR Title: Fix a few typo in Physics3D
BEFORE CODE: //@ts-check
/// <reference path="../JsExtensionTypes.d.ts" />
/**
* This is a declaration of an extension for GDevelop 5.
*
* ℹ️ Changes in this file are watc... | This is to avoid to have 2 strings with only a case difference. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
constructor(
instanceContainer: gdjs.RuntimeInstanceContainer,
objectData: TextInputObjectData
) {
super(instanceContainer, objectData);
this._string = objectData.content.initialValue;
this._placeholder = objectData.content.placeholder;
this._fontResourceName = objectData.c... | Is this for clarity of code, or does behavior changes too ? | private _maxLength: integer;
private _borderColor: [float, float, float];
private _borderOpacity: float;
private _borderWidth: float;
private _disabled: boolean;
private _readOnly: boolean;
private _isSubmitted: boolean;
_renderer: TextInputRuntimeObjectRenderer;
constructor(
... | @@ -135,7 +135,10 @@ namespace gdjs {
this._readOnly = objectData.content.readOnly;
this._textAlign = parseTextAlign(objectData.content.textAlign); //textAlign is defaulted to 'left' by the parser if undefined.
this._maxLength = objectData.content.maxLength || 0; //maxlength and padding require a d... | Extensions/TextInput/textinputruntimeobject.ts | 26 | TypeScript | 0.286 | question | 59 | 51 | 51 | false | Split text input padding into 2 separate properties | 7,338 | 4ian/GDevelop | 10,154 | JavaScript | NeylMahfouf2608 | AlexandreSi | Review this pull request change.
Language: TypeScript
File: Extensions/TextInput/textinputruntimeobject.ts
PR Title: Split text input padding into 2 separate properties
BEFORE CODE:
constructor(
instanceContainer: gdjs.RuntimeInstanceContainer,
objectData: TextInputObjectData
) {
super(in... | Is this for clarity of code, or does behavior changes too ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
otherProjectFile.fileMetadata.fileIdentifier
);
});
}
return false;
};
const getDashboardItemsToDisplay = ({
project,
currentFileMetadata,
allDashboardItems,
searchText,
searchClient,
currentPage,
orderBy,
}: {|
project: ?gdProject,
currentFileMetadata: ?FileMetadata,
allDas... | I don't know if this array should be copied with a destructuring operation because it can be sorted below, affecting both `itemsToDisplay` and `allDashboardItems` I think | otherProjectFile.fileMetadata.fileIdentifier
);
});
}
return false;
};
const getDashboardItemsToDisplay = ({
project,
currentFileMetadata,
allDashboardItems,
searchText,
searchClient,
currentPage,
orderBy,
}: {|
project: ?gdProject,
currentFileMetadata: ?FileMetadata,
allDas... | @@ -146,13 +146,7 @@ const getDashboardItemsToDisplay = ({
orderBy: GamesDashboardOrderBy,
|}): ?Array<DashboardItem> => {
if (!allDashboardItems) return null;
- let itemsToDisplay: DashboardItem[] = allDashboardItems.filter(
- item =>
- // First, filter out unsaved games, unless they are the opened pro... | newIDE/app/src/GameDashboard/GamesList.js | 26 | JavaScript | 0.571 | suggestion | 170 | 51 | 51 | false | Fix a few issues with displaying projects correctly in the create section | 7,349 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GamesList.js
PR Title: Fix a few issues with displaying projects correctly in the create section
BEFORE CODE: otherProjectFile.fileMetadata.fileIdentifier
);
});
}
return false;
};
const getDashboardIte... | I don't know if this array should be copied with a destructuring operation because it can be sorted below, affecting both `itemsToDisplay` and `allDashboardItems` I think | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/** Base parameters for {@link gdjs.Cube3DRuntimeObject} */
export interface Cube3DObjectData extends Object3DData {
/** The base parameters of the Cube3D object */
content: Object3DDataContent & {
enableTextureTransparency: boolean;
facesOrientation: 'Y' | 'Z';
frontFaceResourceName: stri... | You should be able to go back to where content comes from.
Long story short, it comes from the project serialized in JSON, meaning that the possible types of this object can only be `null`, `string` or `number`, or an array of those, or a child JSON. So it cannot be a `THREE.Color`. You can find examples in the textIn... | /** Base parameters for {@link gdjs.Cube3DRuntimeObject} */
export interface Cube3DObjectData extends Object3DData {
/** The base parameters of the Cube3D object */
content: Object3DDataContent & {
enableTextureTransparency: boolean;
facesOrientation: 'Y' | 'Z';
frontFaceResourceName: stri... | @@ -24,10 +24,10 @@ namespace gdjs {
rightFaceVisible: boolean;
topFaceVisible: boolean;
bottomFaceVisible: boolean;
+ color: THREE.Color; | Extensions/3D/Cube3DRuntimeObject.ts | 26 | TypeScript | 0.786 | suggestion | 380 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObject.ts
PR Title: Tint color for 3D cube
BEFORE CODE: /** Base parameters for {@link gdjs.Cube3DRuntimeObject} */
export interface Cube3DObjectData extends Object3DData {
/** The base parameters of the Cube3D object */
... | You should be able to go back to where content comes from.
Long story short, it comes from the project serialized in JSON, meaning that the possible types of this object can only be `null`, `string` or `number`, or an array of those, or a child JSON. So it cannot be a `THREE.Color`. You can find examples in the textIn... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAtIndex(faceIndex): boolean {
return (this._textureRepeatFacesB... | You will need a getter as well I think. | if (faceIndex === undefined) {
return false;
}
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAt... | @@ -203,10 +206,13 @@ namespace gdjs {
if (this._faceResourceNames[faceIndex] === resourceName) {
return;
}
-
this._faceResourceNames[faceIndex] = resourceName;
this._renderer.updateFace(faceIndex);
}
+ setCubeColor(color: THREE.Color): void { | Extensions/3D/Cube3DRuntimeObject.ts | 26 | TypeScript | 0.071 | suggestion | 39 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObject.ts
PR Title: Tint color for 3D cube
BEFORE CODE:
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 <... | You will need a getter as well I think. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAtIndex(faceIndex): boolean {
return (this._textureRepeatFacesB... | This method is part of a public interface. We don't want to rely THREE objects for inputs. You can check `setFillColor` int he codebase to see how it's done in other objects. | if (faceIndex === undefined) {
return false;
}
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAt... | @@ -203,10 +206,13 @@ namespace gdjs {
if (this._faceResourceNames[faceIndex] === resourceName) {
return;
}
-
this._faceResourceNames[faceIndex] = resourceName;
this._renderer.updateFace(faceIndex);
}
+ setCubeColor(color: THREE.Color): void { | Extensions/3D/Cube3DRuntimeObject.ts | 26 | TypeScript | 0.5 | suggestion | 174 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObject.ts
PR Title: Tint color for 3D cube
BEFORE CODE:
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 <... | This method is part of a public interface. We don't want to rely THREE objects for inputs. You can check `setFillColor` int he codebase to see how it's done in other objects. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
return runtimeObject
.getInstanceContainer()
.getGame()
.getImageManager()
.getThreeMaterial(runtimeObject.getFaceAtIndexResourceName(faceIndex), {
useTransparentTexture: runtimeObject.shouldUseTransparentTexture(),
forceBasicMaterial:
runtimeObject._materialT... | Good idea to use a loop!
In JS, there's a more elegant way to do this, with a `map`.
So you could write:
```js
const materials = new Array(6).fill(0).map((_, index) => {
return material;
})
``` | .getThreeMaterial(runtimeObject.getFaceAtIndexResourceName(faceIndex), {
useTransparentTexture: runtimeObject.shouldUseTransparentTexture(),
forceBasicMaterial:
runtimeObject._materialType ===
gdjs.Cube3DRuntimeObject.MaterialType.Basic,
});
};
class Cube3DRuntimeObj... | @@ -75,14 +80,37 @@ namespace gdjs {
) {
const geometry = new THREE.BoxGeometry(1, 1, 1);
// TODO (3D) - feature: support color instead of texture?
- const materials = [
- getFaceMaterial(runtimeObject, materialIndexToFaceIndex[0]),
- getFaceMaterial(runtimeObject, materialIndexToF... | Extensions/3D/Cube3DRuntimeObjectPixiRenderer.ts | 26 | TypeScript | 0.857 | suggestion | 204 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObjectPixiRenderer.ts
PR Title: Tint color for 3D cube
BEFORE CODE: }
return runtimeObject
.getInstanceContainer()
.getGame()
.getImageManager()
.getThreeMaterial(runtimeObject.getFaceAtIndexResour... | Good idea to use a loop!
In JS, there's a more elegant way to do this, with a `map`.
So you could write:
```js
const materials = new Array(6).fill(0).map((_, index) => {
return material;
})
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
};
class Cube3DRuntimeObjectPixiRenderer extends gdjs.RuntimeObject3DRenderer {
private _cube3DRuntimeObject: gdjs.Cube3DRuntimeObject;
private _boxMesh: THREE.Mesh;
constructor(
runtimeObject: gdjs.Cube3DRuntimeObject,
instanceContainer: gdjs.RuntimeInstanceContainer
) {
const g... | This seems unnecessary to me.
I feel like you could just do:
```js
const material = ...
materials.push(material)
```
since `getFaceMaterial` already returns a `MeshBasicMaterial` if no resource |
constructor(
runtimeObject: gdjs.Cube3DRuntimeObject,
instanceContainer: gdjs.RuntimeInstanceContainer
) {
const geometry = new THREE.BoxGeometry(1, 1, 1);
const materials: THREE.Material[] = new Array(6)
.fill(0)
.map((_, index) =>
getFaceMaterial(runtimeObje... | @@ -75,14 +80,36 @@ namespace gdjs {
) {
const geometry = new THREE.BoxGeometry(1, 1, 1);
// TODO (3D) - feature: support color instead of texture?
- const materials = [
- getFaceMaterial(runtimeObject, materialIndexToFaceIndex[0]),
- getFaceMaterial(runtimeObject, materialIndexToF... | Extensions/3D/Cube3DRuntimeObjectPixiRenderer.ts | 26 | TypeScript | 0.857 | suggestion | 201 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObjectPixiRenderer.ts
PR Title: Tint color for 3D cube
BEFORE CODE: };
class Cube3DRuntimeObjectPixiRenderer extends gdjs.RuntimeObject3DRenderer {
private _cube3DRuntimeObject: gdjs.Cube3DRuntimeObject;
private _box... | This seems unnecessary to me.
I feel like you could just do:
```js
const material = ...
materials.push(material)
```
since `getFaceMaterial` already returns a `MeshBasicMaterial` if no resource | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const material: THREE.Material = getFaceMaterial(
runtimeObject,
materialIndexToFaceIndex[i]
);
const basicMaterial: THREE.MeshBasicMaterial = new THREE.MeshBasicMaterial();
basicMaterial.copy(material);
materials.push(
basicMaterial.map
... | I see `MeshBasicMaterial` as a [color property](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.color).
It doesn't work with this property only? So that is wouldn't impact the geometry attribute? | super(runtimeObject, instanceContainer, boxMesh);
this._boxMesh = boxMesh;
this._cube3DRuntimeObject = runtimeObject;
this.updateSize();
this.updatePosition();
this.updateRotation();
this.updateTint();
}
updateTint() {
const tints: number[] = [];
const nor... | @@ -75,14 +80,36 @@ namespace gdjs {
) {
const geometry = new THREE.BoxGeometry(1, 1, 1);
// TODO (3D) - feature: support color instead of texture?
- const materials = [
- getFaceMaterial(runtimeObject, materialIndexToFaceIndex[0]),
- getFaceMaterial(runtimeObject, materialIndexToF... | Extensions/3D/Cube3DRuntimeObjectPixiRenderer.ts | 26 | TypeScript | 0.571 | question | 209 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObjectPixiRenderer.ts
PR Title: Tint color for 3D cube
BEFORE CODE: const material: THREE.Material = getFaceMaterial(
runtimeObject,
materialIndexToFaceIndex[i]
);
const basicMaterial: ... | I see `MeshBasicMaterial` as a [color property](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.color).
It doesn't work with this property only? So that is wouldn't impact the geometry attribute? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
objectProperties
.getOrCreate('width')
.setValue((objectContent.width || 0).toString())
.setType('number')
.setLabel(_('Width'))
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
.setGroup(_('Default size'));
objectProperties
.getOrCreate('height')
... | I think you can name it simply `color`, we can deduce from the context that it's for the cube |
objectProperties
.getOrCreate('width')
.setValue((objectContent.width || 0).toString())
.setType('number')
.setLabel(_('Width'))
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
.setGroup(_('Default size'));
objectProperties
.getOrCreate('height')
... | @@ -902,6 +903,12 @@ module.exports = {
.setLabel(_('Depth'))
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
.setGroup(_('Default size'));
+ objectProperties
+ .getOrCreate('cubeColor') | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.357 | suggestion | 93 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: Tint color for 3D cube
BEFORE CODE:
objectProperties
.getOrCreate('width')
.setValue((objectContent.width || 0).toString())
.setType('number')
.setLabel(_('Width'))
.setM... | I think you can name it simply `color`, we can deduce from the context that it's for the cube | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
objectProperties
.getOrCreate('width')
.setValue((objectContent.width || 0).toString())
.setType('number')
.setLabel(_('Width'))
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
.setGroup(_('Default size'));
objectProperties
.getOrCreate('height')
... | Check for similar attributes (such as `fillColor` in the text input), how it's done | objectProperties
.getOrCreate('width')
.setValue((objectContent.width || 0).toString())
.setType('number')
.setLabel(_('Width'))
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
.setGroup(_('Default size'));
objectProperties
.getOrCreate('height')
... | @@ -902,6 +903,12 @@ module.exports = {
.setLabel(_('Depth'))
.setMeasurementUnit(gd.MeasurementUnit.getPixel())
.setGroup(_('Default size'));
+ objectProperties
+ .getOrCreate('cubeColor')
+ .setValue(objectContent.color || (255, 255, 255)) | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.357 | suggestion | 83 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: Tint color for 3D cube
BEFORE CODE: objectProperties
.getOrCreate('width')
.setValue((objectContent.width || 0).toString())
.setType('number')
.setLabel(_('Width'))
.setMe... | Check for similar attributes (such as `fillColor` in the text input), how it's done | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAtIndex(faceIndex): boolean {
return (this._textureRepeatFacesBi... | Welcome to JS! Can you enter `[1, 2, 3] === [1, 2, 3]` in your browser JS console and see the result? |
return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAtIndex(faceIndex): boolean {
return (this._textureRepeatFacesB... | @@ -203,10 +208,13 @@ namespace gdjs {
if (this._faceResourceNames[faceIndex] === resourceName) {
return;
}
-
this._faceResourceNames[faceIndex] = resourceName;
this._renderer.updateFace(faceIndex);
}
+ setCubeColor(color: string): void {
+ if (rgbOrHexToRGBColor(color)... | Extensions/3D/Cube3DRuntimeObject.ts | 26 | TypeScript | 0.5 | question | 101 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObject.ts
PR Title: Tint color for 3D cube
BEFORE CODE: return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 <<... | Welcome to JS! Can you enter `[1, 2, 3] === [1, 2, 3]` in your browser JS console and see the result? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAtIndex(faceIndex): boolean {
return (this._textureRepeatFacesBitmask & (1 << faceIndex)) !== 0;
}
setFace... | You do the operation twice, you could store the result in a variable | return this.isFaceAtIndexVisible(faceIndex);
}
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
shouldRepeatTextureOnFaceAtIndex(faceIndex): boolean {
return (this._textureRepeatFacesBi... | @@ -203,10 +208,13 @@ namespace gdjs {
if (this._faceResourceNames[faceIndex] === resourceName) {
return;
}
-
this._faceResourceNames[faceIndex] = resourceName;
this._renderer.updateFace(faceIndex);
}
+ setCubeColor(color: string): void {
+ if (rgbOrHexToRGBColor(color)... | Extensions/3D/Cube3DRuntimeObject.ts | 26 | TypeScript | 0.286 | suggestion | 68 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObject.ts
PR Title: Tint color for 3D cube
BEFORE CODE: }
/** @internal */
isFaceAtIndexVisible(faceIndex): boolean {
return (this._visibleFacesBitmask & (1 << faceIndex)) !== 0;
}
/** @internal */
... | You do the operation twice, you could store the result in a variable | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
leftFaceVisible: boolean;
rightFaceVisible: boolean;
topFaceVisible: boolean;
bottomFaceVisible: boolean;
tint: string;
materialType: 'Basic' | 'StandardWithoutMetalness';
};
}
type FaceName = 'front' | 'back' | 'left' | 'right' | 'top' | 'bottom';
const faceNameToBitmaskIn... | `c` to change to `t` or `tc` maybe | leftFaceVisible: boolean;
rightFaceVisible: boolean;
topFaceVisible: boolean;
bottomFaceVisible: boolean;
tint: string;
materialType: 'Basic' | 'StandardWithoutMetalness';
};
}
type FaceName = 'front' | 'back' | 'left' | 'right' | 'top' | 'bottom';
const faceNameToBitmaskIn... | @@ -45,6 +45,7 @@ namespace gdjs {
trfb: integer;
frn: [string, string, string, string, string, string];
mt: number;
+ c: number; | Extensions/3D/Cube3DRuntimeObject.ts | 26 | TypeScript | 0.286 | suggestion | 34 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Cube3DRuntimeObject.ts
PR Title: Tint color for 3D cube
BEFORE CODE: leftFaceVisible: boolean;
rightFaceVisible: boolean;
topFaceVisible: boolean;
bottomFaceVisible: boolean;
tint: string;
materialType: 'Ba... | `c` to change to `t` or `tc` maybe | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
* @param resourceName The name of the resource
* @param options Set if the material should be transparent or not.
* @returns The requested material.
*/
static async getThreeMaterial(
project: gdProject,
resourceName: string,
{
useTransparentTexture,
}: {|
useTransparentTexture:... | `npm run format` to do in `newIDE/app` | * @param resourceName The name of the resource
* @param options Set if the material should be transparent or not.
* @returns The requested material.
*/
static async getThreeMaterial(
project: gdProject,
resourceName: string,
{
useTransparentTexture,
}: {|
useTransparentTexture:... | @@ -583,6 +583,7 @@ export default class PixiResourcesLoader {
map: texture,
side: useTransparentTexture ? THREE.DoubleSide : THREE.FrontSide,
transparent: useTransparentTexture,
+ vertexColors:true, | newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js | 26 | JavaScript | 0.214 | style | 38 | 51 | 51 | false | Tint color for 3D cube | 7,354 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js
PR Title: Tint color for 3D cube
BEFORE CODE: * @param resourceName The name of the resource
* @param options Set if the material should be transparent or not.
* @returns The requested materia... | `npm run format` to do in `newIDE/app` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
this.updateString();
this.updateFont();
this.updatePlaceholder();
this.updateOpacity();
this.updateInputType();
this.updateTextColor();
this.updateFillColorAndOpacity();
this.updateBorderColorAndOpacity();
this.updateBorderWidth();
this.updateDisabled();
... | I think you should add the check just as above, making sure that each variable is defined before calling any method on it. | this.updateString();
this.updateFont();
this.updatePlaceholder();
this.updateOpacity();
this.updateInputType();
this.updateTextColor();
this.updateFillColorAndOpacity();
this.updateBorderColorAndOpacity();
this.updateBorderWidth();
this.updateDisabled();
... | @@ -119,6 +119,8 @@ namespace gdjs {
if (!this._input) return;
this._input.remove();
this._input = null;
+ this._form?.remove(); | Extensions/TextInput/textinputruntimeobject-pixi-renderer.ts | 26 | TypeScript | 0.429 | suggestion | 122 | 51 | 51 | false | FIX the destroy of the form, "is submitted" condition icon, and readonly & disable feature | 7,363 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/TextInput/textinputruntimeobject-pixi-renderer.ts
PR Title: FIX the destroy of the form, "is submitted" condition icon, and readonly & disable feature
BEFORE CODE: this.updateString();
this.updateFont();
this.updatePlaceholder(... | I think you should add the check just as above, making sure that each variable is defined before calling any method on it. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
this.updateString();
this.updateFont();
this.updatePlaceholder();
this.updateOpacity();
this.updateInputType();
this.updateTextColor();
this.updateFillColorAndOpacity();
this.updateBorderColorAndOpacity();
this.updateBorderWidth();
this.updateDisabled();
... | nitpicking: either use `?.` for the input too or use `!this._form`, but be consistent between the twos. | this.updateString();
this.updateFont();
this.updatePlaceholder();
this.updateOpacity();
this.updateInputType();
this.updateTextColor();
this.updateFillColorAndOpacity();
this.updateBorderColorAndOpacity();
this.updateBorderWidth();
this.updateDisabled();
... | @@ -119,6 +119,8 @@ namespace gdjs {
if (!this._input) return;
this._input.remove();
this._input = null;
+ this._form?.remove(); | Extensions/TextInput/textinputruntimeobject-pixi-renderer.ts | 26 | TypeScript | 0.571 | nitpick | 103 | 51 | 51 | false | FIX the destroy of the form, "is submitted" condition icon, and readonly & disable feature | 7,363 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/TextInput/textinputruntimeobject-pixi-renderer.ts
PR Title: FIX the destroy of the form, "is submitted" condition icon, and readonly & disable feature
BEFORE CODE: this.updateString();
this.updateFont();
this.updatePlaceholder(... | nitpicking: either use `?.` for the input too or use `!this._form`, but be consistent between the twos. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
]
);
const mediaItems = React.useMemo(
() =>
getProductMediaItems({
product: assetPack,
productListingData: privateAssetPackListingData,
shouldSimulateAppStoreProduct: simulateAppStoreProduct,
}),
[assetPack, privateAssetPackListingData, simulateAppStoreProduct]
);... | It feels a bit light as a check to decide if the object is a smart object. If we add 3D particle emitters or 3D cubes in a pack, it will display them as a smart objects. | ]
);
const mediaItems = React.useMemo(
() =>
getProductMediaItems({
product: assetPack,
productListingData: privateAssetPackListingData,
shouldSimulateAppStoreProduct: simulateAppStoreProduct,
}),
[assetPack, privateAssetPackListingData, simulateAppStoreProduct]
);... | @@ -521,6 +521,23 @@ const PrivateAssetPackInformationPage = ({
{ subscription, privateAssetPackListingData, isAlreadyReceived }
);
+ const smartObjectsCount = React.useMemo(
+ () => {
+ if (!assetPack) {
+ return 0;
+ }
+ let smartObjectsCount = 0;
+ for (const type in assetPac... | newIDE/app/src/AssetStore/PrivateAssets/PrivateAssetPackInformationPage.js | 26 | JavaScript | 0.357 | suggestion | 169 | 51 | 51 | false | Allow to swap assets of any object type | 7,365 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/AssetStore/PrivateAssets/PrivateAssetPackInformationPage.js
PR Title: Allow to swap assets of any object type
BEFORE CODE: ]
);
const mediaItems = React.useMemo(
() =>
getProductMediaItems({
product: assetPack,
... | It feels a bit light as a check to decide if the object is a smart object. If we add 3D particle emitters or 3D cubes in a pack, it will display them as a smart objects. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
? () =>
onOpenGameManager({ game, widgetToScrollTo: 'projects' })
: undefined,
});
}
// Delete actions.
// Don't allow removing project if opened, as it would not result in any change in the list.
// (because an ope... | I think better english is `in the last 7 days` | : undefined,
});
}
// Delete actions.
// Don't allow removing project if opened, as it would not result in any change in the list.
// (because an opened project is always displayed)
if (isCurrentProjectOpened || projectsList.length > 1) {
... | @@ -513,9 +518,34 @@ const GameDashboardCard = ({
// Extract word translation to ensure it is not wrongly translated in the sentence.
const translatedConfirmText = i18n._(t`delete`);
+ const hasPlayerMessage = countOfSessionsLastWeek
+ ? t`${countOfSes... | newIDE/app/src/GameDashboard/GameDashboardCard.js | 26 | JavaScript | 0.286 | suggestion | 46 | 51 | 51 | false | Add a clearer warning before the deletion of a game and a project. | 7,368 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameDashboardCard.js
PR Title: Add a clearer warning before the deletion of a game and a project.
BEFORE CODE: ? () =>
onOpenGameManager({ game, widgetToScrollTo: 'projects' })
... | I think better english is `in the last 7 days` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// Delete actions.
// Don't allow removing project if opened, as it would not result in any change in the list.
// (because an opened project is always displayed)
if (isCurrentProjectOpened || projectsList.length > 1) {
// No delete action possible.
} else {... | I would change the text because here you can have a case:
`You're deleting a game that has: ... - is published`
I would suggest:
`You're deleting a game which: - has x views... - is published...`
| // (because an opened project is always displayed)
if (isCurrentProjectOpened || projectsList.length > 1) {
// No delete action possible.
} else {
if (actions.length > 0) {
actions.push({
type: 'separator',
});
... | @@ -513,9 +518,34 @@ const GameDashboardCard = ({
// Extract word translation to ensure it is not wrongly translated in the sentence.
const translatedConfirmText = i18n._(t`delete`);
+ const hasPlayerMessage = countOfSessionsLastWeek
+ ? t`${countOfSes... | newIDE/app/src/GameDashboard/GameDashboardCard.js | 26 | JavaScript | 0.643 | suggestion | 209 | 51 | 51 | false | Add a clearer warning before the deletion of a game and a project. | 7,368 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameDashboardCard.js
PR Title: Add a clearer warning before the deletion of a game and a project.
BEFORE CODE: // Delete actions.
// Don't allow removing project if opened, as it would not result in any chan... | I would change the text because here you can have a case:
`You're deleting a game that has: ... - is published`
I would suggest:
`You're deleting a game which: - has x views... - is published...`
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const isTopLevel = depth === 0;
let nodeId;
if (!parentNodeId) {
if (isInherited) {
nodeId = `${inheritedPrefix}${name}`;
} else {
nodeId = name;
}
} else {
nodeId = `${parentNodeId}${separator}${name}`;
}
const parentType = parent... | <img width="778" alt="image" src="https://github.com/user-attachments/assets/1e880ce8-1329-45da-84a6-e0c40e3e7653" />
| const isTopLevel = depth === 0;
let nodeId;
if (!parentNodeId) {
if (isInherited) {
nodeId = `${inheritedPrefix}${name}`;
} else {
nodeId = name;
}
} else {
nodeId = `${parentNodeId}${separator}${name}`;
}
const parentType = parent... | @@ -1444,6 +1448,14 @@ const VariablesList = React.forwardRef<Props, VariablesListInterface>(
props.inheritedVariablesContainer &&
props.inheritedVariablesContainer.has(name);
+ const typeErrorMessage =
+ parentType === gd.Variable.Array &&
+ parentVariable &&
+ parentVaria... | newIDE/app/src/VariablesList/VariablesList.js | 26 | JavaScript | 0.429 | suggestion | 119 | 51 | 51 | false | Add a warning on array children with inconsistent type | 7,376 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/VariablesList/VariablesList.js
PR Title: Add a warning on array children with inconsistent type
BEFORE CODE: const isTopLevel = depth === 0;
let nodeId;
if (!parentNodeId) {
if (isInherited) {
nodeId = `$... | <img width="778" alt="image" src="https://github.com/user-attachments/assets/1e880ce8-1329-45da-84a6-e0c40e3e7653" />
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const redHeroImage =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAACxMAAAsTAQCanBgAAALuUExURUdwTBgQPBkQOxkQPRgQPRkRPRgQPBkRPRQQQBgQPBgQOhoRPhkRPRgQPBkQPBgQPRkQPRkQPRkQPBkQPRkSPRkSPBgRPRkQPhYQPRkQPhgQOv///////////+7t8BkRPQAAAP///+1ZTupWSfJgWPFfVv... | Put this into the namespace, otherwise the esbuild transpilation will create this as a global variable.
(we're sadly not using modules) | /*
* GDevelop JS Platform
* Copyright 2013-2025 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
namespace gdjs {
const logger = new gdjs.Logger('InAppTutorialMessage');
const padding = '20px';
const redHeroImage =
'data:image/png;base64,iV... | @@ -0,0 +1,185 @@
+const redHeroImage = | GDJS/Runtime/InAppTutorialMessage.tsx | 1 | TypeScript | 0.357 | suggestion | 138 | 26 | 26 | false | Add possibility to display message in the preview when an in-app tutorial is running | 7,379 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/InAppTutorialMessage.tsx
PR Title: Add possibility to display message in the preview when an in-app tutorial is running
BEFORE CODE: const redHeroImage =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAABGdBTUEAALGPC/xh... | Put this into the namespace, otherwise the esbuild transpilation will create this as a global variable.
(we're sadly not using modules) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
_loadFont();
_container = (
<div
id={containerId}
style={{ ...styles.container, ...containerPositionStyle }}
>
<div style={styles.avatarContainer}>
<div
style={{
...styles.messageContainer,
...messageCon... | it can't be null/undefined here, no? | _loadFont();
_container = (
<div
id={containerId}
style={{ ...styles.container, ...containerPositionStyle }}
>
<div style={styles.avatarContainer}>
<div
style={{
...styles.messageContainer,
...messageCont... | @@ -0,0 +1,185 @@
+const redHeroImage =
+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAACxMAAAsTAQCanBgAAALuUExURUdwTBgQPBkQOxkQPRgQPRkRPRgQPBkRPRQQQBgQPBgQOhoRPhkRPRgQPBkQPBgQPRkQPRkQPRkQPBkQPRkSPRkSPBgRPRkQPhYQPRkQPhgQOv///////////+7t8BkRPQAAAP... | GDJS/Runtime/InAppTutorialMessage.tsx | 26 | TypeScript | 0.214 | question | 36 | 30 | 31 | false | Add possibility to display message in the preview when an in-app tutorial is running | 7,379 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/InAppTutorialMessage.tsx
PR Title: Add possibility to display message in the preview when an in-app tutorial is running
BEFORE CODE:
_loadFont();
_container = (
<div
id={containerId}
style={{ ...styles.... | it can't be null/undefined here, no? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ i... | I think in english it's a single word usually:
```suggestion
_('Set crossfade duration'),
_('Set the crossfade duration when switching to a new animation.'),
'Set crossfade duration of _PARAM0_ to _PARAM1_',
``` | .setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ i... | @@ -800,6 +800,20 @@ module.exports = {
.markAsSimple()
.setHidden()
.setFunctionName('hasAnimationEnded');
+
+ object
+ .addScopedAction(
+ 'SetCrossfadeDuration',
+ _('Set cross fade duration'),
+ _('Set the duration of the cross fading between two ani... | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.786 | suggestion | 248 | 51 | 51 | false | add a crossfade duration property to 3d models and an action to set it | 7,386 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: add a crossfade duration property to 3d models and an action to set it
BEFORE CODE: .setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded'... | I think in english it's a single word usually:
```suggestion
_('Set crossfade duration'),
_('Set the crossfade duration when switching to a new animation.'),
'Set crossfade duration of _PARAM0_ to _PARAM1_',
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ is finished'),
_('Animations and images'),
'res/conditions/animation24.png',
'res/conditions/animation.png... | ```suggestion
.addParameter('number', _('Crossfade duration'), '', false)
``` | _('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ is finished'),
_('Animations and images'),
'res/conditions/animation24.png',
'res/conditions/animation.png... | @@ -800,6 +800,20 @@ module.exports = {
.markAsSimple()
.setHidden()
.setFunctionName('hasAnimationEnded');
+
+ object
+ .addScopedAction(
+ 'SetCrossfadeDuration',
+ _('Set cross fade duration'),
+ _('Set the duration of the cross fading between two ani... | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.571 | suggestion | 87 | 51 | 51 | false | add a crossfade duration property to 3d models and an action to set it | 7,386 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: add a crossfade duration property to 3d models and an action to set it
BEFORE CODE: _('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
... | ```suggestion
.addParameter('number', _('Crossfade duration'), '', false)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/**
GDevelop - Particle System Extension
Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#include "Model3DObjectConfiguration.h"
#include "GDCore/CommonTools.h"
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
#include "GDCore/Project/InitialI... | Nitpicking, here and everywhere: `crossfadeDuration` (your PR contains a mix of crossFade and crossfade). Let's use crossfade everywhere it's possible. | /**
GDevelop - Particle System Extension
Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
This project is released under the MIT License.
*/
#include "Model3DObjectConfiguration.h"
#include "GDCore/CommonTools.h"
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
#include "GDCore/Project/InitialI... | @@ -23,7 +23,7 @@ Model3DObjectConfiguration::Model3DObjectConfiguration()
: width(100), height(100), depth(100), rotationX(0), rotationY(0),
rotationZ(0), modelResourceName(""), materialType("StandardWithoutMetalness"),
originLocation("ModelOrigin"), centerLocation("ModelOrigin"),
- keepAspectR... | Extensions/3D/Model3DObjectConfiguration.cpp | 26 | C++ | 0.571 | suggestion | 151 | 51 | 51 | false | add a crossfade duration property to 3d models and an action to set it | 7,386 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: C++
File: Extensions/3D/Model3DObjectConfiguration.cpp
PR Title: add a crossfade duration property to 3d models and an action to set it
BEFORE CODE: /**
GDevelop - Particle System Extension
Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
This project is re... | Nitpicking, here and everywhere: `crossfadeDuration` (your PR contains a mix of crossFade and crossfade). Let's use crossfade everywhere it's possible. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
type Model3DObjectNetworkSyncData = Object3DNetworkSyncData &
Model3DObjectNetworkSyncDataType;
/** Base parameters for {@link gdjs.Cube3DRuntimeObject} */
export interface Model3DObjectData extends Object3DData {
/** The base parameters of the Model3D object */
content: Object3DDataContent & {
... | Same everywhere: crossfadeDuration | type Model3DObjectNetworkSyncData = Object3DNetworkSyncData &
Model3DObjectNetworkSyncDataType;
/** Base parameters for {@link gdjs.Cube3DRuntimeObject} */
export interface Model3DObjectData extends Object3DData {
/** The base parameters of the Model3D object */
content: Object3DDataContent & {
... | @@ -36,6 +37,7 @@ namespace gdjs {
| 'BottomCenterZ'
| 'BottomCenterY';
animations: Model3DAnimation[];
+ crossFadeDuration: float; | Extensions/3D/Model3DRuntimeObject.ts | 26 | TypeScript | 0.071 | suggestion | 34 | 51 | 51 | false | add a crossfade duration property to 3d models and an action to set it | 7,386 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/Model3DRuntimeObject.ts
PR Title: add a crossfade duration property to 3d models and an action to set it
BEFORE CODE: type Model3DObjectNetworkSyncData = Object3DNetworkSyncData &
Model3DObjectNetworkSyncDataType;
/** Base parameters... | Same everywhere: crossfadeDuration | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ i... | @NeylMahfouf2608 This must be translated too with _('') | .setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ i... | @@ -800,6 +800,20 @@ module.exports = {
.markAsSimple()
.setHidden()
.setFunctionName('hasAnimationEnded');
+
+ object
+ .addScopedAction(
+ 'SetCrossfadeDuration',
+ _('Set crossfade duration'),
+ _('Set the crossfade duration when switching to a new an... | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.214 | suggestion | 55 | 51 | 51 | false | add a crossfade duration property to 3d models and an action to set it | 7,386 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: add a crossfade duration property to 3d models and an action to set it
BEFORE CODE: .setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded'... | @NeylMahfouf2608 This must be translated too with _('') | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ is finished'),
_('Animations and images'),
'res/c... | Let's use another icon. This action is not related to a 3D box, this will be confusing. | object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
),
_('The animation of _PARAM0_ is finished'),
_('Animations and images'),
'res/c... | @@ -800,6 +800,20 @@ module.exports = {
.markAsSimple()
.setHidden()
.setFunctionName('hasAnimationEnded');
+
+ object
+ .addScopedAction(
+ 'SetCrossfadeDuration',
+ _('Set crossfade duration'),
+ _('Set the crossfade duration when switching to a new an... | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.286 | suggestion | 87 | 51 | 51 | false | add a crossfade duration property to 3d models and an action to set it | 7,386 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: add a crossfade duration property to 3d models and an action to set it
BEFORE CODE: object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check... | Let's use another icon. This action is not related to a 3D box, this will be confusing. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.markAsSimple()
.setHidden()
.setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
... | I think it's better if you put the unit in the parameter label, rather than on the action label | .markAsSimple()
.setHidden()
.setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
'HasAnimationEnded',
_('Animation finished'),
_(
'Check if the animation being played by the Sprite object is finished.'
... | @@ -804,12 +804,12 @@ module.exports = {
object
.addScopedAction(
'SetCrossfadeDuration',
- _('Set crossfade duration'),
+ _('Set crossfade duration (in seconds)'), | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.286 | nitpick | 95 | 51 | 51 | false | fix crossfade icon, crossfade property and add unit | 7,390 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | NeylMahfouf2608 | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: fix crossfade icon, crossfade property and add unit
BEFORE CODE: .markAsSimple()
.setHidden()
.setFunctionName('isAnimationPaused');
// Deprecated
object
.addCondition(
... | I think it's better if you put the unit in the parameter label, rather than on the action label | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
currentProjectRef,
eventsFunctionsExtensionsState,
setHasProjectOpened,
setState,
sealUnsavedChanges,
]
);
const loadFromProject = React.useCallback(
async (project: gdProject, fileMetadata: ?FileMetadata): Promise<State> => {
let updatedFileMetadata: ?FileMetadata = fil... | Would need a comment explaining why the heck we would need to update the fileMetadata despite being passed to us (us = the function). Is this our job? Is this the caller job?
I don't mind fixing something on the fly, but we need to document this in a function called "patchFileMetadataWithProjectInfoIfNeeded" to mak... | editorTabs: closeProjectTabs(state.editorTabs, currentProject),
}));
// Delete the project from memory. All references to it have been dropped previously
// by the setState.
console.info('Deleting project from memory...');
eventsFunctionsExtensionsState.unloadProjectEventsFunction... | @@ -854,7 +854,15 @@ const MainFrame = (props: Props) => {
const loadFromProject = React.useCallback(
async (project: gdProject, fileMetadata: ?FileMetadata): Promise<State> => {
- if (fileMetadata) {
+ let updatedFileMetadata: ?FileMetadata = fileMetadata | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.429 | suggestion | 434 | 51 | 51 | false | Fix correctly setting gameId and name when opening from project file | 7,392 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/index.js
PR Title: Fix correctly setting gameId and name when opening from project file
BEFORE CODE: currentProjectRef,
eventsFunctionsExtensionsState,
setHasProjectOpened,
setState,
sealUnsavedChanges... | Would need a comment explaining why the heck we would need to update the fileMetadata despite being passed to us (us = the function). Is this our job? Is this the caller job?
I don't mind fixing something on the fly, but we need to document this in a function called "patchFileMetadataWithProjectInfoIfNeeded" to mak... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
);
// Musics are played with the html5 backend, that is not compatible with spatialization.
this._musics[channel] = music;
music.once('play', () => {
if (this._paused) {
music.pause();
this._pausedSounds.push(music);
}
});
music.play();
}
... | maybe a little comm explaining we're storing the settings so it can be configured when a sound is created on the same frame? Or something like that?
I'm not 100% sure why this is needed | );
// Musics are played with the html5 backend, that is not compatible with spatialization.
this._musics[channel] = music;
music.once('play', () => {
if (this._paused) {
music.pause();
this._pausedSounds.push(music);
}
});
music.play();
}
... | @@ -746,6 +757,23 @@ namespace gdjs {
return this._musics[channel] || null;
}
+ setSoundSpatialPositionOnChannel(
+ channel: number,
+ x: number,
+ y: number,
+ z: number
+ ) {
+ const sound = this.getSoundOnChannel(channel);
+ if (sound && !sound.paused()) sound.setSpa... | GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts | 26 | TypeScript | 0.357 | suggestion | 186 | 51 | 51 | false | Fix spatial sound setting if sound not playing yet | 7,393 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts
PR Title: Fix spatial sound setting if sound not playing yet
BEFORE CODE: );
// Musics are played with the html5 backend, that is not compatible with spatialization.
this._musics[c... | maybe a little comm explaining we're storing the settings so it can be configured when a sound is created on the same frame? Or something like that?
I'm not 100% sure why this is needed | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
music.pause();
this._pausedSounds.push(music);
}
});
music.play();
}
getMusicOnChannel(channel: integer): HowlerSound | null {
return this._musics[channel] || null;
}
setSoundSpatialPositionOnChannel(
channel: number,
x: number,
y: number... | should the last part be more "if actions are in the wrong order, the spatial position will not apply to the sound that hasn't started playing yet" | music.pause();
this._pausedSounds.push(music);
}
});
music.play();
}
getMusicOnChannel(channel: integer): HowlerSound | null {
return this._musics[channel] || null;
}
setSoundSpatialPositionOnChannel(
channel: number,
x: number,
y: number... | @@ -746,6 +757,29 @@ namespace gdjs {
return this._musics[channel] || null;
}
+ setSoundSpatialPositionOnChannel(
+ channel: number,
+ x: number,
+ y: number,
+ z: number
+ ) {
+ const sound = this.getSoundOnChannel(channel);
+ if (sound && !sound.paused()) sound.setSpa... | GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts | 26 | TypeScript | 0.429 | bug | 146 | 51 | 51 | false | Fix spatial sound setting if sound not playing yet | 7,393 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts
PR Title: Fix spatial sound setting if sound not playing yet
BEFORE CODE: music.pause();
this._pausedSounds.push(music);
}
});
music.play();
}
getMus... | should the last part be more "if actions are in the wrong order, the spatial position will not apply to the sound that hasn't started playing yet" | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
registerEditorConfigurations: function (objectsEditorService) {
objectsEditorService.registerEditorConfiguration(
'Lighting::LightObject',
objectsEditorService.getDefaultObjectJsImplementationPropertiesEditor({
helpPagePath: '/all-features/lighting/reference',
})
);
},
/**
* ... | is it OK to create the Graphics outside of the constructor? I'm worried this may cause issues 🤔 |
registerEditorConfigurations: function (objectsEditorService) {
objectsEditorService.registerEditorConfiguration(
'Lighting::LightObject',
objectsEditorService.getDefaultObjectJsImplementationPropertiesEditor({
helpPagePath: '/all-features/lighting/reference',
})
);
},
/**
* ... | @@ -235,7 +235,8 @@ module.exports = {
class RenderedLightObjectInstance extends RenderedInstance {
_radius = 0;
_color = 0;
- _radiusGraphics = null;
+ /** The circle to show the radius of the light */
+ _radiusGraphics = new PIXI.Graphics(); | Extensions/Lighting/JsExtension.js | 26 | JavaScript | 0.286 | suggestion | 96 | 51 | 51 | false | Upgrade to TypeScript 5.4.5 | 7,394 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | D8H | Review this pull request change.
Language: JavaScript
File: Extensions/Lighting/JsExtension.js
PR Title: Upgrade to TypeScript 5.4.5
BEFORE CODE:
registerEditorConfigurations: function (objectsEditorService) {
objectsEditorService.registerEditorConfiguration(
'Lighting::LightObject',
objectsEdito... | is it OK to create the Graphics outside of the constructor? I'm worried this may cause issues 🤔 | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
variant: 'normal',
weight: 'normal',
unicodeRange:
'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD',
display: 'swap',
}
)
... | Should you store a reference to it to avoid re-creating it each time _loadStylesheet is called? | new FontFace(
'Fira Sans',
"url(https://fonts.gstatic.com/s/firasans/v17/va9E4kDNxMZdWfMOD5Vvl4jLazX3dA.woff2) format('woff2')",
{
variant: 'normal',
weight: 'normal',
unicodeRange:
'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+... | @@ -108,7 +109,7 @@ namespace gdjs {
.then((fontFace) => document.fonts.add(fontFace));
};
- const _loadStyles = () => {
+ const _loadStyleSheet = () => {
const adhocStyle = document.createElement('style'); | GDJS/Runtime/InAppTutorialMessage.tsx | 26 | TypeScript | 0.286 | question | 95 | 51 | 51 | false | Refresh in app tutorial message in preview when hot reloading preview | 7,407 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/InAppTutorialMessage.tsx
PR Title: Refresh in app tutorial message in preview when hot reloading preview
BEFORE CODE: variant: 'normal',
weight: 'normal',
unicodeRange:
'U+0000-00FF, U+0131, U+0152-015... | Should you store a reference to it to avoid re-creating it each time _loadStylesheet is called? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (!domElementContainer) {
return;
}
if (_container) {
domElementContainer.removeChild(_container);
_container = null;
if (!message) return;
}
const messageContent = document.createElement('div');
messageContent.id = messageContentId;
messageC... | Maybe make this method do nothing if fonts are already loaded. | /**
* When undefined, removes the current message.
*/
message: string | undefined,
position: string
) => {
const domElementContainer = getDomElementContainer(runtimeGame);
if (!domElementContainer) {
return;
}
if (_container) {
domElementConta... | @@ -177,12 +167,39 @@ namespace gdjs {
messageContainerPositionStyle.transform =
'translateY(calc(-100% - 10px))';
}
+ return { containerPositionStyle, messageContainerPositionStyle };
+ };
+
+ export const displayInAppTutorialMessage = (
+ runtimeGame: gdjs.RuntimeGame,
+ ... | GDJS/Runtime/InAppTutorialMessage.tsx | 26 | TypeScript | 0.214 | suggestion | 62 | 51 | 51 | false | Refresh in app tutorial message in preview when hot reloading preview | 7,407 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/InAppTutorialMessage.tsx
PR Title: Refresh in app tutorial message in preview when hot reloading preview
BEFORE CODE: if (!domElementContainer) {
return;
}
if (_container) {
domElementContainer.removeChild(_c... | Maybe make this method do nothing if fonts are already loaded. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
new FontFace(
'Fira Sans',
"url(https://fonts.gstatic.com/s/firasans/v17/va9E4kDNxMZdWfMOD5Vvl4jLazX3dA.woff2) format('woff2')",
{
variant: 'normal',
weight: 'normal',
unicodeRange:
'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+... | You can async/await and set a boolean when finished | const _loadFonts = async () => {
if (_areFontsLoaded) return;
const fontFaces = await Promise.all([
new FontFace(
'Fira Sans',
"url(https://fonts.gstatic.com/s/firasans/v17/va9E4kDNxMZdWfMOD5Vvl4jLazX3dA.woff2) format('woff2')",
{
variant: 'normal',
... | @@ -108,7 +109,7 @@ namespace gdjs {
.then((fontFace) => document.fonts.add(fontFace)); | GDJS/Runtime/InAppTutorialMessage.tsx | 26 | TypeScript | 0.214 | suggestion | 52 | 51 | 51 | false | Refresh in app tutorial message in preview when hot reloading preview | 7,407 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/InAppTutorialMessage.tsx
PR Title: Refresh in app tutorial message in preview when hot reloading preview
BEFORE CODE: new FontFace(
'Fira Sans',
"url(https://fonts.gstatic.com/s/firasans/v17/va9E4kDNxMZdWfMOD5Vvl4jLazX3dA... | You can async/await and set a boolean when finished | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const oldProjectData: ProjectData = gdjs.projectData;
const oldInAppTutorialMessageInPreview =
gdjs.runtimeGameOptions.inAppTutorialMessageInPreview;
const oldScriptFiles = gdjs.runtimeGameOptions
.scriptFiles as RuntimeGameOptionsScriptFile[];
oldScriptFiles.forEach((scriptFi... | I'm a bit uneasy at this patching of a private variable + patching of _options.
Could we rather call a method, like `runtimeGame.displayInAppTutorialMessage(...)`? |
const oldProjectData: ProjectData = gdjs.projectData;
const oldScriptFiles = gdjs.runtimeGameOptions
.scriptFiles as RuntimeGameOptionsScriptFile[];
oldScriptFiles.forEach((scriptFile) => {
this._alreadyLoadedScriptFiles[scriptFile.path] = true;
});
const oldBehaviorCons... | @@ -174,6 +176,17 @@ namespace gdjs {
const newRuntimeGameOptions: RuntimeGameOptions =
gdjs.runtimeGameOptions;
+ this._runtimeGame._displayMessageInPreview = | GDJS/Runtime/debugger-client/hot-reloader.ts | 26 | TypeScript | 0.571 | question | 164 | 51 | 51 | false | Refresh in app tutorial message in preview when hot reloading preview | 7,407 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/debugger-client/hot-reloader.ts
PR Title: Refresh in app tutorial message in preview when hot reloading preview
BEFORE CODE:
const oldProjectData: ProjectData = gdjs.projectData;
const oldInAppTutorialMessageInPreview =
g... | I'm a bit uneasy at this patching of a private variable + patching of _options.
Could we rather call a method, like `runtimeGame.displayInAppTutorialMessage(...)`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
* This has nothing to do with `_paused`.
*/
_hasJustResumed: boolean = false;
//Inputs :
_inputManager: InputManager;
/**
* Allow to specify an external layout to insert in the first scene.
*/
_injectExternalLayout: any;
_options: RuntimeGameOptions;
/**
* The map... | This boolean is a bit weird, it acts as "show it once" but it's not super clear when reading its name.
Do we really need it? | * This has nothing to do with `_paused`.
*/
_hasJustResumed: boolean = false;
//Inputs :
_inputManager: InputManager;
/**
* Allow to specify an external layout to insert in the first scene.
*/
_injectExternalLayout: any;
_options: RuntimeGameOptions;
/**
* The map... | @@ -191,6 +191,7 @@ namespace gdjs {
_sessionMetricsInitialized: boolean = false;
_disableMetrics: boolean = false;
_isPreview: boolean;
+ _displayMessageInPreview: boolean = false; | GDJS/Runtime/runtimegame.ts | 26 | TypeScript | 0.357 | question | 126 | 51 | 51 | false | Refresh in app tutorial message in preview when hot reloading preview | 7,407 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/runtimegame.ts
PR Title: Refresh in app tutorial message in preview when hot reloading preview
BEFORE CODE: * This has nothing to do with `_paused`.
*/
_hasJustResumed: boolean = false;
//Inputs :
_inputManager: InputMan... | This boolean is a bit weird, it acts as "show it once" but it's not super clear when reading its name.
Do we really need it? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// to automatically log the user in the frame,
// or notify it the user is not connected (or just disconnected).
// $FlowFixMe - we know it's an iframe.
const iframe: ?HTMLIFrameElement = document.getElementById(
GAMES_PLATFORM_IFRAME_ID
);
if (!iframe || !iframe.contentWind... | if you want to keep those console.log() maybe turn them into console.info() or remove | // to automatically log the user in the frame,
// or notify it the user is not connected (or just disconnected).
// $FlowFixMe - we know it's an iframe.
const iframe: ?HTMLIFrameElement = document.getElementById(
GAMES_PLATFORM_IFRAME_ID
);
if (!iframe || !iframe.contentWind... | @@ -310,59 +385,44 @@ const GamesPlatformFrameStateProvider = ({
[handleIframeMessage]
);
- const sendTokenToIframeIfConnected = React.useCallback(
+ const { userCustomToken } = useUserCustomToken();
+
+ const sendUserCustomTokenToFrame = React.useCallback(
async () => {
- if (iframeLoaded && use... | newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrameContext.js | 26 | JavaScript | 0.286 | suggestion | 85 | 51 | 51 | false | Prepare custom token to speed up embedded game frame login | 7,423 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | 4ian | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrameContext.js
PR Title: Prepare custom token to speed up embedded game frame login
BEFORE CODE: // to automatically log the user in the frame,
// or notify it the use... | if you want to keep those console.log() maybe turn them into console.info() or remove | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
let rewardedVideoLoading = false; // Becomes true when the video is loading.
let rewardedVideoReady = false; // Becomes true when the video is loaded and ready to be shown.
let rewardedVideoShowing = false; // Becomes true when the video is showing.
let rewardedVideoRewardReceived = false; // Becomes tr... | I wonder if it's a good idea to delay this by 2 seconds, and offer:
- an action to cancel automatic consent dialog/tracking authorization display.
- an action to do it manually.
So that if I want to postpone this (because it's better if my player plays a bit or click a button in the menu, so I have the opportunity... | let rewardedVideoLoading = false; // Becomes true when the video is loading.
let rewardedVideoReady = false; // Becomes true when the video is loaded and ready to be shown.
let rewardedVideoShowing = false; // Becomes true when the video is showing.
let rewardedVideoRewardReceived = false; // Becomes tr... | @@ -108,22 +109,53 @@ namespace gdjs {
let rewardedVideoRewardReceived = false; // Becomes true when the video is closed and the reward is received.
let rewardedVideoErrored = false; // Becomes true when the video fails to load.
- let npaValue = '0'; // TODO: expose an API to change this and also an auto... | Extensions/AdMob/admobtools.ts | 26 | TypeScript | 0.5 | security | 486 | 51 | 51 | false | Handle displaying consent for admob on iOS | 7,431 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: TypeScript
File: Extensions/AdMob/admobtools.ts
PR Title: Handle displaying consent for admob on iOS
BEFORE CODE: let rewardedVideoLoading = false; // Becomes true when the video is loading.
let rewardedVideoReady = false; // Becomes true when the video is loaded a... | I wonder if it's a good idea to delay this by 2 seconds, and offer:
- an action to cancel automatic consent dialog/tracking authorization display.
- an action to do it manually.
So that if I want to postpone this (because it's better if my player plays a bit or click a button in the menu, so I have the opportunity... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
'SetTestMode',
_('Enable test mode'),
_(
'Activate or deactivate the test mode ("development" mode).\n' +
'When activated, tests ads will be served instead of real ones.\n' +
'\n' +
'It is important to enable test ads during development so that you c... | ```suggestion
'Prevent AdMob from initializing automatically. You will need to call the "Initialize AdMob" action instead.\n' +
``` | 'SetTestMode',
_('Enable test mode'),
_(
'Activate or deactivate the test mode ("development" mode).\n' +
'When activated, tests ads will be served instead of real ones.\n' +
'\n' +
'It is important to enable test ads during development so that you c... | @@ -93,6 +93,41 @@ module.exports = {
.setIncludeFile('Extensions/AdMob/admobtools.js')
.setFunctionName('gdjs.adMob.setTestMode');
+ extension
+ .addAction(
+ 'PreventAdmobAutoInitialization',
+ _('Prevent Admob auto initialization'),
+ _(
+ 'Prevent Admob from ini... | Extensions/AdMob/JsExtension.js | 26 | JavaScript | 0.786 | suggestion | 143 | 51 | 51 | false | Handle displaying consent for admob on iOS | 7,431 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: Extensions/AdMob/JsExtension.js
PR Title: Handle displaying consent for admob on iOS
BEFORE CODE: 'SetTestMode',
_('Enable test mode'),
_(
'Activate or deactivate the test mode ("development" mode).\n' +
'When ... | ```suggestion
'Prevent AdMob from initializing automatically. You will need to call the "Initialize AdMob" action instead.\n' +
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.addParameter('yesorno', _('Enable test mode?'), '', false)
.getCodeExtraInformation()
.setIncludeFile('Extensions/AdMob/admobtools.js')
.setFunctionName('gdjs.adMob.setTestMode');
extension
.addAction(
'PreventAdmobAutoInitialization',
_('Prevent Admob auto initializa... | Everywhere for user facing texts: AdMob
(keep Admob for code, because it's camelCase and we consider "admob" as a single word) | .addParameter('yesorno', _('Enable test mode?'), '', false)
.getCodeExtraInformation()
.setIncludeFile('Extensions/AdMob/admobtools.js')
.setFunctionName('gdjs.adMob.setTestMode');
extension
.addAction(
'PreventAdmobAutoInitialization',
_('Prevent AdMob auto initializa... | @@ -93,6 +93,41 @@ module.exports = {
.setIncludeFile('Extensions/AdMob/admobtools.js')
.setFunctionName('gdjs.adMob.setTestMode');
+ extension
+ .addAction(
+ 'PreventAdmobAutoInitialization',
+ _('Prevent Admob auto initialization'),
+ _(
+ 'Prevent Admob from ini... | Extensions/AdMob/JsExtension.js | 26 | JavaScript | 0.429 | suggestion | 129 | 51 | 51 | false | Handle displaying consent for admob on iOS | 7,431 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: Extensions/AdMob/JsExtension.js
PR Title: Handle displaying consent for admob on iOS
BEFORE CODE: .addParameter('yesorno', _('Enable test mode?'), '', false)
.getCodeExtraInformation()
.setIncludeFile('Extensions/AdMob/admobtools.js')
... | Everywhere for user facing texts: AdMob
(keep Admob for code, because it's camelCase and we consider "admob" as a single word) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return sound;
}
/**
* Creates a new gdjs.HowlerSound using preloaded/cached Howl instances.
* @param soundName The name of the file or resource to play.
* @param isMusic True if a music, false if a sound.
* @param volume Between 0 and 1.
* @param loop True if it should be played ... | here it seems the logic has changed, it's using resource (so `resource.file`) where it used to be that or `soundName` if not defined.
The resource is created from the soundName, I'm actually unsure if this case can happen or not | }
/**
* Creates a new gdjs.HowlerSound using preloaded/cached Howl instances.
* @param soundName The name of the file or resource to play.
* @param isMusic True if a music, false if a sound.
* @param volume Between 0 and 1.
* @param loop True if it should be played looping.
* @par... | @@ -539,11 +586,12 @@ namespace gdjs {
howl = new Howl(
Object.assign(
{
- src: [this._resourceLoader.getFullUrl(fileName)],
+ src: this._getSoundUrlsFromResource(resource), | GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts | 26 | TypeScript | 0.643 | suggestion | 229 | 51 | 51 | false | Incapsulate logic of getting file url in Sound manager | 7,433 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ViktorVovk | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts
PR Title: Incapsulate logic of getting file url in Sound manager
BEFORE CODE: return sound;
}
/**
* Creates a new gdjs.HowlerSound using preloaded/cached Howl instances.
* @... | here it seems the logic has changed, it's using resource (so `resource.file`) where it used to be that or `soundName` if not defined.
The resource is created from the soundName, I'm actually unsure if this case can happen or not | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const initializeGDevelopJs = require('../../Binaries/embuild/GDevelop.js/libGD.js');
const { makeMinimalGDJSMock } = require('../TestUtils/GDJSMocks.js');
const {
generateCompiledEventsForLayout,
} = require('../TestUtils/CodeGenerationHelpers.js');
describe('libGD.js - GDJS Code Generation integration tests', funct... | @D8H can you generate an additional test case that checks if we can iterate on an object variable (i.e: iterate on `MyObject.MyObjectVariable` itself?) | actions: [],
events: [
{
type: 'BuiltinCommonInstructions::ForEachChildVariable',
iterableVariableName: 'MyVariableB',
valueIteratorVariableName: 'childB',
keyIteratorVariableName: '',
conditions: [],
actions: [
... | @@ -709,4 +709,185 @@ describe('libGD.js - GDJS Code Generation integration tests', function () {
.hasChild('MyChildB')
).toBe(false);
});
+
+ it('can generate a "for each child variable" event with scene variables', function () {
+ scene.getVariables().insertNew('Counter', 0).setValue(0);
+ sce... | GDevelop.js/__tests__/GDJSSceneVariableCodeGenerationIntegrationTests.js | 26 | JavaScript | 0.5 | suggestion | 151 | 713 | 51 | false | Fix access to object in variable expressions of "for each child variable" loops | 7,435 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: GDevelop.js/__tests__/GDJSSceneVariableCodeGenerationIntegrationTests.js
PR Title: Fix access to object in variable expressions of "for each child variable" loops
BEFORE CODE: const initializeGDevelopJs = require('../../Binaries/embuild/GDevelop.js/libGD.j... | @D8H can you generate an additional test case that checks if we can iterate on an object variable (i.e: iterate on `MyObject.MyObjectVariable` itself?) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
value="Boolean"
label={t`Boolean (checkbox)`}
/>
<SelectOption
key="property-type-choice"
... | I wonder if we should call this MultilineString, because:
- "Text Area" is a UI result
- Whereas "MultilineString" is more a data type. | value="Boolean"
label={t`Boolean (checkbox)`}
/>
<SelectOption
key="property-type-choice"
... | @@ -754,6 +754,11 @@ export default function EventsBasedBehaviorPropertiesEditor({
value="KeyboardKey"
label={t`Keyboard key (text)`}
/>
+ <SelectOption
+... | newIDE/app/src/EventsBasedBehaviorEditor/EventsBasedBehaviorPropertiesEditor.js | 26 | JavaScript | 0.571 | suggestion | 139 | 51 | 51 | false | Allow custom objects to declare multi-line text properties | 7,436 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsBasedBehaviorEditor/EventsBasedBehaviorPropertiesEditor.js
PR Title: Allow custom objects to declare multi-line text properties
BEFORE CODE: value="Boolean"
... | I wonder if we should call this MultilineString, because:
- "Text Area" is a UI result
- Whereas "MultilineString" is more a data type. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const showProjectNeedToBeSaved = useProjectNeedToBeSavedAlertDialog(
resourceManagementProps.canInstallPrivateAsset
);
return async (
assetShortHeader: AssetShortHeader
): Promise<InstallAssetOutput | null> => {
try {
if (await showProjectNeedToBeSaved(assetShortHeader)) {
return null... | ```suggestion
message: t`Please upgrade the editor to the latest version.`,
``` | const showProjectNeedToBeSaved = useProjectNeedToBeSavedAlertDialog(
resourceManagementProps.canInstallPrivateAsset
);
return async (
assetShortHeader: AssetShortHeader
): Promise<InstallAssetOutput | null> => {
try {
if (await showProjectNeedToBeSaved(assetShortHeader)) {
return null... | @@ -161,6 +161,16 @@ export const useInstallAsset = ({
project,
}
);
+ if (
+ requiredExtensionInstallation.incompatibleWithIdeExtensionShortHeaders
+ .length > 0
+ ) {
+ showAlert({
+ title: t`Could not install the asset`,
+ message: t`Pleas... | newIDE/app/src/AssetStore/NewObjectDialog.js | 26 | JavaScript | 0.571 | suggestion | 91 | 51 | 51 | false | Forbid to install assets or behaviors from extensions incompatible with the editor | 7,441 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/AssetStore/NewObjectDialog.js
PR Title: Forbid to install assets or behaviors from extensions incompatible with the editor
BEFORE CODE: const showProjectNeedToBeSaved = useProjectNeedToBeSavedAlertDialog(
resourceManagementProps.canIns... | ```suggestion
message: t`Please upgrade the editor to the latest version.`,
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (installAssetOutput)
onObjectsAddedFromAssets(installAssetOutput.createdObjects);
return !!installAssetOutput;
},
[installAsset, onObjectsAddedFromAssets]
);
const onInstallEmptyCustomObject = React.useCallback(
async (enumeratedObjectMetadata: EnumeratedObjectMetadata) => {
... | ```suggestion
message: t`Please upgrade the editor to the latest version.`,
``` | if (installAssetOutput)
onObjectsAddedFromAssets(installAssetOutput.createdObjects);
return !!installAssetOutput;
},
[installAsset, onObjectsAddedFromAssets]
);
const onInstallEmptyCustomObject = React.useCallback(
async (enumeratedObjectMetadata: EnumeratedObjectMetadata) => {
... | @@ -331,6 +341,16 @@ function NewObjectDialog({
project,
}
);
+ if (
+ requiredExtensionInstallation.incompatibleWithIdeExtensionShortHeaders
+ .length > 0
+ ) {
+ showAlert({
+ title: t`Could not install the asset`,
+ mes... | newIDE/app/src/AssetStore/NewObjectDialog.js | 26 | JavaScript | 0.571 | suggestion | 93 | 51 | 51 | false | Forbid to install assets or behaviors from extensions incompatible with the editor | 7,441 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/AssetStore/NewObjectDialog.js
PR Title: Forbid to install assets or behaviors from extensions incompatible with the editor
BEFORE CODE: if (installAssetOutput)
onObjectsAddedFromAssets(installAssetOutput.createdObjects);
... | ```suggestion
message: t`Please upgrade the editor to the latest version.`,
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
|};
export type UserCourseProgress = {|
userId: string,
courseId: string,
progress: {| chapterId: string, completedTasks: number[] |}[],
|};
export type Environment = 'staging' | 'live';
export const client = axios.create({
baseURL: GDevelopAssetApi.baseUrl,
});
export const isAssetPackAudioOnly = (assetPac... | ```suggestion
export const isCompatibleWithGDevelopVersion = (
``` | |};
export type UserCourseProgress = {|
userId: string,
courseId: string,
progress: {| chapterId: string, completedTasks: number[] |}[],
|};
export type Environment = 'staging' | 'live';
export const client = axios.create({
baseURL: GDevelopAssetApi.baseUrl,
});
export const isAssetPackAudioOnly = (assetPac... | @@ -243,10 +243,10 @@ export const doesAssetPackContainAudio = (
*/
export const isCompatibleWithAsset = ( | newIDE/app/src/Utils/GDevelopServices/Asset.js | 26 | JavaScript | 0.571 | suggestion | 68 | 51 | 51 | false | Forbid to install assets or behaviors from extensions incompatible with the editor | 7,441 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/Utils/GDevelopServices/Asset.js
PR Title: Forbid to install assets or behaviors from extensions incompatible with the editor
BEFORE CODE: |};
export type UserCourseProgress = {|
userId: string,
courseId: string,
progress: {| chapterId... | ```suggestion
export const isCompatibleWithGDevelopVersion = (
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const [holes, setHoles] = React.useState([]);
const updateHoles = React.useCallback(
() => {
const newHoles = elements.map(element => {
const { top, left, width, height } = element.getBoundingClientRect();
return {
top,
left,
width,
height,
... | those event listeners are OK but seem not enough, especially on mobile or when the window keep scrolling with momentum, so the interval below is here to help catching up | const [holes, setHoles] = React.useState([]);
const updateHoles = React.useCallback(
() => {
const newHoles = elements.map(element => {
const { top, left, width, height } = element.getBoundingClientRect();
return {
top,
left,
width,
height,
... | @@ -0,0 +1,87 @@
+// @flow
+import * as React from 'react';
+import { aboveMaterialUiMaxZIndex } from '../UI/MaterialUISpecificUtil';
+import { useInterval } from '../Utils/UseInterval';
+
+const blockingLayerZIndex = aboveMaterialUiMaxZIndex;
+export const itemAboveBlockingLayerZIndex = blockingLayerZIndex + 1;
+
+typ... | newIDE/app/src/InAppTutorial/BlockingLayerWithHoles.js | 26 | JavaScript | 0.357 | suggestion | 169 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/BlockingLayerWithHoles.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: const [holes, setHoles] = React.useState([]);
const updateHoles = React.useCallback(
() => ... | those event listeners are OK but seem not enough, especially on mobile or when the window keep scrolling with momentum, so the interval below is here to help catching up | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
elementWithValueToWatchIfChanged ? 1000 : null
);
useInterval(
watchInputEquals,
elementWithValueToWatchIfEquals ? 1000 : null
);
useInterval(
watchSceneInstanceChanges,
objectSceneInstancesToWatch ? 500 : null
);
useInterval(watchSceneObjects, sceneObjectCountToWat... | small improvement to hide the Tooltip & Highlighter when the user has either finished or trying to quit.
This also allows not to show the blocking layer in those cases | watchInputChanges,
elementWithValueToWatchIfChanged ? 1000 : null
);
useInterval(
watchInputEquals,
elementWithValueToWatchIfEquals ? 1000 : null
);
useInterval(
watchSceneInstanceChanges,
objectSceneInstancesToWatch ? 500 : null
);
useInterval(watchSceneObjec... | @@ -1047,14 +1090,19 @@ const InAppTutorialOrchestrator = React.forwardRef<
useInterval(watchSceneObjects, sceneObjectCountToWatch ? 1000 : null);
useInterval(
watchDomForNextStepTrigger,
- currentStep && currentStep.isTriggerFlickering ? 500 : null
+ currentStep && currentStep.isTriggerFlick... | newIDE/app/src/InAppTutorial/InAppTutorialOrchestrator.js | 26 | JavaScript | 0.429 | suggestion | 168 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/InAppTutorialOrchestrator.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: elementWithValueToWatchIfChanged ? 1000 : null
);
useInterval(
watchInputEqua... | small improvement to hide the Tooltip & Highlighter when the user has either finished or trying to quit.
This also allows not to show the blocking layer in those cases | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const errors = checkInAppTutorialFileJsonSchema(inAppTutorial);
if (errors.length) {
console.error(
"Guided lesson file doesn't respect the format. See errors:",
errors
);
Window.showMessageBox(
"Guided lesson file doesn't respect the format. Check devel... | this is to ease testing when loading a JSON and avoid having a warning "You're leaving without save" even when it's finished | });
if (!filePath) return;
const inAppTutorial = await readJSONFile(filePath);
const errors = checkInAppTutorialFileJsonSchema(inAppTutorial);
if (errors.length) {
console.error(
"Guided lesson file doesn't respect the format. See errors:",
errors
);
... | @@ -126,7 +126,10 @@ const InAppTutorialProvider = (props: Props) => {
tutorialId: inAppTutorial.id,
initialProjectData: inAppTutorial.initialProjectData || {},
initialStepIndex: 0,
- inAppTutorial,
+ inAppTutorial: {
+ ...inAppTutorial,
+ isMiniTutorial: true,... | newIDE/app/src/InAppTutorial/InAppTutorialProvider.js | 26 | JavaScript | 0.429 | suggestion | 124 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/InAppTutorialProvider.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: const errors = checkInAppTutorialFileJsonSchema(inAppTutorial);
if (errors.length) {
... | this is to ease testing when loading a JSON and avoid having a warning "You're leaving without save" even when it's finished | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/>
);
return (
<Column noMargin>
{titleAndDescription}
{imageAndButton}
{fillAutomaticallyButton}
</Column>
);
};
type TooltipHeaderProps = {|
paletteType: 'dark' | 'light',
progress: number,
showFoldButton: boolean,
onClickFoldButton: () => void,
tooltipContent?: string,
... | As the flow is more restrictive now, I went with the decision to always show the quit button, so the user can always decide to quit, especially if there's a misconfigured step we didn't catch. | primary
/>
);
return (
<Column noMargin>
{titleAndDescription}
{imageAndButton}
{fillAutomaticallyButton}
</Column>
);
};
type TooltipHeaderProps = {|
paletteType: 'dark' | 'light',
progress: number,
showFoldButton: boolean,
onClickFoldButton: () => void,
tooltipCont... | @@ -215,7 +214,6 @@ const TooltipHeader = ({
paletteType,
progress,
showFoldButton,
- showQuitButton, | newIDE/app/src/InAppTutorial/InAppTutorialTooltipDisplayer.js | 26 | JavaScript | 0.429 | suggestion | 192 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/InAppTutorialTooltipDisplayer.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: />
);
return (
<Column noMargin>
{titleAndDescription}
{imageAndButto... | As the flow is more restrictive now, I went with the decision to always show the quit button, so the user can always decide to quit, especially if there's a misconfigured step we didn't catch. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
? '#EBEBED' // Grey10
: '#FAFAFA'; // Grey00
return (
<Popper
id="in-app-tutorial-tooltip-displayer"
open={show}
className={classes.popper}
anchorEl={anchorElement}
transition
placement={placement}
popperOptions={{
modifiers: {
arrow: { enab... | Tooltip used to be just above element, now as there's a blocking layer above everything, it needs to be at the same level as this layer, so it can be interacted with (to quit tutorial) | : tooltip.placement || 'bottom';
const backgroundColor =
paletteType === 'light'
? '#EBEBED' // Grey10
: '#FAFAFA'; // Grey00
return (
<Popper
id="in-app-tutorial-tooltip-displayer"
open={show}
className={classes.popper}
anchorEl={anchorElement}
transition
... | @@ -369,7 +363,7 @@ const InAppTutorialTooltipDisplayer = ({
},
}}
style={{
- zIndex: getDisplayZIndexForHighlighter(anchorElement),
+ zIndex: aboveMaterialUiMaxZIndex, | newIDE/app/src/InAppTutorial/InAppTutorialTooltipDisplayer.js | 26 | JavaScript | 0.429 | suggestion | 184 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/InAppTutorialTooltipDisplayer.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: ? '#EBEBED' // Grey10
: '#FAFAFA'; // Grey00
return (
<Popper
id="in... | Tooltip used to be just above element, now as there's a blocking layer above everything, it needs to be at the same level as this layer, so it can be interacted with (to quit tutorial) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
});
setHoles(newHoles);
},
[elements]
);
React.useEffect(
() => {
// Update hole position on scroll & resize
window.addEventListener('wheel', updateHoles);
window.addEventListener('touchmove', updateHoles);
window.addEventListener('resize', updateHoles);
update... | ```suggestion
useInterval(updateHoles, elements.length === 0 ? null : 1000);
```
Or something like that? | });
setHoles(newHoles);
},
[elements]
);
React.useEffect(
() => {
if (!elements.length) return;
// Update hole position on scroll & resize
window.addEventListener('wheel', updateHoles);
window.addEventListener('touchmove', updateHoles);
window.addEventListener... | @@ -0,0 +1,87 @@
+// @flow
+import * as React from 'react';
+import { aboveMaterialUiMaxZIndex } from '../UI/MaterialUISpecificUtil';
+import { useInterval } from '../Utils/UseInterval';
+
+const blockingLayerZIndex = aboveMaterialUiMaxZIndex;
+export const itemAboveBlockingLayerZIndex = blockingLayerZIndex + 1;
+
+typ... | newIDE/app/src/InAppTutorial/BlockingLayerWithHoles.js | 26 | JavaScript | 0.929 | question | 109 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/BlockingLayerWithHoles.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: });
setHoles(newHoles);
},
[elements]
);
React.useEffect(
() => {
... | ```suggestion
useInterval(updateHoles, elements.length === 0 ? null : 1000);
```
Or something like that? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
async ({
tutorialId,
initialStepIndex,
initialProjectData,
inAppTutorial,
}: {|
tutorialId: string,
initialStepIndex: number,
initialProjectData: { [key: string]: string },
inAppTutorial?: InAppTutorial,
|}) => {
let inAppTutorialToLoad = inAppTutorial;
... | Maybe a comment on this? It's a bit mysterious without the context | async ({
tutorialId,
initialStepIndex,
initialProjectData,
inAppTutorial,
}: {|
tutorialId: string,
initialStepIndex: number,
initialProjectData: { [key: string]: string },
inAppTutorial?: InAppTutorial,
|}) => {
let inAppTutorialToLoad = inAppTutorial;
... | @@ -65,6 +65,8 @@ const InAppTutorialProvider = (props: Props) => {
inAppTutorialToLoad = await fetchInAppTutorial(
inAppTutorialShortHeader
);
+ inAppTutorialToLoad.shouldRestrictUI = | newIDE/app/src/InAppTutorial/InAppTutorialProvider.js | 26 | JavaScript | 0.214 | suggestion | 66 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/InAppTutorialProvider.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: async ({
tutorialId,
initialStepIndex,
initialProjectData,
inAppTutorial,... | Maybe a comment on this? It's a bit mysterious without the context | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
progress={progress}
goToNextStep={goToNextStep}
buttonLabel={
nextStepTrigger && nextStepTrigger.clickOnTooltipButton
? nextStepTrigger.clickOnTooltipButton
: undefined
}
fillAutomatically={getFillAutomaticallyFunc... | Could you bring the comment above next to the `false`? | progress={progress}
goToNextStep={goToNextStep}
buttonLabel={
nextStepTrigger && nextStepTrigger.clickOnTooltipButton
? nextStepTrigger.clickOnTooltipButton
: undefined
}
fillAutomatically={getFillAutomaticallyFunc... | @@ -420,6 +419,7 @@ function InAppTutorialStepDisplayer({
tooltip={wrongEditorTooltip}
progress={progress}
goToNextStep={goToNextStep}
+ isBlockingLayerDisplayed={false} | newIDE/app/src/InAppTutorial/InAppTutorialStepDisplayer.js | 26 | JavaScript | 0.429 | question | 54 | 51 | 51 | false | Improve Guided Lessons flow by preventing clicking outside of the next action | 7,444 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InAppTutorial/InAppTutorialStepDisplayer.js
PR Title: Improve Guided Lessons flow by preventing clicking outside of the next action
BEFORE CODE: progress={progress}
goToNextStep={goToNextStep}
buttonLabel=... | Could you bring the comment above next to the `false`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const getAuthenticatedPlayerForPreview = React.useCallback(
async (): Promise<?AuthenticatedPlayer> => {
if (
!profile ||
!game ||
!preferencesValues.fetchPlayerTokenForPreviewAutomatically
) {
return null;
}
const playerTokenForPreview = playerTokensForPre... | If the promise rejects, the caller will get an exception instead of null | const getAuthenticatedPlayerForPreview = React.useCallback(
async (): Promise<?AuthenticatedPlayer> => {
if (
!profile ||
!game ||
!preferencesValues.fetchPlayerTokenForPreviewAutomatically
) {
return null;
}
const playerTokenForPreview = playerTokensForPre... | @@ -4,71 +4,83 @@ import AuthenticatedUserContext from '../Profile/AuthenticatedUserContext';
import { getPlayerToken } from '../Utils/GDevelopServices/Play';
import PreferencesContext from './Preferences/PreferencesContext';
import { retryIfFailed } from '../Utils/RetryIfFailed';
-
-const gd: libGDevelop = global.g... | newIDE/app/src/MainFrame/UseAuthenticatedPlayer.js | 26 | JavaScript | 0.429 | suggestion | 72 | 51 | 51 | false | Update player token logic to be fetched on project opening | 7,460 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/UseAuthenticatedPlayer.js
PR Title: Update player token logic to be fetched on project opening
BEFORE CODE: const getAuthenticatedPlayerForPreview = React.useCallback(
async (): Promise<?AuthenticatedPlayer> => {
if (
... | If the promise rejects, the caller will get an exception instead of null | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return 0;
}
const tracks = this._rendererObject.state.tracks;
if (tracks.length === 0) {
return 0;
}
// This should be fine because only 1 track is used.
const track = tracks[0];
// @ts-ignore TrackEntry.getAnimationTime is not exposed.
return track.getAni... | why is this check needed in a spine runtime renderer? | return 0;
}
const tracks = this._rendererObject.state.tracks;
if (tracks.length === 0) {
return 0;
}
// This should be fine because only 1 track is used.
const track = tracks[0];
// @ts-ignore TrackEntry.getAnimationTime is not exposed.
return track.getAni... | @@ -193,7 +193,14 @@ namespace gdjs {
}
isAnimationComplete(): boolean {
- return this._isAnimationComplete;
+ if (!isSpine(this._rendererObject)) { | Extensions/Spine/spineruntimeobject-pixi-renderer.ts | 26 | TypeScript | 0.214 | question | 53 | 51 | 51 | false | [Spine] Fix "Animation finished" condition | 7,464 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | D8H | Review this pull request change.
Language: TypeScript
File: Extensions/Spine/spineruntimeobject-pixi-renderer.ts
PR Title: [Spine] Fix "Animation finished" condition
BEFORE CODE: return 0;
}
const tracks = this._rendererObject.state.tracks;
if (tracks.length === 0) {
return 0;
... | why is this check needed in a spine runtime renderer? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
gameId.current
? `/app-embedded/${gamesPlatformEmbeddedVersion}/games/${gameId.current}`
: isMobile
? // On mobile, go directly to a random game if none is specified.
`/app-embedded/${gamesPlatformEmbeddedVersion}/games/random`
: // On desktop, access the homepage.
`/app-embe... | I would probably add a check on `!loaded` too.
The iframe may be here without gd.games being loaded yet, or not loaded at all .
This component and the iframe is always in the DOM, but the `src` changes when a user arrives on the Play section, and the `loaded` becomes true when gd.games tells the editor it's ready. | ? // On mobile, go directly to a random game if none is specified.
`/app-embedded/${gamesPlatformEmbeddedVersion}/games/random`
: // On desktop, access the homepage.
`/app-embedded/${gamesPlatformEmbeddedVersion}/${paletteType}`,
gdGamesHost
);
if (gameId.current || isMobile) url.sea... | @@ -68,6 +71,20 @@ const GamesPlatformFrame = ({ initialGameId, loaded, visible }: Props) => {
[loaded, initialGameId]
);
+ React.useEffect(
+ () => {
+ if (!iframeRef.current) return; | newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrame.js | 26 | JavaScript | 0.643 | suggestion | 317 | 51 | 51 | false | Send message to gd.games iframe when keyboard opens | 7,472 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrame.js
PR Title: Send message to gd.games iframe when keyboard opens
BEFORE CODE: gameId.current
? `/app-embedded/${gamesPlatformEmbeddedVersion}/games/${gameId.current... | I would probably add a check on `!loaded` too.
The iframe may be here without gd.games being loaded yet, or not loaded at all .
This component and the iframe is always in the DOM, but the `src` changes when a user arrives on the Play section, and the `loaded` becomes true when gd.games tells the editor it's ready. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
? // On mobile, go directly to a random game if none is specified.
`/app-embedded/${gamesPlatformEmbeddedVersion}/games/random`
: // On desktop, access the homepage.
`/app-embedded/${gamesPlatformEmbeddedVersion}/${paletteType}`,
gdGamesHost
);
if (gameId.current || isMobile) url.sea... | ```suggestion
type: 'setKeyboardOffset',
```
? I think we prefer verbs like a function would be called | `/app-embedded/${gamesPlatformEmbeddedVersion}/${paletteType}`,
gdGamesHost
);
if (gameId.current || isMobile) url.searchParams.set('theme', paletteType);
const src = loaded ? url.toString() : '';
React.useEffect(
() => {
if (!loaded && initialGameId) {
// Every time the frame is... | @@ -68,6 +71,20 @@ const GamesPlatformFrame = ({ initialGameId, loaded, visible }: Props) => {
[loaded, initialGameId]
);
+ React.useEffect(
+ () => {
+ if (!iframeRef.current) return;
+ iframeRef.current.contentWindow.postMessage(
+ {
+ type: 'keyboardOffset', | newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrame.js | 26 | JavaScript | 0.929 | suggestion | 117 | 51 | 51 | false | Send message to gd.games iframe when keyboard opens | 7,472 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrame.js
PR Title: Send message to gd.games iframe when keyboard opens
BEFORE CODE: ? // On mobile, go directly to a random game if none is specified.
`/app-embedded/... | ```suggestion
type: 'setKeyboardOffset',
```
? I think we prefer verbs like a function would be called | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const url = new URL(
gameId.current
? `/app-embedded/${gamesPlatformEmbeddedVersion}/games/${gameId.current}`
: isMobile
? // On mobile, go directly to a random game if none is specified.
`/app-embedded/${gamesPlatformEmbeddedVersion}/games/random`
: // On desktop, access the home... | as discussed, this should probably be moved to the top component `GamesPlatformFrameContext` to do a logic similar to `sendUserCustomTokenToFrame()` | ? `/app-embedded/${gamesPlatformEmbeddedVersion}/games/${gameId.current}`
: isMobile
? // On mobile, go directly to a random game if none is specified.
`/app-embedded/${gamesPlatformEmbeddedVersion}/games/random`
: // On desktop, access the homepage.
`/app-embedded/${gamesPlatfor... | @@ -68,6 +71,24 @@ const GamesPlatformFrame = ({ initialGameId, loaded, visible }: Props) => {
[loaded, initialGameId]
);
+ React.useEffect( | newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrame.js | 26 | JavaScript | 0.571 | suggestion | 148 | 51 | 51 | false | Send message to gd.games iframe when keyboard opens | 7,472 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/EditorContainers/HomePage/PlaySection/GamesPlatformFrame.js
PR Title: Send message to gd.games iframe when keyboard opens
BEFORE CODE:
const url = new URL(
gameId.current
? `/app-embedded/${gamesPlatformEmbeddedVersion... | as discussed, this should probably be moved to the top component `GamesPlatformFrameContext` to do a logic similar to `sendUserCustomTokenToFrame()` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
React.useEffect(
() => {
const timeoutId = setTimeout(() => {
setTooltipStyle(currentStyle => ({
...currentStyle,
transition: 'transform 150ms ease-in-out',
}));
}, 100);
return () => clearTimeout(timeoutId);
},
// Apply transition after fi... | just to be safe, we should probably check the length of the array resulting the split to ensure there are at least 2 elements.
Maybe, this should be in a React.useMemo() to make that logic easier to ready with `if`s ? | }, 50);
}
},
[isTouchscreen, tooltipData]
);
React.useEffect(
() => {
return () => {
if (tooltipTimeoutId.current) {
clearTimeout(tooltipTimeoutId.current);
}
};
},
// Clear timeout if necessary when unmounting.
[]
);
... | @@ -27,24 +55,148 @@ const styles = {
width: 34,
height: 34,
},
+ paper: {
+ padding: '8px 10px',
+ minWidth: 180,
+ },
+ tabIcon: {
+ marginLeft: 4,
+ marginRight: 4,
+ display: 'flex',
+ },
+ emptyTabIcon: {
+ marginLeft: 4,
+ marginRight: 4,
+ height: 20,
+ ... | newIDE/app/src/MainFrame/TabsTitlebar.js | 26 | JavaScript | 0.643 | question | 218 | 51 | 51 | false | Add tooltip for tabs | 7,482 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/TabsTitlebar.js
PR Title: Add tooltip for tabs
BEFORE CODE:
React.useEffect(
() => {
const timeoutId = setTimeout(() => {
setTooltipStyle(currentStyle => ({
...currentStyle,
transition... | just to be safe, we should probably check the length of the array resulting the split to ensure there are at least 2 elements.
Maybe, this should be in a React.useMemo() to make that logic easier to ready with `if`s ? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
menuIcon: {
marginLeft: 4,
marginRight: 4,
// Make the icon slightly bigger to be centered on the row, so it aligns
// with the project manager icon.
width: 34,
height: 34,
},
paper: {
padding: '8px 10px',
minWidth: 180,
},
tabIcon: {
marginLeft: 4,
margin... | should that timeout be cleared when the component unmounts? (it shouldn't unmount technically, but...) | }: TabsTitlebarProps) {
const isTouchscreen = useScreenType() === 'touch';
const gdevelopTheme = React.useContext(GDevelopThemeContext);
const backgroundColor = gdevelopTheme.titlebar.backgroundColor;
const [tooltipData, setTooltipData] = React.useState<?{|
element: HTMLElement,
editorTab: EditorT... | @@ -53,6 +205,39 @@ export default function TabsTitlebar({
[backgroundColor]
);
+ const onHoverEditorTab = React.useCallback(
+ (editorTab: ?EditorTab) => {
+ if (isTouchscreen) {
+ setTooltipData(null);
+ return;
+ }
+
+ if (tooltipTimeoutId.current) {
+ cle... | newIDE/app/src/MainFrame/TabsTitlebar.js | 26 | JavaScript | 0.429 | suggestion | 102 | 51 | 51 | false | Add tooltip for tabs | 7,482 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/TabsTitlebar.js
PR Title: Add tooltip for tabs
BEFORE CODE: menuIcon: {
marginLeft: 4,
marginRight: 4,
// Make the icon slightly bigger to be centered on the row, so it aligns
// with the project manager icon.... | should that timeout be cleared when the component unmounts? (it shouldn't unmount technically, but...) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
...state,
currentFileMetadata: fileMetadata,
}));
},
ensureResourcesAreMoved,
onGameRegistered: gamesList.fetchGames,
});
const {
onSelectExampleShortHeader,
onSelectPrivateGameTemplateListingData,
renderNewProjectDialog,
fetchAndOpenNewProjectSetupDialogForExample... | ```suggestion
const gamesPlatformFrameTools = useGamesPlatformFrame({
``` | ...state,
currentFileMetadata: fileMetadata,
}));
},
ensureResourcesAreMoved,
onGameRegistered: gamesList.fetchGames,
});
const {
onSelectExampleShortHeader,
onSelectPrivateGameTemplateListingData,
renderNewProjectDialog,
fetchAndOpenNewProjectSetupDialogForExample... | @@ -1235,6 +1233,11 @@ const MainFrame = (props: Props) => {
storageProviders: props.storageProviders,
});
+ const gamesPlatformFrameTools = UseGamesPlatformFrame({ | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.643 | suggestion | 77 | 51 | 51 | false | Fix "Manage subscription" button not working | 7,507 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/index.js
PR Title: Fix "Manage subscription" button not working
BEFORE CODE: ...state,
currentFileMetadata: fileMetadata,
}));
},
ensureResourcesAreMoved,
onGameRegistered: gamesList.fetchGames,
... | ```suggestion
const gamesPlatformFrameTools = useGamesPlatformFrame({
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import CustomDragLayer from '../UI/DragAndDrop/CustomDragLayer';
import CloudProjectRecoveryDialog from '../ProjectsStorage/CloudStorageProvider/CloudProjectRecoveryDialog';
import CloudProjectSaveChoiceDialog from '../ProjectsStorage/CloudStorageProvider/CloudProjectSaveChoiceDialog';
import CloudStorageProvider from ... | Avoid this error by preferring named exports:
```suggestion
import { useGamesPlatformFrame } from './EditorContainers/HomePage/PlaySection/UseGamesPlatformFrame';
``` | import CustomDragLayer from '../UI/DragAndDrop/CustomDragLayer';
import CloudProjectRecoveryDialog from '../ProjectsStorage/CloudStorageProvider/CloudProjectRecoveryDialog';
import CloudProjectSaveChoiceDialog from '../ProjectsStorage/CloudStorageProvider/CloudProjectSaveChoiceDialog';
import CloudStorageProvider from ... | @@ -197,8 +198,8 @@ import { type ObjectWithContext } from '../ObjectsList/EnumerateObjects';
import useGamesList from '../GameDashboard/UseGamesList';
import useCapturesManager from './UseCapturesManager';
import useHomepageWitchForRouting from './UseHomepageWitchForRouting';
-import { GamesPlatformFrameContext } f... | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.929 | suggestion | 169 | 51 | 51 | false | Fix "Manage subscription" button not working | 7,507 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/index.js
PR Title: Fix "Manage subscription" button not working
BEFORE CODE: import CustomDragLayer from '../UI/DragAndDrop/CustomDragLayer';
import CloudProjectRecoveryDialog from '../ProjectsStorage/CloudStorageProvider/CloudProj... | Avoid this error by preferring named exports:
```suggestion
import { useGamesPlatformFrame } from './EditorContainers/HomePage/PlaySection/UseGamesPlatformFrame';
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}));
},
ensureResourcesAreMoved,
onGameRegistered: gamesList.fetchGames,
});
const {
onSelectExampleShortHeader,
onSelectPrivateGameTemplateListingData,
renderNewProjectDialog,
fetchAndOpenNewProjectSetupDialogForExample,
openNewProjectDialog,
} = useNewProjectDialog({
i... | useCallback the onOpenProfileDialog, otherwise this means that `handleIframeMessage` is unstable and will be disconnected/reconnected at every single render 😱
This would probably be worth a log in the code doing the `addEventListener` so we can see the console filling with logs if we break the stability in the futu... | }));
},
ensureResourcesAreMoved,
onGameRegistered: gamesList.fetchGames,
});
const {
onSelectExampleShortHeader,
onSelectPrivateGameTemplateListingData,
renderNewProjectDialog,
fetchAndOpenNewProjectSetupDialogForExample,
openNewProjectDialog,
} = useNewProjectDialog({
i... | @@ -1235,6 +1233,11 @@ const MainFrame = (props: Props) => {
storageProviders: props.storageProviders,
});
+ const gamesPlatformFrameTools = UseGamesPlatformFrame({
+ fetchAndOpenNewProjectSetupDialogForExample,
+ onOpenProfileDialog: () => openProfileDialog(true), | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.786 | suggestion | 322 | 51 | 51 | false | Fix "Manage subscription" button not working | 7,507 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/index.js
PR Title: Fix "Manage subscription" button not working
BEFORE CODE: }));
},
ensureResourcesAreMoved,
onGameRegistered: gamesList.fetchGames,
});
const {
onSelectExampleShortHeader,
onSelectPr... | useCallback the onOpenProfileDialog, otherwise this means that `handleIframeMessage` is unstable and will be disconnected/reconnected at every single render 😱
This would probably be worth a log in the code doing the `addEventListener` so we can see the console filling with logs if we break the stability in the futu... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
!!_previewLauncher.current &&
_previewLauncher.current.canDoNetworkPreview(),
onLaunchPreview: launchNewPreview,
onHotReloadPreview: launchHotReloadPreview,
onLaunchDebugPreview: launchDebuggerAndPreview,
onLaunchNetworkPreview: launchNetworkPreview,
onLaunchPreviewWithDiagnosticReport: ... | Same, probably less harmful here but better pass a stable callback everywhere | i18n,
project: state.currentProject,
previewEnabled:
!!state.currentProject && state.currentProject.getLayoutsCount() > 0,
onOpenProjectManager: toggleProjectManager,
hasPreviewsRunning,
allowNetworkPreview:
!!_previewLauncher.current &&
_previewLauncher.current.canDoNetworkPre... | @@ -3566,7 +3563,7 @@ const MainFrame = (props: Props) => {
onOpenExternalLayout: openExternalLayout,
onOpenEventsFunctionsExtension: openEventsFunctionsExtension,
onOpenCommandPalette: openCommandPalette,
- onOpenProfile: authenticatedUser.onOpenProfileDialog,
+ onOpenProfile: () => openProfileDia... | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.286 | suggestion | 77 | 51 | 51 | false | Fix "Manage subscription" button not working | 7,507 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/index.js
PR Title: Fix "Manage subscription" button not working
BEFORE CODE: !!_previewLauncher.current &&
_previewLauncher.current.canDoNetworkPreview(),
onLaunchPreview: launchNewPreview,
onHotReloadPreview: l... | Same, probably less harmful here but better pass a stable callback everywhere | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
currentProject
);
}}
onExtensionInstalled={onExtensionInstalled}
onShareProject={() => openShareDialog()}
isOpen={projectManagerOpen}
hotReloadPreviewButtonProps={hotReloadPreviewButtonProps}
resourceManagementProps={resourceManagemen... | Let's name this:
```suggestion
onEditorTabClosing();
```
to show it's being done (while traditionnally, something that is "ed" is when the thing is finished and it's the very last thing you call) | currentProject
);
}}
onExtensionInstalled={onExtensionInstalled}
onShareProject={() => openShareDialog()}
isOpen={projectManagerOpen}
hotReloadPreviewButtonProps={hotReloadPreviewButtonProps}
resourceManagementProps={resourceManagemen... | @@ -3728,21 +3728,31 @@ const MainFrame = (props: Props) => {
<TabsTitlebar
hidden={tabsTitleBarAndEditorToolbarHidden}
toggleProjectManager={toggleProjectManager}
- renderTabs={onHoverEditorTab => (
+ renderTabs={(onEditorTabHovered, onEditorTabClosed) => (
<DraggableE... | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.786 | suggestion | 215 | 51 | 51 | false | Fix tab tooltip being stuck when closing tab + improve design | 7,513 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/index.js
PR Title: Fix tab tooltip being stuck when closing tab + improve design
BEFORE CODE: currentProject
);
}}
onExtensionInstalled={onExtensionInstalled}
onShareProject={... | Let's name this:
```suggestion
onEditorTabClosing();
```
to show it's being done (while traditionnally, something that is "ed" is when the thing is finished and it's the very last thing you call) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
CustomTooltip({
...props,
customStyle: styles.tooltipContent,
})
}
/>
</AreaChart>
</ResponsiveContainer>
);
};
export const BounceRateChart = ({
i18n,
chartData,
height,
fontSize,
}: ChartProps) => {
const gdevelopTheme = Reac... | There is usually no space for percent formatting as it's part of the value. | CustomTooltip({
...props,
customStyle: styles.tooltipContent,
})
}
/>
</AreaChart>
</ResponsiveContainer>
);
};
export const BounceRateChart = ({
i18n,
chartData,
height,
fontSize,
}: ChartProps) => {
const gdevelopTheme = Reac... | @@ -167,7 +169,7 @@ export const BounceRateChart = ({
<LineChart data={chartData.overTime} margin={chartMargins}>
<RechartsLine
name={i18n._(t`Bounce rate`)}
- unit="%"
+ unit={' %'} | newIDE/app/src/GameDashboard/GameAnalyticsCharts.js | 26 | JavaScript | 0.214 | style | 75 | 51 | 51 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsCharts.js
PR Title: Add tooltip in game analytics
BEFORE CODE: CustomTooltip({
...props,
customStyle: styles.tooltipContent,
})
}
/>
</Are... | There is usually no space for percent formatting as it's part of the value. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
onChange={(e, i, period: string) => {
setDataPeriod(period);
}}
disableUnderline
>
<SelectOption key="month" value="month" label={t`Month`} />
<SelectOption key="year" value="year" label={t`Year`} />
... | ```suggestion
Visitors are considered players when they stayed at least 60 seconds including loading screens.
``` | onChange={(e, i, period: string) => {
setDataPeriod(period);
}}
disableUnderline
>
<SelectOption key="month" value="month" label={t`Month`} />
<SelectOption key="year" value="year" label={t`Year`} />
... | @@ -142,6 +144,19 @@ export const GameAnalyticsPanel = ({
<Column noMargin alignItems="center" expand>
<Text size="block-title" align="center">
<Trans>{chartData.overview.playersCount} sessions</Trans>
+ <Tooltip
+ title={
... | newIDE/app/src/GameDashboard/GameAnalyticsPanel.js | 26 | JavaScript | 0.786 | suggestion | 143 | 51 | 51 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsPanel.js
PR Title: Add tooltip in game analytics
BEFORE CODE: onChange={(e, i, period: string) => {
setDataPeriod(period);
}}
disableUnderline
... | ```suggestion
Visitors are considered players when they stayed at least 60 seconds including loading screens.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
{recommendedMarketingPlan &&
gameFeaturings &&
fetchGameFeaturings && (
<Grid item xs={12} sm={5} md={4}>
<MarketingPlanSingleDisplay
fetchGameFeaturings={fetchGameFeaturings}
gameFeaturings={... | ```suggestion
Percentage of people who leave before 60 seconds including loading screens.
``` | </Grid>
{recommendedMarketingPlan &&
gameFeaturings &&
fetchGameFeaturings && (
<Grid item xs={12} sm={5} md={4}>
<MarketingPlanSingleDisplay
fetchGameFeaturings={fetchGameFeaturings}
... | @@ -169,6 +184,19 @@ export const GameAnalyticsPanel = ({
{Math.round(chartData.overview.bounceRatePercent)}% bounce
rate
</Trans>
+ <Tooltip
+ title={
+ <Text>
+ <T... | newIDE/app/src/GameDashboard/GameAnalyticsPanel.js | 26 | JavaScript | 0.714 | suggestion | 123 | 51 | 51 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsPanel.js
PR Title: Add tooltip in game analytics
BEFORE CODE: {recommendedMarketingPlan &&
gameFeaturings &&
fetchGameFeaturings && (
<Grid item xs={1... | ```suggestion
Percentage of people who leave before 60 seconds including loading screens.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
</Text>
<BounceRateChart
chartData={chartData}
height={chartHeight}
i18n={i18n}
/>
</Column>
</Grid>
<Grid item xs={12} sm={6}>
<Column expand noM... | I think it's obvious when reading the title and the hover tooltip:

```suggestion
``` | </Tooltip>
</Text>
<BounceRateChart
chartData={chartData}
height={chartHeight}
i18n={i18n}
/>
</Column>
</Grid>
<Grid item xs={12} sm={6}>
... | @@ -186,6 +214,17 @@ export const GameAnalyticsPanel = ({
)}{' '}
minutes per player
</Trans>
+ <Tooltip
+ title={
+ <Text>
+ <Trans>
+ Is... | newIDE/app/src/GameDashboard/GameAnalyticsPanel.js | 26 | JavaScript | 0.786 | suggestion | 179 | 51 | 51 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsPanel.js
PR Title: Add tooltip in game analytics
BEFORE CODE: </Text>
<BounceRateChart
chartData={chartData}
height={chartHeight}
... | I think it's obvious when reading the title and the hover tooltip:

```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
<Trans>
{
chartData.overview.greaterDurationPlayerSurface
.playersCount
}{' '}
players with more than{' '}
{
chartData.overview.greaterDur... | I think this graph is obvious. If people don't know how to read axes, I doubt an explanation will help them.
```suggestion
``` | <Column expand noMargin alignItems="center">
<Text size="block-title" align="center">
<Trans>
{
chartData.overview.greaterDurationPlayerSurface
.playersCount
}{' '}
... | @@ -209,6 +248,20 @@ export const GameAnalyticsPanel = ({
}{' '}
minutes
</Trans>
+ <Tooltip
+ title={
+ <Text>
+ <Trans>
+ Average of pla... | newIDE/app/src/GameDashboard/GameAnalyticsPanel.js | 26 | JavaScript | 0.714 | suggestion | 128 | 51 | 51 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsPanel.js
PR Title: Add tooltip in game analytics
BEFORE CODE: <Trans>
{
chartData.overview.greaterDurationPlayerSurface
.p... | I think this graph is obvious. If people don't know how to read axes, I doubt an explanation will help them.
```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
chartData.overview.nearestToMedianDuration
.playersPercent
)}
% of players with more than{' '}
{
chartData.overview.nearestToMedianDuration
.durationInMin... | This graph is obvious too. The curves have already titles when you hover.

```suggestion
``` | <Text size="block-title" align="center">
<Trans>
{Math.round(
chartData.overview.nearestToMedianDuration
.playersPercent
)}
% of players with more than{' '}
... | @@ -232,6 +285,22 @@ export const GameAnalyticsPanel = ({
}{' '}
minutes
</Trans>
+ <Tooltip
+ title={
+ <Text>
+ <Trans>
+ Shows how long... | newIDE/app/src/GameDashboard/GameAnalyticsPanel.js | 26 | JavaScript | 0.786 | suggestion | 184 | 42 | 46 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsPanel.js
PR Title: Add tooltip in game analytics
BEFORE CODE: chartData.overview.nearestToMedianDuration
.playersPercent
)}
... | This graph is obvious too. The curves have already titles when you hover.

```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}}
disableUnderline
>
<SelectOption key="month" value="month" label={t`Month`} />
<SelectOption key="year" value="year" label={t`Year`} />
</SelectField>
</Line>
<Grid container spacing={2}>
... | Tooltips must as short as possible.
```suggestion
<Trans>
Viewers are
considered players when they stayed at least 60
seconds including loading screens.
</Trans>
``` | }}
disableUnderline
>
<SelectOption key="month" value="month" label={t`Month`} />
<SelectOption key="year" value="year" label={t`Year`} />
</SelectField>
</Line>
<Grid container spacing={2}>
... | @@ -142,6 +144,19 @@ export const GameAnalyticsPanel = ({
<Column noMargin alignItems="center" expand>
<Text size="block-title" align="center">
<Trans>{chartData.overview.playersCount} sessions</Trans>
+ <Tooltip
+ title={
... | newIDE/app/src/GameDashboard/GameAnalyticsPanel.js | 26 | JavaScript | 0.857 | suggestion | 308 | 51 | 51 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsPanel.js
PR Title: Add tooltip in game analytics
BEFORE CODE: }}
disableUnderline
>
<SelectOption key="month" value="month" label={t`Month`} />
... | Tooltips must as short as possible.
```suggestion
<Trans>
Viewers are
considered players when they stayed at least 60
seconds including loading screens.
</Trans>
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
fetchGameFeaturings && (
<Grid item xs={12} sm={5} md={4}>
<MarketingPlanSingleDisplay
fetchGameFeaturings={fetchGameFeaturings}
gameFeaturings={gameFeaturings}
marketingPlan={recommendedMarketingPlan... | Stating the obvious only adds noise. People won't read it if it's 2 long sentences.
```suggestion
<Trans>
Percentage of people who leave before 60 seconds
including loading screens.
</Trans>
``` | gameFeaturings &&
fetchGameFeaturings && (
<Grid item xs={12} sm={5} md={4}>
<MarketingPlanSingleDisplay
fetchGameFeaturings={fetchGameFeaturings}
gameFeaturings={gameFeaturings}
marke... | @@ -169,6 +184,20 @@ export const GameAnalyticsPanel = ({
{Math.round(chartData.overview.bounceRatePercent)}% bounce
rate
</Trans>
+ <Tooltip
+ title={
+ <Text>
+ <T... | newIDE/app/src/GameDashboard/GameAnalyticsPanel.js | 26 | JavaScript | 0.786 | suggestion | 308 | 51 | 51 | false | Add tooltip in game analytics | 7,559 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameAnalyticsPanel.js
PR Title: Add tooltip in game analytics
BEFORE CODE: fetchGameFeaturings && (
<Grid item xs={12} sm={5} md={4}>
<MarketingPlanSingleDisplay
... | Stating the obvious only adds noise. People won't read it if it's 2 long sentences.
```suggestion
<Trans>
Percentage of people who leave before 60 seconds
including loading screens.
</Trans>
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (this.shadowCameraHelper) {
scene.add(this.shadowCameraHelper);
}
this._isEnabled = true;
return true;
}
removeEffect(target: EffectsTarget): boolean {
const scene = target.get3DRendererObject() as
| THREE.Sc... | This would risk spamming the console, let's remove it. | scene.add(this.light.target);
if (this.shadowCameraHelper) {
scene.add(this.shadowCameraHelper);
}
this._isEnabled = true;
return true;
}
removeEffect(target: EffectsTarget): boolean {
const scene = target.get3DRe... | @@ -96,6 +96,10 @@ namespace gdjs {
return true;
}
updatePreRender(target: gdjs.EffectsTarget): any {
+ if (!target.getRuntimeLayer) {
+ console.error("Unable to get directional light's layer."); | Extensions/3D/DirectionalLight.ts | 26 | TypeScript | 0.286 | suggestion | 54 | 51 | 51 | false | [DRAFT] implementation of Shadowmapping | 7,592 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: Extensions/3D/DirectionalLight.ts
PR Title: [DRAFT] implementation of Shadowmapping
BEFORE CODE: if (this.shadowCameraHelper) {
scene.add(this.shadowCameraHelper);
}
this._isEnabled = true;
ret... | This would risk spamming the console, let's remove it. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
*/
export class RuntimeScenePixiRenderer
implements gdjs.RuntimeInstanceContainerPixiRenderer
{
private _runtimeGameRenderer: gdjs.RuntimeGamePixiRenderer | null;
private _runtimeScene: gdjs.RuntimeScene;
private _pixiContainer: PIXI.Container;
private _profilerText: PIXI.Text | null = null;
... | Add back these lines as they don't contribute to the PR | */
export class RuntimeScenePixiRenderer
implements gdjs.RuntimeInstanceContainerPixiRenderer
{
private _runtimeGameRenderer: gdjs.RuntimeGamePixiRenderer | null;
private _runtimeScene: gdjs.RuntimeScene;
private _pixiContainer: PIXI.Container;
private _profilerText: PIXI.Text | null = null;
... | @@ -26,10 +26,8 @@ namespace gdjs {
this._runtimeGameRenderer = runtimeGameRenderer;
this._runtimeScene = runtimeScene;
this._pixiContainer = new PIXI.Container();
- | GDJS/Runtime/pixi-renderers/runtimescene-pixi-renderer.ts | 26 | TypeScript | 0.214 | suggestion | 55 | 51 | 51 | false | [DRAFT] implementation of Shadowmapping | 7,592 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | NeylMahfouf2608 | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/pixi-renderers/runtimescene-pixi-renderer.ts
PR Title: [DRAFT] implementation of Shadowmapping
BEFORE CODE: */
export class RuntimeScenePixiRenderer
implements gdjs.RuntimeInstanceContainerPixiRenderer
{
private _runtimeGameRend... | Add back these lines as they don't contribute to the PR | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
runtimeScene.renderAndStep(1000 / 60);
expect(object.getY()).to.be.within(
-229.5833333333333 - epsilon,
-229.5833333333333 + epsilon
);
for (let i = 0; i < 4; ++i) {
// Verify that pressing the jump key does not change anything
object.getBehavior('auto1').simulat... | ```suggestion
it('can only jump once while the jump key is held', function () {
``` | runtimeScene.renderAndStep(1000 / 60);
expect(object.getY()).to.be.within(
-229.5833333333333 - epsilon,
-229.5833333333333 + epsilon
);
for (let i = 0; i < 4; ++i) {
// Verify that pressing the jump key does not change anything
object.getBehavior('auto1').simulat... | @@ -644,6 +653,48 @@ describe('gdjs.PlatformerObjectRuntimeBehavior', function () {
expect(object.getY()).to.be(-30);
});
+ it('can jump only jump once while the jump key is held', function () { | Extensions/PlatformBehavior/tests/JumpAndFallingPlatformer.spec.js | 26 | JavaScript | 0.571 | suggestion | 89 | 51 | 51 | false | [Platformer] Forbid repeated jumps while holding the jump key | 7,648 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: Extensions/PlatformBehavior/tests/JumpAndFallingPlatformer.spec.js
PR Title: [Platformer] Forbid repeated jumps while holding the jump key
BEFORE CODE: runtimeScene.renderAndStep(1000 / 60);
expect(object.getY()).to.be.within(
-229.5833... | ```suggestion
it('can only jump once while the jump key is held', function () {
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.SetQuickCustomizationVisibility(gd::QuickCustomization::Hidden)
.SetGroup(_("Ledge"))
.SetType("Number")
.SetMeasurementUnit(gd::MeasurementUnit::GetPixel())
.SetValue(
gd::String::From(behaviorContent.GetDoubleAttribute("yGrabOffset")));
properties["XGrabTolerance"]
.Se... | ```suggestion
.SetLabel(_("Allows repeated jumps while holding the jump key (deprecated — best left unchecked)"))
``` | .SetQuickCustomizationVisibility(gd::QuickCustomization::Hidden)
.SetGroup(_("Ledge"))
.SetType("Number")
.SetMeasurementUnit(gd::MeasurementUnit::GetPixel())
.SetValue(
gd::String::From(behaviorContent.GetDoubleAttribute("yGrabOffset")));
properties["XGrabTolerance"]
.Se... | @@ -164,6 +165,15 @@ PlatformerObjectBehavior::GetProperties(
? "true"
: "false")
.SetType("Boolean");
+ properties["UseRepeatedJump"]
+ .SetLabel(_("Allow the character to jump again when the key is held (deprecated, it's "
+ "recommended to leave... | Extensions/PlatformBehavior/PlatformerObjectBehavior.cpp | 26 | C++ | 0.714 | suggestion | 125 | 51 | 51 | false | [Platformer] Forbid repeated jumps while holding the jump key | 7,648 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Extensions/PlatformBehavior/PlatformerObjectBehavior.cpp
PR Title: [Platformer] Forbid repeated jumps while holding the jump key
BEFORE CODE: .SetQuickCustomizationVisibility(gd::QuickCustomization::Hidden)
.SetGroup(_("Ledge"))
.SetType("Number... | ```suggestion
.SetLabel(_("Allows repeated jumps while holding the jump key (deprecated — best left unchecked)"))
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
this._innerArea = {
min: [0, 0, 0],
max: [0, 0, 0],
};
}
this._innerArea.min[0] = usedVariantData.areaMinX;
this._innerArea.min[1] = usedVariantData.areaMinY;
this._innerArea.min[2] = usedVariantData.areaMinZ;
this._innerArea.max[0] = u... | `_reinitializeRenderer` clear the layer rendered objects
`_initializeFromObjectData` add the new ones | if (!this._innerArea) {
this._innerArea = {
min: [0, 0, 0],
max: [0, 0, 0],
};
}
this._innerArea.min[0] = usedVariantData.areaMinX;
this._innerArea.min[1] = usedVariantData.areaMinY;
this._innerArea.min[2] = usedVariantData.areaMinZ;
... | @@ -154,8 +154,8 @@ namespace gdjs {
override reinitialize(objectData: ObjectData & CustomObjectConfiguration) {
super.reinitialize(objectData);
- this._initializeFromObjectData(objectData);
this._reinitializeRenderer();
+ this._initializeFromObjectData(objectData); | GDJS/Runtime/CustomRuntimeObject.ts | 26 | TypeScript | 0.5 | suggestion | 102 | 51 | 51 | false | Fix changing of variant not being applied at hot-reload | 7,666 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/CustomRuntimeObject.ts
PR Title: Fix changing of variant not being applied at hot-reload
BEFORE CODE: this._innerArea = {
min: [0, 0, 0],
max: [0, 0, 0],
};
}
this._innerArea.min[0] =... | `_reinitializeRenderer` clear the layer rendered objects
`_initializeFromObjectData` add the new ones | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
);
}
if (oldObjectData.variant !== newObjectData.variant) {
this._reinitializeRenderer();
this._initializeFromObjectData(newObjectData);
// The generated code calls the onCreated super implementation at the end.
this.onCreated();
}
return true;
}
... | When changing of variant the instance is like a new instance. We let the events initialize it. | animator.updateFromObjectData(
oldObjectData.animatable || [],
newObjectData.animatable || []
);
}
if (oldObjectData.variant !== newObjectData.variant) {
const width = this.getWidth();
const height = this.getHeight();
const hasInnerAreaChanged =
... | @@ -172,6 +172,13 @@ namespace gdjs {
newObjectData.animatable || []
);
}
+ if (oldObjectData.variant !== newObjectData.variant) {
+ this._reinitializeRenderer();
+ this._initializeFromObjectData(newObjectData);
+
+ // The generated code calls the onCreated super imp... | GDJS/Runtime/CustomRuntimeObject.ts | 26 | TypeScript | 0.214 | suggestion | 94 | 51 | 51 | false | Fix changing of variant not being applied at hot-reload | 7,666 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/CustomRuntimeObject.ts
PR Title: Fix changing of variant not being applied at hot-reload
BEFORE CODE: );
}
if (oldObjectData.variant !== newObjectData.variant) {
this._reinitializeRenderer();
this._initializ... | When changing of variant the instance is like a new instance. We let the events initialize it. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
);
}
} else {
if (_connectionId) {
// Already connected to a lobby.
onLobbyQuickJoinFinished(runtimeScene);
openLobbiesWindow(runtimeScene);
return;
} else {
_actionAfterJoiningLobby = 'OPEN_LOBBY_PAGE';
... | Probably better to return an empty string if lobby id is null | ) {
_quickJoinLobbyJustFailed = true;
_quickJoinLobbyFailureReason =
quickJoinLobbyResponse.status === 'full'
? 'FULL'
: 'NOT_ENOUGH_PLAYERS';
onLobbyQuickJoinFinished(runtimeScene);
if (openLobbiesPageIfFailure) {
openL... | @@ -1696,7 +1696,35 @@ namespace gdjs {
}
}
};
+
+ export const getLobbyID = (): string => {
+ return _lobbyId || "0"; | Extensions/Multiplayer/multiplayertools.ts | 26 | TypeScript | 0.429 | suggestion | 61 | 51 | 51 | false | Added action "Join a specific lobby by its ID" and expression "Current lobby ID" | 7,694 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Jurfix | Review this pull request change.
Language: TypeScript
File: Extensions/Multiplayer/multiplayertools.ts
PR Title: Added action "Join a specific lobby by its ID" and expression "Current lobby ID"
BEFORE CODE: );
}
} else {
if (_connectionId) {
// Already connected t... | Probably better to return an empty string if lobby id is null | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return JSON.parse(responseText);
} catch (error) {
throw new Error(`Error while parsing the response: ${error}`);
}
};
export namespace multiplayer {
/** Set to true in testing to avoid relying on the multiplayer extension. */
export let disableMultiplayerForTesting = false;
export... | We avoid to export this, instead the getter function is better because it can have logic inside | Authorization: `player-game-token ${playerToken}`,
};
const response = await fetch(formattedUrl, {
method,
headers,
body,
});
if (!response.ok) {
throw new Error(
`Error while fetching as a player: ${response.status} ${response.statusText}`
);
}
// Re... | @@ -107,7 +107,7 @@ namespace gdjs {
| 'NOT_ENOUGH_PLAYERS'
| 'UNKNOWN'
| null = null;
- let _lobbyId: string | null = null;
+ export let _lobbyId: string | null = null; | Extensions/Multiplayer/multiplayertools.ts | 26 | TypeScript | 0.286 | suggestion | 95 | 51 | 51 | false | Added action "Join a specific lobby by its ID" and expression "Current lobby ID" | 7,694 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Jurfix | Review this pull request change.
Language: TypeScript
File: Extensions/Multiplayer/multiplayertools.ts
PR Title: Added action "Join a specific lobby by its ID" and expression "Current lobby ID"
BEFORE CODE: return JSON.parse(responseText);
} catch (error) {
throw new Error(`Error while parsing the r... | We avoid to export this, instead the getter function is better because it can have logic inside | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
onLobbyQuickJoinFinished(runtimeScene);
if (openLobbiesPageIfFailure) {
openLobbiesWindow(runtimeScene);
}
}
};
export const getLobbyID = (): string => {
return _lobbyId || "";
};
export const authenticateAndQuickJoinWithLobbyID = async(
runtimeSce... | This looks fine, just one thing, the current quickJoin action differentiates between 'JOIN_GAME' and 'START_GAME'.
I think that if the LobbyId corresponds to a lobby that hasn't started, then the action will fail (nothing will happen).
Do you want to handle that case? | _actionAfterJoiningLobby = 'JOIN_GAME';
} else {
throw new Error(
`Lobby in wrong status: ${quickJoinLobbyResponse.status}`
);
}
} else {
if (_connectionId) {
// Already connected to a lobby.
onLobbyQuickJoin... | @@ -1696,7 +1696,35 @@ namespace gdjs {
}
}
};
+
+ export const getLobbyID = (): string => {
+ return _lobbyId || "";
+ };
+
+ export const authenticateAndQuickJoinWithLobbyID = async(
+ runtimeScene: gdjs.RuntimeScene,
+ lobbyID: string
+ ) => {
+ const playerId =... | Extensions/Multiplayer/multiplayertools.ts | 26 | TypeScript | 0.571 | bug | 270 | 51 | 51 | false | Added action "Join a specific lobby by its ID" and expression "Current lobby ID" | 7,694 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | Jurfix | Review this pull request change.
Language: TypeScript
File: Extensions/Multiplayer/multiplayertools.ts
PR Title: Added action "Join a specific lobby by its ID" and expression "Current lobby ID"
BEFORE CODE: onLobbyQuickJoinFinished(runtimeScene);
if (openLobbiesPageIfFailure) {
openLobbies... | This looks fine, just one thing, the current quickJoin action differentiates between 'JOIN_GAME' and 'START_GAME'.
I think that if the LobbyId corresponds to a lobby that hasn't started, then the action will fail (nothing will happen).
Do you want to handle that case? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
</AlertMessage>
))}
</ColumnStackLayout>
</Line>
) : null}
<PropertiesEditor
unsavedChanges={unsavedChanges}
schema={propertiesSchema}
... | ```suggestion
// Avoid to lose user changes by forcing them
``` | </AlertMessage>
))}
</ColumnStackLayout>
</Line>
) : null}
<PropertiesEditor
unsavedChanges={unsavedChanges}
schema={propertiesSchema}
... | @@ -342,12 +360,22 @@ const CustomObjectPropertiesEditor = (props: Props) => {
label={<Trans>Edit</Trans>}
leftIcon={<Edit />}
onClick={editVariant}
+ // Avoid to loss user changes by forcing them | newIDE/app/src/ObjectEditor/Editors/CustomObjectPropertiesEditor/index.js | 26 | JavaScript | 0.643 | suggestion | 93 | 51 | 51 | false | Various fixes for variants | 7,739 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ObjectEditor/Editors/CustomObjectPropertiesEditor/index.js
PR Title: Various fixes for variants
BEFORE CODE: </AlertMessage>
))}
</ColumnStackLayout>
... | ```suggestion
// Avoid to lose user changes by forcing them
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
</AlertMessage>
))}
</ColumnStackLayout>
</Line>
) : null}
<PropertiesEditor
unsavedChanges={unsavedChanges}
schema={propertiesSchema}
... | ```suggestion
// Avoid to lose user changes by forcing them
``` | </AlertMessage>
))}
</ColumnStackLayout>
</Line>
) : null}
<PropertiesEditor
unsavedChanges={unsavedChanges}
schema={propertiesSchema}
... | @@ -342,12 +360,22 @@ const CustomObjectPropertiesEditor = (props: Props) => {
label={<Trans>Edit</Trans>}
leftIcon={<Edit />}
onClick={editVariant}
+ // Avoid to loose user changes by forcing them | newIDE/app/src/ObjectEditor/Editors/CustomObjectPropertiesEditor/index.js | 26 | JavaScript | 0.643 | suggestion | 93 | 51 | 51 | false | Various fixes for variants | 7,739 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ObjectEditor/Editors/CustomObjectPropertiesEditor/index.js
PR Title: Various fixes for variants
BEFORE CODE: </AlertMessage>
))}
</ColumnStackLayout>
... | ```suggestion
// Avoid to lose user changes by forcing them
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
gd::ExpressionCodeGenerator::GenerateExpressionCode(
codeGenerator, context, "string",
instruction.GetParameter(0).GetPlainString());
gd::String operatorString = instruction.GetParameter(1).GetPlainString();
gd::String operandCode =
gd::Expressio... | The opening parenthesis was in the `leftOperand` parameter. While it was working, it's now easier to follow. |
return "\"\" + eventsFunctionContext.getArgument(" + parameterNameCode +
")";
});
GetAllConditions()["CompareArgumentAsNumber"]
.SetCustomCodeGenerator([](gd::Instruction &instruction,
gd::EventsCodeGenerator &codeGenerator,
... | @@ -210,12 +220,13 @@ AdvancedExtension::AdvancedExtension() {
codeGenerator.GenerateUpperScopeBooleanFullName("isConditionTrue", context);
return resultingBoolean + " = " +
- gd::String(instruction.IsInverted() ? "!" : "") +
+ gd::String(instruction.IsInverted() ? "!... | GDJS/GDJS/Extensions/Builtin/AdvancedExtension.cpp | 26 | C++ | 0.5 | suggestion | 108 | 51 | 51 | false | Optimize event-function calls | 7,758 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: C++
File: GDJS/GDJS/Extensions/Builtin/AdvancedExtension.cpp
PR Title: Optimize event-function calls
BEFORE CODE: gd::ExpressionCodeGenerator::GenerateExpressionCode(
codeGenerator, context, "string",
instruction.GetParameter(0).... | The opening parenthesis was in the `leftOperand` parameter. While it was working, it's now easier to follow. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/**
* Process the specified resource.
*
* This method will only be run while loading screen is shown. It can do
* heavy tasks like parsing data.
*/
processResource(resourceName: string): Promise<void>;
/**
* Return the kind of resources handled by this manager.
*/
get... | ```suggestion
* @param resourceData The resource to clear
``` | /**
* Process the specified resource.
*
* This method will only be run while loading screen is shown. It can do
* heavy tasks like parsing data.
*/
processResource(resourceName: string): Promise<void>;
/**
* Return the kind of resources handled by this manager.
*/
get... | @@ -31,19 +31,19 @@ namespace gdjs {
getResourceKinds(): Array<ResourceKind>;
/**
- * Should clear all resources, data, loaders stored by this manager.
+ * Clear all resources, data, loaders stored by this manager.
* Using the manager after calling this method is undefined behavior.
*/
... | GDJS/Runtime/ResourceManager.ts | 26 | TypeScript | 0.571 | suggestion | 66 | 31 | 31 | false | Fix cached materials not being cleared when unloading resources | 7,780 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/ResourceManager.ts
PR Title: Fix cached materials not being cleared when unloading resources
BEFORE CODE: /**
* Process the specified resource.
*
* This method will only be run while loading screen is shown. It can do
*... | ```suggestion
* @param resourceData The resource to clear
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const serializedExtension = await eventsFunctionsExtensionOpener.readEventsFunctionExtensionFile(
pathOrUrl
);
if (project.hasEventsFunctionsExtensionNamed(serializedExtension.name)) {
const answer = await showConfirmation({
title: t`Replace existing extension`,
message: t`An ex... | ```suggestion
message: t`The extension can't be imported because it has the same name as a built-in extension.`,
``` | try {
const pathOrUrl = await eventsFunctionsExtensionOpener.chooseEventsFunctionExtensionFile();
if (!pathOrUrl) return null;
const serializedExtension = await eventsFunctionsExtensionOpener.readEventsFunctionExtensionFile(
pathOrUrl
);
if (project.hasEventsFunctionsExtensionNamed(seriali... | @@ -65,13 +69,31 @@ export const importExtension = async (
);
if (project.hasEventsFunctionsExtensionNamed(serializedExtension.name)) {
- const answer = Window.showConfirmDialog(
- i18n._(
- t`An extension with this name already exists in the project. Importing this extension will repla... | newIDE/app/src/AssetStore/ExtensionStore/InstallExtension.js | 26 | JavaScript | 0.786 | suggestion | 128 | 51 | 51 | false | Forbid to import an extension which has the same name as a built-in one | 7,822 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/AssetStore/ExtensionStore/InstallExtension.js
PR Title: Forbid to import an extension which has the same name as a built-in one
BEFORE CODE: const serializedExtension = await eventsFunctionsExtensionOpener.readEventsFunctionExtensionFile... | ```suggestion
message: t`The extension can't be imported because it has the same name as a built-in extension.`,
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
PropertyDescriptor::~PropertyDescriptor() {}
void PropertyDescriptor::SerializeTo(SerializerElement& element) const {
element.AddChild("value").SetStringValue(currentValue);
element.AddChild("type").SetStringValue(type);
if (type == "Number" && !measurementUnit.IsUndefined()) {
element.AddChild("unit").SetS... | You don't use extraInformation in the if, is it normal? |
PropertyDescriptor::~PropertyDescriptor() {}
void PropertyDescriptor::SerializeTo(SerializerElement& element) const {
element.AddChild("value").SetStringValue(currentValue);
element.AddChild("type").SetStringValue(type);
if (type == "Number" && !measurementUnit.IsUndefined()) {
element.AddChild("unit").SetS... | @@ -34,6 +34,21 @@ void PropertyDescriptor::SerializeTo(SerializerElement& element) const {
}
}
+ if (!choices.empty()
+ // Compatibility with GD <= 5.5.239
+ || !extraInformation.empty() | Core/GDCore/Project/PropertyDescriptor.cpp | 26 | C++ | 0.286 | question | 55 | 51 | 51 | false | Allow extensions to define labels for properties with string selectors | 7,825 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/Project/PropertyDescriptor.cpp
PR Title: Allow extensions to define labels for properties with string selectors
BEFORE CODE:
PropertyDescriptor::~PropertyDescriptor() {}
void PropertyDescriptor::SerializeTo(SerializerElement& element) const {
elem... | You don't use extraInformation in the if, is it normal? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import { Trans } from '@lingui/macro';
import { t } from '@lingui/macro';
import * as React from 'react';
import {
ResponsiveLineStackLayout,
LineStackLayout,
ColumnStackLayout,
} from '../UI/Layout';
import { Line } from '../UI/Grid';
import SemiControlledTextField from '../UI/SemiControlledTextField';
... | ```suggestion
export type Choice = {|
value: string,
label: string,
|};
``` | // @flow
import { Trans } from '@lingui/macro';
import { t } from '@lingui/macro';
import * as React from 'react';
import {
ResponsiveLineStackLayout,
LineStackLayout,
ColumnStackLayout,
} from '../UI/Layout';
import { Line } from '../UI/Grid';
import SemiControlledTextField from '../UI/SemiControlledTextField';
... | @@ -0,0 +1,99 @@
+// @flow
+import { Trans } from '@lingui/macro';
+import { t } from '@lingui/macro';
+import * as React from 'react';
+import {
+ ResponsiveLineStackLayout,
+ LineStackLayout,
+ ColumnStackLayout,
+} from '../UI/Layout';
+import { Line } from '../UI/Grid';
+import SemiControlledTextField from '../U... | newIDE/app/src/ChoicesEditor/index.js | 17 | JavaScript | 0.714 | suggestion | 81 | 42 | 42 | false | Allow extensions to define labels for properties with string selectors | 7,825 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ChoicesEditor/index.js
PR Title: Allow extensions to define labels for properties with string selectors
BEFORE CODE: // @flow
import { Trans } from '@lingui/macro';
import { t } from '@lingui/macro';
import * as React from 'react';
import {
... | ```suggestion
export type Choice = {|
value: string,
label: string,
|};
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import * as React from 'react';
import { type I18n as I18nType } from '@lingui/core';
import { type FiltersState, useFilters } from '../../UI/Search/FiltersChooser';
import {
getBehaviorsRegistry,
type BehaviorsRegistry,
type BehaviorShortHeader,
} from '../../Utils/GDevelopServices/Extension';
import { ... | Should that be:
```suggestion
const excludedExperimentalTiers = new Set(['community', 'experimental']);
``` | // @flow
import * as React from 'react';
import { type I18n as I18nType } from '@lingui/core';
import { type FiltersState, useFilters } from '../../UI/Search/FiltersChooser';
import {
getBehaviorsRegistry,
type BehaviorsRegistry,
type BehaviorShortHeader,
} from '../../Utils/GDevelopServices/Extension';
import { ... | @@ -20,7 +20,7 @@ const gd: libGDevelop = global.gd;
const emptySearchText = '';
const noExcludedTiers = new Set();
-const excludedCommunityTiers = new Set(['community']);
+const excludedExperimentalTiers = new Set(['experimental']); | newIDE/app/src/AssetStore/BehaviorStore/BehaviorStoreContext.js | 23 | JavaScript | 0.786 | suggestion | 107 | 48 | 48 | false | Rename "community" extensions as "experimental" extensions | 7,828 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/AssetStore/BehaviorStore/BehaviorStoreContext.js
PR Title: Rename "community" extensions as "experimental" extensions
BEFORE CODE: // @flow
import * as React from 'react';
import { type I18n as I18nType } from '@lingui/core';
import { type F... | Should that be:
```suggestion
const excludedExperimentalTiers = new Set(['community', 'experimental']);
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.