ronantakizawa/codereview-qwen32b
Text Generation • 33B • Updated • 64 • 2
before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
this.owner.setHeight(bottom - top);
}
if (this._leftEdgeAnchor !== HorizontalAnchor.None) {
this.owner.setX(
left + this.owner.getX() - this.owner.getDrawableX()
);
}
if (this._topEdgeAnchor !== VerticalAnchor.None) {
... | Should we had `if (this.owner.getX() === this.owner.getDrawableX())` to avoid extra computations 90% of the time at the cost of the `if`? | this.owner.setHeight(bottom - top);
}
if (this._leftEdgeAnchor !== HorizontalAnchor.None) {
this.owner.setX(
left + this.owner.getX() - this.owner.getDrawableX()
);
}
if (this._topEdgeAnchor !== VerticalAnchor.None) {
... | @@ -270,8 +270,13 @@ namespace gdjs {
this._rightEdgeAnchor !== HorizontalAnchor.None &&
this._leftEdgeAnchor !== HorizontalAnchor.None
) {
- this.owner.setWidth(right - left);
- this.owner.setX(left);
+ const width = right - left;
+ this.... | Extensions/AnchorBehavior/anchorruntimebehavior.ts | 26 | TypeScript | 0.571 | question | 137 | 51 | 51 | false | Fix anchor behavior when objects has custom origin | 6,970 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H |
}
setCustomCenter(customCenterX, customCenterY) {
this._customCenterX = customCenterX;
this._customCenterY = customCenterY;
this.invalidateHitboxes();
}
getRendererObject() {
return null;
}
getWidth() {
return this._customWidth;
}
getHeight() {
return this._customHeight;
}
... | ```suggestion
this._customHeight = height;
``` | }
setCustomCenter(customCenterX, customCenterY) {
this._customCenterX = customCenterX;
this._customCenterY = customCenterY;
this.invalidateHitboxes();
}
getRendererObject() {
return null;
}
getWidth() {
return this._customWidth;
}
getHeight() {
return this._customHeight;
}
... | @@ -62,6 +62,14 @@
return this._customHeight;
}
+ setWidth(width) {
+ this._customWidth = width;
+ }
+
+ setHeight(height) {
+ return this._customHeight = height; | GDJS/tests/tests/Extensions/testspriteruntimeobject.js | 26 | JavaScript | 0.571 | suggestion | 51 | 41 | 41 | false | Fix anchor behavior when objects has custom origin | 6,970 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H |
* sub-expression that a given node represents.
*/
static const gd::String GetType(const gd::Platform &platform,
const gd::ProjectScopedContainers &projectScopedContainers,
const gd::String &rootType,
gd::ExpressionNode& node) {
gd::Expression... | This doesn't change anything. It's just to navigate more easily without going through deprecated functions. | * sub-expression that a given node represents.
*/
static const gd::String GetType(const gd::Platform &platform,
const gd::ProjectScopedContainers &projectScopedContainers,
const gd::String &rootType,
gd::ExpressionNode& node) {
gd::Expression... | @@ -72,7 +72,7 @@ class GD_CORE_API ExpressionTypeFinder : public ExpressionParser2NodeWorker {
child(nullptr) {};
const gd::String &GetType() {
- return gd::ParameterMetadata::GetExpressionValueType(type);
+ return gd::ValueTypeMetadata::GetExpressionPrimitiveValueType(type); | Core/GDCore/IDE/Events/ExpressionTypeFinder.h | 26 | C/C++ | 0.429 | suggestion | 107 | 51 | 51 | false | Fix mouse and key parameters for event-functions | 7,052 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H |
case 'RotateCamera':
case 'ZoomCamera':
case 'FixCamera':
case 'CentreCamera':
return ['smooth-camera-movement'];
case 'ChangeTimeScale':
return ['pause-menu'];
case 'EcrireFichierExp':
case 'EcrireFichierTxt':
case 'LireFichierExp':
case 'LireFichierTxt':
case 'ReadN... | ```suggestion
return ['intermediate-toggle-states-with-variable'];
``` | case 'RotateCamera':
case 'ZoomCamera':
case 'FixCamera':
case 'CentreCamera':
return ['smooth-camera-movement'];
case 'ChangeTimeScale':
return ['pause-menu'];
case 'EcrireFichierExp':
case 'EcrireFichierTxt':
case 'LireFichierExp':
case 'LireFichierTxt':
case 'ReadN... | @@ -124,6 +126,8 @@ export const getInstructionTutorialIds = (type: string): Array<string> => {
case 'ToggleObjectVariableAsBoolean':
case 'ToggleGlobalVariableAsBoolean':
case 'ToggleSceneVariableAsBoolean':
+ case 'SetBooleanObjectVariable':
+ case 'SetBooleanVariable':
return ['iIntermedi... | newIDE/app/src/Utils/GDevelopServices/Tutorial.js | 26 | JavaScript | 0.571 | suggestion | 78 | 49 | 49 | false | Add tutorial bubbles on actions replacing deprecated ones | 7,077 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | D8H |
// @flow
export default function getObjectByName(
globalObjectsContainer: gdObjectsContainer | null,
objectsContainer?: ?gdObjectsContainer,
objectName: string
): ?gdObject {
if (objectsContainer && objectsContainer.hasObjectNamed(objectName))
return objectsContainer.getObject(objectName);
else if (
... | `ObjectsContainersList` should be used instead. You can pass a `ProjectScopedContainersAccessor` to your component. | // @flow
export default function getObjectByName(
globalObjectsContainer: gdObjectsContainer | null,
objectsContainer?: ?gdObjectsContainer,
objectName: string
): ?gdObject {
if (objectsContainer && objectsContainer.hasObjectNamed(objectName))
return objectsContainer.getObject(objectName);
else if (
... | @@ -15,3 +15,18 @@ export default function getObjectByName(
return null;
}
+
+export const hasObjectWithName = (
+ globalObjectsContainer: gdObjectsContainer | null,
+ objectsContainer?: ?gdObjectsContainer,
+ objectName: string
+): boolean => { | newIDE/app/src/Utils/GetObjectByName.js | 23 | JavaScript | 0.571 | suggestion | 115 | 33 | 18 | false | Fix instances paste from a scene to another | 7,105 | 4ian/GDevelop | 10,154 | JavaScript | D8H | AlexandreSi |
>
<QuickPublish
project={testProject.project}
gameAndBuildsManager={fakeEmptyGameAndBuildsManager}
isSavingProject={false}
isRequiredToSaveAsNewCloudProject={() =>
// Indicates that the project is already saved, there will be
// no need to sa... | I feel like this comment should be next to the props type in QuickPublish. I was not sure what it meant before reading this comment | onClose={action('onClose')}
onContinueQuickCustomization={action('onContinueQuickCustomization')}
onTryAnotherGame={action('onTryAnotherGame')}
/>
</AuthenticatedUserContext.Provider>
</Template>
);
};
export const AuthenticatedWithCloudProjectsMaximumReachedButSavedAl... | @@ -119,6 +124,39 @@ export const AuthenticatedWithTooManyCloudProjects = () => {
</Template>
);
};
+
+export const AuthenticatedWithCloudProjectsMaximumReachedButSavedAlready = () => {
+ return (
+ <Template>
+ <AuthenticatedUserContext.Provider
+ value={{
+ ...fakeAuthenticatedUserWi... | newIDE/app/src/stories/componentStories/QuickCustomization/QuickPublish.stories.js | 26 | JavaScript | 0.571 | suggestion | 131 | 51 | 51 | false | Fix issues when reworking a quick customization project | 7,109 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | 4ian |
if (!selectedItem) return;
if (selectedItem.content.isDescendantOf(item.content)) {
selectObjectFolderOrObjectWithContext(null);
}
},
[selectObjectFolderOrObjectWithContext, selectedItems]
);
// Force List component to be mounted again if project or objectsContaine... | Removing the column, you removed the margin, you should maybe remove the `noMargin` in the child Column | * does not stay selected and not visible to the user.
*/
const onCollapseItem = React.useCallback(
(item: TreeViewItem) => {
if (!selectedItems || selectedItems.length !== 1) return;
const selectedItem = selectedItems[0];
if (!selectedItem) return;
if (selectedItem.co... | @@ -1363,28 +1393,16 @@ const ObjectsList = React.forwardRef<Props, ObjectsListInterface>(
return (
<Background maxWidth>
- <Column> | newIDE/app/src/ObjectsList/index.js | 26 | JavaScript | 0.571 | suggestion | 103 | 51 | 51 | false | Replace the "add folder" button by a drop-down menu action | 7,117 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | D8H |
this._injectExternalLayout
);
this._watermark.displayAtStartup();
//Uncomment to profile the first x frames of the game.
// var x = 500;
// var startTime = Date.now();
// console.profile("Stepping for " + x + " frames")
// for(var i = 0; i < x; ++i) {
... | This check should not exist, you should stop gameLoop before disposing of the renderer. | ? firstSceneName
: // There is always at least a scene
this.getSceneAndExtensionsData()!.sceneData.name;
}
/**
* Start the game loop, to be called once assets are loaded.
*/
startGameLoop() {
this._throwIfDisposed();
try {
if (!this.hasScene()) {
... | @@ -888,6 +889,10 @@ namespace gdjs {
this._hasJustResumed = false;
this._renderer.startGameLoop((lastCallElapsedTime) => {
try {
+ if (this._isDisposed) {
+ return false;
+ } | GDJS/Runtime/runtimegame.ts | 26 | TypeScript | 0.286 | suggestion | 87 | 51 | 51 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
? !!navigator.maxTouchPoints && navigator.maxTouchPoints > 2
: false,
supportedCompressionMethods: getSupportedCompressionMethods(),
};
};
_setupGameVisibilityEvents() {
if (typeof navigator !== 'undefined' && typeof document !== 'undefined') {
document.addEv... | Remove this check, and clear the interval instead. | enableMetrics(enable: boolean): void {
this._disableMetrics = !enable;
if (enable) {
this._setupSessionMetrics();
}
}
/**
* Helper function to get information about the platform running the game.
*/
getPlatformInfo = () => {
return {
// @ts-ignore
... | @@ -989,6 +1005,10 @@ namespace gdjs {
* time.
*/
_setupSessionMetrics() {
+ if (this._isDisposed) {
+ return;
+ } | GDJS/Runtime/runtimegame.ts | 26 | TypeScript | 0.286 | refactor | 50 | 51 | 51 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
} catch (e) {
if (this._debuggerClient)
this._debuggerClient.onUncaughtException(e);
throw e;
}
});
setTimeout(() => {
this._setupSessionMetrics();
}, 4000);
} catch (e) {
if (this._debuggerClient) this._debuggerC... | What is the aim of this check? Calling the dispose method once is the responsibility of whoever created the game. | const elapsedTime = accumulatedElapsedTime;
accumulatedElapsedTime = 0;
// Manage resize events.
if (this._notifyScenesForGameResolutionResize) {
this._sceneStack.onGameResolutionResized();
this._notifyScenesForGameResolutionResize = false;
... | @@ -937,6 +942,17 @@ namespace gdjs {
}
}
+ dispose(): void {
+ if (this._isDisposed) {
+ return;
+ }
+
+ this._isDisposed = true; | GDJS/Runtime/runtimegame.ts | 26 | TypeScript | 0.357 | question | 113 | 51 | 51 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
newScene.networkId = sceneSyncData.networkId;
}
hasMadeChangeToStack = true;
// Continue to the next scene in the stack received from the host.
continue;
}
// The scene is in the stack and has the right networkId.
// Nothing to do, just contin... | Use `for...of` or `forEach` because there is no logic with `i` involved. | debugLogger.info(
`Scene at position ${i} and name ${sceneAtThisPositionInOurStack.getName()} has a different networkId ${
sceneAtThisPositionInOurStack.networkId
} than the expected ${sceneSyncData.networkId}, replacing.`
);
// The scene is in the sta... | @@ -354,5 +354,12 @@ namespace gdjs {
return hasMadeChangeToStack;
}
+
+ dispose(): void {
+ for (let i = 0; i < this._stack.length; ++i) {
+ this._stack[i].unloadScene();
+ } | GDJS/Runtime/scenestack.ts | 26 | TypeScript | 0.429 | suggestion | 72 | 31 | 51 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
logger.error('Window closing failed. See error:', error);
}
}
} else {
if (
typeof navigator !== 'undefined' &&
// @ts-ignore
navigator.app &&
// @ts-ignore
navigator.app.exitApp
) {
// @ts-ignore
n... | Call `this._threeRenderer?.dispose();`. | }
/**
* Close the game, if applicable.
*/
stopGame() {
// Try to detect the environment to use the most adapted
// way of closing the app
const remote = this.getElectronRemote();
if (remote) {
const browserWindow = remote.getCurrentWindow();
if (browserWind... | @@ -924,6 +924,14 @@ namespace gdjs {
// HTML5 games on mobile/browsers don't have a way to close their window/page.
}
+ dispose() {
+ this._pixiRenderer?.destroy(true);
+ this._pixiRenderer = null;
+ this._threeRenderer = null; | GDJS/Runtime/pixi-renderers/runtimegame-pixi-renderer.ts | 26 | TypeScript | 0.214 | suggestion | 39 | 51 | 51 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
}
}
} else {
if (
typeof navigator !== 'undefined' &&
// @ts-ignore
navigator.app &&
// @ts-ignore
navigator.app.exitApp
) {
// @ts-ignore
navigator.app.exitApp();
}
}
// HTML5 games on mobi... | Remove gameCanvas and domElementsContainer from the parent element. |
/**
* Close the game, if applicable.
*/
stopGame() {
// Try to detect the environment to use the most adapted
// way of closing the app
const remote = this.getElectronRemote();
if (remote) {
const browserWindow = remote.getCurrentWindow();
if (browserWindow) {
... | @@ -924,6 +924,14 @@ namespace gdjs {
// HTML5 games on mobile/browsers don't have a way to close their window/page.
}
+ dispose() {
+ this._pixiRenderer?.destroy(true);
+ this._pixiRenderer = null;
+ this._threeRenderer = null;
+ this._gameCanvas = null; | GDJS/Runtime/pixi-renderers/runtimegame-pixi-renderer.ts | 26 | TypeScript | 0.286 | suggestion | 67 | 51 | 51 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
/*
* GDevelop JS Platform
* Copyright 2013-2023 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
namespace gdjs {
/**
* A resource managers that download and remember downloaded content for one
* kind of resource.
*/
export interface Res... | Please, add jsdoc description. | /**
* Load the specified resource.
*
* This method will be run during the game. It should only do light tasks
* like file downloading.
*/
loadResource(resourceName: string): Promise<void>;
/**
* Process the specified resource.
*
* This method will only be run while l... | @@ -29,5 +29,7 @@ namespace gdjs {
* Return the kind of resources handled by this manager.
*/
getResourceKinds(): Array<ResourceKind>;
+
+ dispose(): void; | GDJS/Runtime/ResourceManager.ts | 26 | TypeScript | 0.071 | suggestion | 30 | 36 | 29 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
xhr.send();
}
/**
* Check if the given json resource was loaded (preloaded or loaded with `loadJson`).
* @param resourceName The name of the json resource.
* @returns true if the content of the json resource is loaded. false otherwise.
*/
isJsonLoaded(resourceName: string): boolea... | Do not forget to call the function. | xhr.send();
}
/**
* Check if the given json resource was loaded (preloaded or loaded with `loadJson`).
* @param resourceName The name of the json resource.
* @returns true if the content of the json resource is loaded. false otherwise.
*/
isJsonLoaded(resourceName: string): boolea... | @@ -200,5 +200,10 @@ namespace gdjs {
getLoadedJson(resourceName: string): Object | null {
return this._loadedJsons.getFromName(resourceName) || null;
}
+
+ dispose(): void {
+ this._loadedJsons.clear();
+ this._callbacks.clear | GDJS/Runtime/jsonmanager.ts | 26 | TypeScript | 0.071 | suggestion | 35 | 30 | 34 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
'include'
: // For other resources, use "same-origin" as done by default by fetch.
'same-origin',
}
);
const fontData = await response.text();
this._loadedFontsData.set(resource, fontData);
} catch (error) {
logger.error(
... | Might be: `this._pixiBitmapFontsToUninstall.length = 0;` | 'include'
: // For other resources, use "same-origin" as done by default by fetch.
'same-origin',
}
);
const fontData = await response.text();
this._loadedFontsData.set(resource, fontData);
} catch (error) {
logger.error(
... | @@ -289,6 +289,18 @@ namespace gdjs {
);
}
}
+
+ dispose(): void {
+ for (const bitmapFontInstallKey in this._pixiBitmapFontsInUse) {
+ PIXI.BitmapFont.uninstall(bitmapFontInstallKey);
+ }
+ for (const bitmapFontInstallKey of this._pixiBitmapFontsToUninstall) {
+ ... | GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts | 26 | TypeScript | 0.357 | suggestion | 56 | 35 | 41 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
this._loadedTextures.clear();
const threeTextures: THREE.Texture[] = [];
this._loadedThreeTextures.values(threeTextures);
this._loadedThreeTextures.clear();
for (const threeTexture of threeTextures) {
threeTexture.dispose();
}
const threeMaterials: THREE.Material[] = ... | Will this work?
```
for (const pixiTexture of this._diskTextures.values()) {
if (pixiTexture.destroyed) {
continue;
}
pixiTexture.destroy();
}
this._diskTextures.clear();
```
Minus new array creation. | * To be called when the game is disposed.
* Clear caches of loaded textures and materials.
*/
dispose(): void {
this._loadedTextures.clear();
const threeTextures: THREE.Texture[] = [];
this._loadedThreeTextures.values(threeTextures);
this._loadedThreeTextures.clear();
f... | @@ -463,6 +463,54 @@ namespace gdjs {
}
return particleTexture;
}
+
+ dispose(): void {
+ this._loadedTextures.clear();
+
+ const threeTextures: THREE.Texture[] = [];
+ this._loadedThreeTextures.values(threeTextures);
+ this._loadedThreeTextures.clear();
+ for (const three... | GDJS/Runtime/pixi-renderers/pixi-image-manager.ts | 26 | TypeScript | 0.786 | suggestion | 262 | 51 | 51 | false | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | malec-palec | danvervlad |
/**
* @brief Return the scene variables of the current scene or the current
* extension. It allows legacy "scenevar" parameters to accept extension
* variables.
*/
const gd::VariablesContainer &GetLegacySceneVariables() const {
return legacySceneVariables;
};
const gd::PropertiesContainersList ... | These are not references/pointers but values, meaning that ProjectScopedContainers moved from "I'm just a set of lists pointing to things in your project" to "I actually hold stuff, and you will have a bad time if you destroyed me and kept references to things". | /**
* @brief Return the scene variables of the current scene or the current
* extension. It allows legacy "scenevar" parameters to accept extension
* variables.
*/
const gd::VariablesContainer *GetLegacySceneVariables() const {
return legacySceneVariables;
};
const gd::PropertiesContainersList ... | @@ -236,6 +230,8 @@ class ProjectScopedContainers {
private:
gd::ObjectsContainersList objectsContainersList;
gd::VariablesContainersList variablesContainersList;
+ gd::VariablesContainer legacyGlobalVariables;
+ gd::VariablesContainer legacySceneVariables; | Core/GDCore/Project/ProjectScopedContainers.h | 26 | C/C++ | 0.5 | suggestion | 262 | 31 | 31 | false | Allow legacy scene variable parameters to use extension variables | 7,121 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H |
auto &initialInstances = eventsBasedObject.GetInitialInstances();
initialInstances.InsertNewInitialInstance().SetLayer("My layer");
initialInstances.InsertNewInitialInstance().SetLayer("My layer");
initialInstances.InsertNewInitialInstance().SetLayer("My layer");
initialInstances.InsertNewInitialIn... | The previous description better fit what the test actually covers. |
auto &initialInstances = eventsBasedObject.GetInitialInstances();
initialInstances.InsertNewInitialInstance().SetLayer("My layer");
initialInstances.InsertNewInitialInstance().SetLayer("My layer");
initialInstances.InsertNewInitialInstance().SetLayer("My layer");
initialInstances.InsertNewInitialIn... | @@ -4452,13 +4452,13 @@ TEST_CASE("MergeLayers", "[common]") {
REQUIRE(initialInstances.GetLayerInstancesCount("My other layer") == 1);
}
- SECTION("Can rename a leaderboard in scene events") {
+ SECTION("Can find and rename leaderboards in a project") { | Core/tests/WholeProjectRefactorer.cpp | 26 | C++ | 0.286 | suggestion | 66 | 51 | 51 | false | Fix leaderboards not properly replaced in projects using them in custom objects | 7,131 | 4ian/GDevelop | 10,154 | JavaScript | D8H | 4ian |
}
onInstructionTypeChanged={onInstructionTypeChanged}
/>
{editorOpen && project && !objectGroup && (
<ObjectVariablesDialog
project={project}
projectScopedContainersAccessor={projectScopedContainersAccessor}
objectName={objectName}
... | Sounds suspicious as not used then? | }
onInstructionTypeChanged={onInstructionTypeChanged}
/>
{editorOpen &&
project &&
!!variablesContainers.length &&
!objectGroup && (
<ObjectVariablesDialog
project={project}
projectScopedContainersAccessor={project... | @@ -188,37 +188,43 @@ export default React.forwardRef<ParameterFieldProps, ParameterFieldInterface>(
}
onInstructionTypeChanged={onInstructionTypeChanged}
/>
- {editorOpen && project && !objectGroup && (
- <ObjectVariablesDialog
- project={project}
- ... | newIDE/app/src/EventsSheet/ParameterFields/ObjectVariableField.js | 26 | JavaScript | 0.143 | question | 35 | 43 | 49 | false | Prevent opening variables dialog for objects & groups if there is no object | 7,132 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau |
// We could pass it a string, but lets do it right
this.removeJoint(parseInt(jId, 10));
}
}
}
}
// Remove the joint
this.world.DestroyJoint(joint);
delete this.joints[jointId];
}
}
}
gdjs.registerRuntimeSc... | In the future, a `destroy()` method on the shared data would be I think safer (in the sense: it's part of the class, so there is less chance you forget to update it when needed) and we we should probably made the "shared data" something first class that is handled by the runtime scene (rather than something that is man... | if (
this.joints[jId].GetType() === Box2D.e_gearJoint &&
(Box2D.getPointer(
(this.joints[jId] as Box2D.b2GearJoint).GetJoint1()
) === Box2D.getPointer(joint) ||
Box2D.getPointer(
(this.joints[jId] as Bo... | @@ -300,14 +309,11 @@ namespace gdjs {
}
}
gdjs.registerRuntimeSceneUnloadedCallback(function (runtimeScene) {
- if (
- // @ts-ignore
- runtimeScene.physics2SharedData &&
- // @ts-ignore
- runtimeScene.physics2SharedData.world
- ) {
- // @ts-ignore
- Box2D.destroy(runtimeS... | Extensions/Physics2Behavior/physics2runtimebehavior.ts | 26 | TypeScript | 0.786 | suggestion | 360 | 51 | 51 | false | [Physics2] Fix a memory leak on object instances | 7,136 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H |
// we need to relay the ownership change to others,
// and expect an acknowledgment from them.
if (gdjs.multiplayer.isCurrentPlayerHost()) {
const connectedPeerIds = gdjs.multiplayerPeerJsHelper.getAllPeers();
// We don't need to send the message to the player who s... | So this was sending too many messages! | // we need to relay the ownership change to others,
// and expect an acknowledgment from them.
if (gdjs.multiplayer.isCurrentPlayerHost()) {
const connectedPeerIds = gdjs.multiplayerPeerJsHelper.getAllPeers();
// We don't need to send the message to the player who s... | @@ -917,12 +917,12 @@ namespace gdjs {
// As we are the host, we do not cancel the message if it times out.
shouldCancelMessageIfTimesOut: false,
});
- for (const peerId of otherPeerIds) {
- debugLogger.info(
- `Relaying ownership change ... | Extensions/Multiplayer/messageManager.ts | 26 | TypeScript | 0.071 | suggestion | 38 | 51 | 51 | false | Fix destroying an object even if flagged as "DoNothing" in the multiplayer behavior | 7,137 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau |
} catch (error) {
console.error('Error while login:', error);
throw error;
}
}
async loginOrSignupWithProvider({
provider,
signal,
}: {|
provider: IdentityProvider,
signal?: AbortSignal,
|}) {
if (signal && signal.aborted) {
return Promise.reject(
new UserC... | this seemed duplicated in this file and the browser one.
This was always causing an error in the console because the signal always aborts (we trigger it when we close the dialog)
I don't think this deserves to raise an error as it's the expected path? | } catch (error) {
console.error('Error while login:', error);
throw error;
}
}
async loginOrSignupWithProvider({
provider,
signal,
}: {|
provider: IdentityProvider,
signal?: AbortSignal,
|}) {
if (signal && signal.aborted) {
return Promise.reject(
new UserC... | @@ -61,11 +61,6 @@ class LocalLoginProvider implements LoginProvider, FirebaseBasedLoginProvider {
if (signal) {
signal.addEventListener('abort', () => {
terminateWebSocket();
- reject( | newIDE/app/src/LoginProvider/LocalLoginProvider.js | 26 | JavaScript | 0.643 | refactor | 253 | 51 | 51 | false | Fix infinite loading when canceling login with provider | 7,138 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ClementPasteau |
},
});
}
}
this.setState({
createAccountInProgress: false,
loginInProgress: false,
authenticatedUser: {
...this.state.authenticatedUser,
creatingOrLoggingInAccount: false,
},
});
this._automaticallyUpdateUserProfile = true;
};
_cancelL... | I don't like doing this here. It looks like we're trying to "finish a process". But the process is already there:
<img width="776" alt="image" src="https://github.com/user-attachments/assets/6fe5b8b4-8d4c-4124-b83a-34f6d90bbd83">
There is already a catch (ensuring that an exception will never stop the end to run)... | },
});
}
}
this.setState({
createAccountInProgress: false,
loginInProgress: false,
authenticatedUser: {
...this.state.authenticatedUser,
creatingOrLoggingInAccount: false,
},
});
this._automaticallyUpdateUserProfile = true;
};
_cancelL... | @@ -996,11 +996,19 @@ export default class AuthenticatedUserProvider extends React.Component<
this._automaticallyUpdateUserProfile = true;
};
- _cancelLogin = () => {
+ _cancelLoginOrSignUp = () => {
if (this._abortController) {
this._abortController.abort();
this._abortController = null;... | newIDE/app/src/Profile/AuthenticatedUserProvider.js | 26 | JavaScript | 0.643 | suggestion | 369 | 51 | 51 | false | Fix infinite loading when canceling login with provider | 7,138 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau |
Props,
State
> {
state = {
eventsFunction: null,
extensionName: '',
createNewExtension: false,
};
_projectScopedContainersAccessor: ProjectScopedContainersAccessor | null = null;
componentDidMount() {
const {
project,
scope,
globalObjectsContainer,
objectsContainer,
... | This is kind of regression as it will forbid to use the same name as global variables and global objects for a parameter.
We should probably use a new blank project instead. | Props,
State
> {
state = {
eventsFunction: null,
extensionName: '',
createNewExtension: false,
};
_projectScopedContainersAccessor: ProjectScopedContainersAccessor | null = null;
componentDidMount() {
const {
project,
scope,
globalObjectsContainer,
objectsContainer,
... | @@ -65,6 +67,12 @@ export default class EventsFunctionExtractorDialog extends React.Component<
serializedEvents,
} = this.props;
+ // This is only used to check parameter for name conflict.
+ // TODO Update it according to the chosen extension.
+ this._projectScopedContainersAccessor = new Projec... | newIDE/app/src/EventsSheet/EventsFunctionExtractor/EventsFunctionExtractorDialog.js | 26 | JavaScript | 0.429 | suggestion | 174 | 51 | 51 | false | Reduce the risk of name collisions between objects, variables, parameters and properties | 7,148 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H |
preferences.values.openDiagnosticReportAutomatically,
onLaunchPreviewWithDiagnosticReport,
previewState.overridenPreviewLayoutName,
previewState.overridenPreviewExternalLayoutName,
previewState.isPreviewOverriden,
previewState.previewExternalLayoutName,
previewSta... | wondering if we should also take a screenshot only if:
- you don't have a thumbnailUrl already set (but the screenshots might be useful)
- you haven't taken a screenshot recently (to avoid taking one on every preview) - like every x minutes ? | previewState.overridenPreviewLayoutName,
previewState.overridenPreviewExternalLayoutName,
previewState.isPreviewOverriden,
previewState.previewExternalLayoutName,
previewState.previewLayoutName,
setPreviewOverride,
]
);
// Create a separate function to avoi... | @@ -185,7 +187,11 @@ const PreviewAndShareButtons = React.memo<PreviewAndShareButtonsProps>(
<LineStackLayout noMargin>
<FlatButtonWithSplitMenu
primary
- onClick={onHotReloadPreview}
+ onClick={
+ !hasPreviewsRunning && preferences.values.takeScreenshotOnPreview ... | newIDE/app/src/MainFrame/Toolbar/PreviewAndShareButtons.js | 26 | JavaScript | 0.5 | question | 244 | 51 | 51 | false | Take a screenshot on preview | 7,156 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | ClementPasteau |
preferences.getIsMenuBarHiddenInPreview,
preferences.getIsAlwaysOnTopInPreview,
preferences.values.openDiagnosticReportAutomatically,
currentlyRunningInAppTutorial,
getAuthenticatedPlayerForPreview,
quickCustomizationDialogOpenedFromGameId,
onCaptureFinished,
createCaptur... | Consider not adding yet-another-way-to-launch-preview and instead:
- Make the logic related to the timing inside the existing function.
- delayTimeInSeconds can also be in the function
- forcing a screenshot, bypassing the check for timing, is "just" a "forceScreenshot: true". But this is only used for quick customi... | preferences.getIsMenuBarHiddenInPreview,
preferences.getIsAlwaysOnTopInPreview,
preferences.values.openDiagnosticReportAutomatically,
currentlyRunningInAppTutorial,
getAuthenticatedPlayerForPreview,
quickCustomizationDialogOpenedFromGameId,
onCaptureFinished,
createCaptur... | @@ -1723,13 +1724,31 @@ const MainFrame = (props: Props) => {
const launchNewPreview = React.useCallback(
async options => {
const numberOfWindows = options ? options.numberOfWindows : 1;
- launchPreview({ networkPreview: false, numberOfWindows });
+ await launchPreview({ networkPreview: false,... | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.5 | suggestion | 375 | 51 | 51 | false | Take a screenshot on preview | 7,156 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau |
// (because the target is in the scope), replace or remove it:
RenameOrRemovePropertyOfTargetPropertyContainer(node.name);
}
if (node.child) node.child->Visit(*this);
});
}
void OnVisitVariableAccessorNode(VariableAccessorNode& node) override {
if (node.child) node.chi... | I don't understand why this "MatchIdentifierWithName" is not doing its job? If it's a variable, it should match it (and so do nothing), no? | }, [&]() {
// Do nothing, it's something else.
if (node.child) node.child->Visit(*this);
});
}
void OnVisitVariableAccessorNode(VariableAccessorNode& node) override {
if (node.child) node.child->Visit(*this);
}
void OnVisitVariableBracketAccessorNode(
VariableBracketAccesso... | @@ -118,17 +116,24 @@ class GD_CORE_API ExpressionPropertyReplacer
}
void OnVisitVariableBracketAccessorNode(
VariableBracketAccessorNode& node) override {
+ bool isGrandParentTypeAVariable = isParentTypeAVariable;
+ isParentTypeAVariable = false;
node.expression->Visit(*this);
+ isParentType... | Core/GDCore/IDE/Events/EventsPropertyReplacer.cpp | 26 | C++ | 0.429 | question | 139 | 51 | 51 | false | Fix variables from being renamed with a property | 7,186 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H |
for (std::size_t c = 0; c < GetCameraCount(); ++c) {
SerializerElement& cameraElement = camerasElement.AddChild("camera");
cameraElement.SetAttribute("defaultSize", GetCamera(c).UseDefaultSize());
cameraElement.SetAttribute("width", GetCamera(c).GetWidth());
cameraElement.SetAttribute("height", Ge... | to make it a bit shorter
```suggestion
SetDefaultCameraBehavior(element.GetStringAttribute("defaultCameraBehavior", "top-left-anchored-if-never-moved"));
``` | for (std::size_t c = 0; c < GetCameraCount(); ++c) {
SerializerElement& cameraElement = camerasElement.AddChild("camera");
cameraElement.SetAttribute("defaultSize", GetCamera(c).UseDefaultSize());
cameraElement.SetAttribute("width", GetCamera(c).GetWidth());
cameraElement.SetAttribute("height", Ge... | @@ -80,6 +84,7 @@ void Layer::UnserializeFrom(const SerializerElement& element) {
SetName(element.GetStringAttribute("name", "", "Name"));
SetRenderingType(element.GetStringAttribute("renderingType", ""));
SetCameraType(element.GetStringAttribute("cameraType", "perspective"));
+ SetDefaultCameraBehavior(el... | Core/GDCore/Project/Layer.cpp | 26 | C++ | 0.786 | suggestion | 164 | 51 | 51 | false | Fix anchor behavior and add option to center layer or keep top-left fixed when resized | 7,188 | 4ian/GDevelop | 10,154 | JavaScript | D8H | 4ian |
_cameraX: float;
_cameraY: float;
_cameraZ: float = 0;
/**
* `_cameraZ` is dirty when the zoom factor is set last.
*/
_isCameraZDirty: boolean = true;
/**
* @param layerData The data used to initialize the layer
* @param instanceContainer The container in which the layer is ... | Should this use `getViewportOriginX/Y` to handle the fact that custom objects don't necessarily have the top-left corner at (0 ; 0) (even if it probably doesn't matter here as it's a scene layer)? | _cameraX: float;
_cameraY: float;
_cameraZ: float = 0;
/**
* `_cameraZ` is dirty when the zoom factor is set last.
*/
_isCameraZDirty: boolean = true;
/**
* @param layerData The data used to initialize the layer
* @param instanceContainer The container in which the layer is ... | @@ -28,8 +28,25 @@ namespace gdjs {
) {
super(layerData, instanceContainer);
- this._cameraX = this.getWidth() / 2;
- this._cameraY = this.getHeight() / 2;
+ if (
+ this._defaultCameraBehavior ===
+ gdjs.RuntimeLayerDefaultCameraBehavior
+ .KEEP_TOP_LEFT_FIXED_IF_NEVE... | GDJS/Runtime/layer.ts | 26 | TypeScript | 0.714 | question | 196 | 51 | 51 | false | Fix anchor behavior and add option to center layer or keep top-left fixed when resized | 7,188 | 4ian/GDevelop | 10,154 | JavaScript | D8H | 4ian |
// Handle scale mode.
if (this._game.getScaleMode() === 'nearest') {
gameCanvas.style['image-rendering'] = '-moz-crisp-edges';
gameCanvas.style['image-rendering'] = '-webkit-optimize-contrast';
gameCanvas.style['image-rendering'] = '-webkit-crisp-edges';
gameCanvas.style['im... | There is a lot of copy from the `createStandardCanvas` function. Could you rework `createStandardCanvas` so that it's using `useCanvas` under the hood?
Also, the name is probably not showing this is an important operation enough, that just can't be redone a second time. So I think it should be called `initializeForC... |
// Prevent magnifying glass on iOS with a long press.
// Note that there are related bugs on iOS 15 (see https://bugs.webkit.org/show_bug.cgi?id=231161)
// but it seems not to affect us as the `domElementsContainer` has `pointerEvents` set to `none`.
domElementsContainer.style['-webkit-user-sel... | @@ -189,6 +189,120 @@ namespace gdjs {
gameCanvas.focus();
}
+ useCanvas(gameCanvas: HTMLCanvasElement): void { | GDJS/Runtime/pixi-renderers/runtimegame-pixi-renderer.ts | 26 | TypeScript | 0.643 | suggestion | 326 | 51 | 51 | false | Add external canvas usage to RuntimeGamePixiRenderer | 7,199 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | danvervlad |
} else {
outputObjectsContainer.InsertNewObject(
project,
parameter.GetExtraInfo(),
objectName,
outputObjectsContainer.GetObjectsCount());
}
// Memorize the last object name. By convention, parameters that require
// an object (mainly, "ob... | I wonder if the name can be confusing because a free function could have an object parameter without object type and the following behavior parameters be some capabilities (default behavior). It also won't be "all" the behaviors of the actual objects.
I guess it's kind of the required behavior for objects passed in pa... | // are all present (and no more than required by the object type).
// Non default behaviors coming from parameters will be added or removed later.
project.EnsureObjectDefaultBehaviors(outputObjectsContainer.GetObject(objectName));
} else {
// Create a new object (and its default be... | @@ -71,7 +75,7 @@ void ParameterMetadataTools::ParametersToObjectsContainer(
const gd::String& behaviorType = parameter.GetExtraInfo();
gd::Object& object = outputObjectsContainer.GetObject(lastObjectName);
- allObjectBehaviorNames[lastObjectName].insert(behaviorName);
+ allObj... | Core/GDCore/Extensions/Metadata/ParameterMetadataTools.cpp | 26 | C++ | 1 | suggestion | 510 | 51 | 51 | false | Fix default behaviors not added properly to objects in functions | 7,206 | 4ian/GDevelop | 10,154 | JavaScript | D8H | 4ian |
parameters.removeParameter('MySpriteObject2');
expect(parameters.getParametersCount()).toBe(7);
objectsContainer = new gd.ObjectsContainer(gd.ObjectsContainer.Function);
gd.ParameterMetadataTools.parametersToObjectsContainer(
project,
parameters,
objectsContainer
... | Maybe `ObjectMetadata::AddDefaultBehavior` can be used to simulate a change of capability in a custom object. |
parameters.removeParameter('MySpriteObject2');
expect(parameters.getParametersCount()).toBe(7);
objectsContainer = new gd.ObjectsContainer();
gd.ParameterMetadataTools.parametersToObjectsContainer(
project,
parameters,
objectsContainer
);
// Check that obje... | @@ -4295,19 +4295,37 @@ describe('libGD.js', function () {
expect(objectsContainer.hasObjectNamed('MyObjectWithoutType')).toBe(true);
expect(objectsContainer.hasObjectNamed('MySpriteObject')).toBe(true);
- const objectWithoutType = objectsContainer.getObject('MyObjectWithoutType');
- expect(ob... | GDevelop.js/__tests__/Core.js | 26 | JavaScript | 0.571 | suggestion | 109 | 51 | 51 | false | Fix default behaviors not added properly to objects in functions | 7,206 | 4ian/GDevelop | 10,154 | JavaScript | D8H | 4ian |
std::set<gd::String> objectNamesInContainer =
outputObjectsContainer.GetAllObjectNames();
for (const auto& objectName : objectNamesInContainer) {
if (allObjectNames.find(objectName) == allObjectNames.end()) {
outputObjectsContainer.RemoveObject(objectName);
}
}
// Remove behaviors of object... | Actually, I think it's legit to add behavior parameters to require capabilities on an object without any specified type. | }
}
// Remove objects that are not in the parameters anymore.
std::set<gd::String> objectNamesInContainer =
outputObjectsContainer.GetAllObjectNames();
for (const auto& objectName : objectNamesInContainer) {
if (allObjectNames.find(objectName) == allObjectNames.end()) {
outputObjectsContain... | @@ -108,8 +112,14 @@ void ParameterMetadataTools::ParametersToObjectsContainer(
}
auto& object = outputObjectsContainer.GetObject(objectName);
+ const auto& allBehaviorNames = allObjectNonDefaultBehaviorNames[objectName];
for (const auto& behaviorName : object.GetAllBehaviorNames()) {
- const a... | Core/GDCore/Extensions/Metadata/ParameterMetadataTools.cpp | 26 | C++ | 0.5 | suggestion | 120 | 51 | 51 | false | Fix default behaviors not added properly to objects in functions | 7,206 | 4ian/GDevelop | 10,154 | JavaScript | D8H | 4ian |
behavior->SetDefaultBehavior(true);
};
auto &objectMetadata =
gd::MetadataProvider::GetObjectMetadata(platform, objectType);
if (!MetadataProvider::IsBadObjectMetadata(objectMetadata)) {
for (auto &behaviorType : objectMetadata.GetDefaultBehaviors()) {
addDefaultBehavior(behaviorType);... | It's probably not a big issue, but instance stability won't be ensured for capabilities required for an object without any type.
Unless capabilities from parameters are not marked as default behavior? | const auto& behavior = object.GetBehavior(behaviorName);
if (!behavior.IsDefaultBehavior() || behavior.GetTypeName() != behaviorType) {
// Behavior type has changed, remove it so it is re-created.
object.RemoveBehavior(behaviorName);
}
}
if (!object.HasBehaviorNamed(b... | @@ -97,24 +95,62 @@ std::unique_ptr<gd::Object> Project::CreateObject(
" has an unknown default behavior: " + behaviorType);
return;
}
- auto* behavior = object->AddNewBehavior(
- project, behaviorType, behaviorMetadata.GetDefaultName());
- behavior->SetDefaultBehavio... | Core/GDCore/Project/Project.cpp | 26 | C++ | 0.571 | question | 201 | 51 | 51 | false | Fix default behaviors not added properly to objects in functions | 7,206 | 4ian/GDevelop | 10,154 | JavaScript | D8H | 4ian |
import { getRelativeOrAbsoluteDisplayDate } from '../Utils/DateDisplay';
const electron = optionalRequire('electron');
const path = optionalRequire('path');
export const getThumbnailWidth = ({ isMobile }: {| isMobile: boolean |}) =>
isMobile ? undefined : Math.min(245, Math.max(130, window.innerWidth / 4));
export ... | I'd rather say `Your project must be stored on your computer` rather than surely, it feels more english | import { getRelativeOrAbsoluteDisplayDate } from '../Utils/DateDisplay';
const electron = optionalRequire('electron');
const path = optionalRequire('path');
export const getThumbnailWidth = ({ isMobile }: {| isMobile: boolean |}) =>
isMobile ? undefined : Math.min(245, Math.max(130, window.innerWidth / 4));
export ... | @@ -50,13 +51,37 @@ import PreferencesContext from '../MainFrame/Preferences/PreferencesContext';
import { textEllipsisStyle } from '../UI/TextEllipsis';
import FileWithLines from '../UI/CustomSvgIcons/FileWithLines';
import TextButton from '../UI/TextButton';
-import { Tooltip } from '@material-ui/core';
+import { ... | newIDE/app/src/GameDashboard/GameDashboardCard.js | 26 | JavaScript | 0.5 | suggestion | 103 | 51 | 51 | false | Polishing the new Create tab | 7,236 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi |
export const getDetailedProjectDisplayDate = (i18n: I18nType, date: number) =>
i18n.date(date, {
dateStyle: 'short',
timeStyle: 'short',
});
const getNoProjectAlertMessage = () => {
if (!electron) {
// Trying to open a local project from the web app of the mobile app.
return t`Looks like your pro... | maybe double check landscape/mobile/etc... | export const getDetailedProjectDisplayDate = (i18n: I18nType, date: number) =>
i18n.date(date, {
dateStyle: 'short',
timeStyle: 'short',
});
const getNoProjectAlertMessage = () => {
if (!electron) {
// Trying to open a local project from the web app of the mobile app.
return t`Looks like your pro... | @@ -67,7 +92,7 @@ const styles = {
display: 'flex',
flexShrink: 0,
flexDirection: 'column',
- justifyContent: 'flex-end',
+ justifyContent: 'center', | newIDE/app/src/GameDashboard/GameDashboardCard.js | 26 | JavaScript | 0.071 | suggestion | 43 | 51 | 51 | false | Polishing the new Create tab | 7,236 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi |
newSaveAsOptions = saveAsOptions;
}
if (canFileMetadataBeSafelySavedAs && currentFileMetadata) {
const canProjectBeSafelySavedAs = await canFileMetadataBeSafelySavedAs(
currentFileMetadata,
{
showAlert,
showConfirmation,
... | just double checking this will not affect the initial project? I assume not as we're not saving that project | // ... or if the project is opened from a URL.
oldStorageProvider.internalName !== 'UrlStorageProvider',
});
if (!saveAsLocation) {
return; // Save as was cancelled.
}
newSaveAsLocation = saveAsLocation;
newSaveAsOptions = saveAsO... | @@ -2627,6 +2633,21 @@ const MainFrame = (props: Props) => {
if (!canProjectBeSafelySavedAs) return;
}
+ let originalProjectUuid = null;
+ if (newSaveAsOptions && newSaveAsOptions.generateNewProjectUuid) {
+ originalProjectUuid = currentProject.getProjectUuid();
+ c... | newIDE/app/src/MainFrame/index.js | 26 | JavaScript | 0.357 | suggestion | 109 | 51 | 51 | false | When duplicating a project, ask for the new name and if link with game should be kept | 7,253 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi |
|}) => async ({
project,
fileMetadata,
}: {|
project: gdProject,
fileMetadata: ?FileMetadata,
|}): Promise<{|
saveAsLocation: ?SaveAsLocation,
saveAsOptions: ?SaveAsOptions,
|}> => {
if (!authenticatedUser.authenticated) {
return { saveAsLocation: null, saveAsOptions: null };
}
const options = aw... | maybe name this prop `shouldAskForNewProjectUuid` to be consistent with the props you use in the component? | |}) => async ({
project,
fileMetadata,
displayOptionToGenerateNewProjectUuid,
}: {|
project: gdProject,
fileMetadata: ?FileMetadata,
displayOptionToGenerateNewProjectUuid: boolean,
|}): Promise<{|
saveAsLocation: ?SaveAsLocation,
saveAsOptions: ?SaveAsOptions,
|}> => {
if (!authenticatedUser.authentic... | @@ -189,33 +190,40 @@ export const generateOnChooseSaveProjectAsLocation = ({
fileMetadata: ?FileMetadata,
|}): Promise<{|
saveAsLocation: ?SaveAsLocation,
+ saveAsOptions: ?SaveAsOptions,
|}> => {
if (!authenticatedUser.authenticated) {
- return { saveAsLocation: null };
+ return { saveAsLocation: nu... | newIDE/app/src/ProjectsStorage/CloudStorageProvider/CloudProjectWriter.js | 26 | JavaScript | 0.571 | question | 107 | 51 | 51 | false | When duplicating a project, ask for the new name and if link with game should be kept | 7,253 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi |
return {
saveAsLocation: {
name: options.name,
},
saveAsOptions: {
generateNewProjectUuid: options.generateNewProjectUuid,
},
};
};
export const generateOnSaveProjectAs = (
authenticatedUser: AuthenticatedUser,
setDialog: (() => React.Node) => void,
closeDialog: () => void
) => as... | why this change? was this not used? | });
if (!options) return { saveAsLocation: null, saveAsOptions: null }; // Save was cancelled.
return {
saveAsLocation: {
name: options.name,
},
saveAsOptions: {
generateNewProjectUuid: options.generateNewProjectUuid,
},
};
};
export const generateOnSaveProjectAs = (
authenticat... | @@ -243,7 +251,7 @@ export const generateOnSaveProjectAs = (
}
options.onStartSaving();
- const gameId = saveAsLocation.gameId || project.getProjectUuid(); | newIDE/app/src/ProjectsStorage/CloudStorageProvider/CloudProjectWriter.js | 26 | JavaScript | 0.143 | question | 35 | 51 | 51 | false | When duplicating a project, ask for the new name and if link with game should be kept | 7,253 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi |
|}> => {
const options = await new Promise(resolve => {
setDialog(() => (
<SaveAsOptionsDialog
onCancel={() => {
closeDialog();
resolve(null);
}}
nameSuggestion={
fileMetadata ? `${project.getName()} - Copy` : project.getName()
}
mainActi... | any risk the `options.name` results in a filename that is not compatible with path? like with '/' in it? | saveAsLocation: ?SaveAsLocation, // This is the newly chosen location (or null if cancelled).
saveAsOptions: ?SaveAsOptions,
|}> => {
const options = await new Promise(resolve => {
setDialog(() => (
<SaveAsOptionsDialog
onCancel={() => {
closeDialog();
resolve(null);
... | @@ -180,16 +185,49 @@ export const onSaveProject = async (
};
};
-export const onChooseSaveProjectAsLocation = async ({
+export const generateOnChooseSaveProjectAsLocation = ({
+ setDialog,
+ closeDialog,
+}: {
+ setDialog: (() => React.Node) => void,
+ closeDialog: () => void,
+}) => async ({
project,
... | newIDE/app/src/ProjectsStorage/LocalFileStorageProvider/LocalProjectWriter.js | 26 | JavaScript | 0.5 | question | 104 | 51 | 51 | false | When duplicating a project, ask for the new name and if link with game should be kept | 7,253 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | AlexandreSi |
) : (
<Text>
<Trans>You don't have any feedback for this game.</Trans>
</Text>
)}
</>
)}
{displayedFeedbacksArray.length !== 0 && (
<ColumnStackLayout expand noMa... | I don't think that's useful, let's not do it | value={''}
label={t`All exports`}
/>
<SelectOption
key={'game-only'}
value={'game-only'}
label={t`On game page only`}
... | @@ -374,89 +419,154 @@ const GameFeedback = ({ i18n, authenticatedUser, game }: Props) => {
</ResponsiveLineStackLayout>
<ColumnStackLayout expand noMargin>
{!!feedbacks && feedbacks.length > 0 && (
+ // TODO: Should it display the data for the filtered pi... | newIDE/app/src/GameDashboard/Feedbacks/GameFeedback.js | 26 | JavaScript | 0.143 | suggestion | 44 | 51 | 51 | false | Paginate feedbacks | 7,259 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | AlexandreSi |
// - The normal keeps the same length (as the normal is included in the 2D space)
this._slopeClimbingMinNormalZ = Math.min(
Math.cos(gdjs.toRad(slopeMaxAngle)),
1 - 1 / 1024
);
}
getStairHeightMax(): float {
return this._stairHeightMax;
}
setStairHeightMax(stair... | Is there an explanation for those factors? | // - The normal keeps the same length (as the normal is included in the 2D space)
this._slopeClimbingMinNormalZ = Math.min(
Math.cos(gdjs.toRad(slopeMaxAngle)),
1 - 1 / 1024
);
}
getStairHeightMax(): float {
return this._stairHeightMax;
}
setStairHeightMax(stair... | @@ -783,6 +791,27 @@ namespace gdjs {
);
}
+ getStairHeightMax(): float {
+ return this._stairHeightMax;
+ }
+
+ setStairHeightMax(stairHeightMax: float): void {
+ const { extendedUpdateSettings } = this.getPhysics3D();
+ this._stairHeightMax = stairHeightMax;
+ console.log(st... | Extensions/Physics3DBehavior/PhysicsCharacter3DRuntimeBehavior.ts | 26 | TypeScript | 0.071 | question | 42 | 51 | 51 | false | Add a property to choose the maximum stair height a 3D character can walk | 7,265 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | D8H |
A large-scale dataset of the best human-written code reviews from top GitHub repositories.
Each row captures a moment where a human code reviewer left an inline comment on a pull request, and the author subsequently modified the code in response.
The dataset also includes negative examples — code from the same PRs that passed review without comments — to help models learn when code is acceptable.
This provides a natural signal for training models to:
| Split | Percentage | Description |
|---|---|---|
| train | 90% | Training data |
| test | 5% | Test data |
| validation | 5% | Validation data |
Splits are deterministic by repository — all examples from the same repo appear in the same split.
| Column | Type | Description |
|---|---|---|
pr_title |
string | Pull request title |
pr_number |
int | PR number |
repo_name |
string | Full repo name (owner/repo) |
repo_stars |
int | GitHub stars |
repo_language |
string | Primary repo language |
author_username |
string | PR author's GitHub username |
reviewer_username |
string | Reviewer's GitHub username |
before_code |
string | ~50 lines of code around the comment, before the fix |
reviewer_comment |
string | The inline review comment text (or "No issues found." for negatives) |
after_code |
string | ~50 lines of code around the comment, after the fix |
diff_context |
string | The PR diff hunk where the comment was placed |
file_path |
string | File path within the repo |
comment_line |
int | Line number within the code chunk (0 for negatives) |
language |
string | Programming language |
quality_score |
float | Comment quality score (0.0-1.0; 1.0 for negatives) |
comment_type |
string | Category: suggestion, question, nitpick, bug, refactor, style, security, performance, none |
comment_length |
int | Character count of reviewer comment |
before_lines |
int | Line count of before code |
after_lines |
int | Line count of after code |
is_negative |
bool | True if this is a negative example (no reviewer comment) |
from datasets import load_dataset
ds = load_dataset("ronantakizawa/github-codereview")
# Get a training example
example = ds["train"][0]
print(f"Review comment: {example['reviewer_comment']}")
print(f"Language: {example['language']}")
print(f"Before:\n{example['before_code'][:200]}")
print(f"After:\n{example['after_code'][:200]}")
python_reviews = ds["train"].filter(lambda x: x["language"] == "Python")
high_quality = ds["train"].filter(lambda x: x["quality_score"] >= 0.5)
positives = ds["train"].filter(lambda x: not x["is_negative"])
negatives = ds["train"].filter(lambda x: x["is_negative"])
If you use this dataset, please cite:
@dataset{takizawa2026codereviewdiffs,
title={Code Review Diffs: A Large-Scale Dataset of Review-Driven Code Changes},
author={Takizawa, Ronan},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/datasets/ronantakizawa/github-codereview}
}