-
-
Notifications
You must be signed in to change notification settings - Fork 291
4.5.16 #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.5.16 #780
Conversation
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.3 to 2.1.4. - [Commits](mafintosh/tar-fs@v2.1.3...v2.1.4) --- updated-dependencies: - dependency-name: tar-fs dependency-version: 2.1.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [axios](https://github.com/axios/axios) from 0.28.0 to 0.30.2. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v0.28.0...v0.30.2) --- updated-dependencies: - dependency-name: axios dependency-version: 0.30.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
…iner fix: assign transform to a destroyed container problem
…s-2.1.4 build(deps): bump tar-fs from 2.1.3 to 2.1.4
…-0.30.2 build(deps): bump axios from 0.28.0 to 0.30.2
Summary of ChangesHello @MakinoharaShoko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the stability and control of visual elements and animations within the Pixi.js rendering stage. It introduces a more sophisticated way to manage animation lifecycles, allowing for animations to be stopped gracefully without necessarily completing their full sequence. The changes also significantly improve the robustness of the system by adding comprehensive null checks for critical display objects, ensuring more reliable operation. Additionally, routine dependency updates have been performed to keep the project current with the latest library versions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request appears to be a maintenance release, primarily focused on updating dependencies and fixing bugs related to animation handling. The changes introduce a mechanism to stop 'kept' animations without setting their end state, which is a significant logic enhancement. To support this, the pixiContainer
property on stage objects is now nullable, and null checks have been added throughout the codebase. My review includes suggestions to improve type safety, refactor duplicated code for better maintainability, and enhance code clarity by simplifying functions and improving naming conventions.
const bgSprite = this.figureObjects[indexFig]; | ||
for (const element of bgSprite.pixiContainer.children) { | ||
element.destroy(); | ||
if (bgSprite.pixiContainer) | ||
for (const element of bgSprite.pixiContainer.children) { | ||
element.destroy(); | ||
} | ||
if (bgSprite.pixiContainer) { | ||
bgSprite.pixiContainer.destroy(); | ||
this.figureContainer.removeChild(bgSprite.pixiContainer); | ||
} | ||
bgSprite.pixiContainer.destroy(); | ||
this.figureContainer.removeChild(bgSprite.pixiContainer); | ||
bgSprite.pixiContainer = null; | ||
this.figureObjects.splice(indexFig, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for removing an object is duplicated for figures and backgrounds. This could be extracted into a private helper method to improve maintainability. Also, the variable bgSprite
is a bit misleading for a figure object, and the two if (bgSprite.pixiContainer)
checks are redundant.
Here's a cleaner version for this block. A similar change can be applied to the background object removal logic. For even better code, consider creating a helper function for both cases.
const bgSprite = this.figureObjects[indexFig]; | |
for (const element of bgSprite.pixiContainer.children) { | |
element.destroy(); | |
if (bgSprite.pixiContainer) | |
for (const element of bgSprite.pixiContainer.children) { | |
element.destroy(); | |
} | |
if (bgSprite.pixiContainer) { | |
bgSprite.pixiContainer.destroy(); | |
this.figureContainer.removeChild(bgSprite.pixiContainer); | |
} | |
bgSprite.pixiContainer.destroy(); | |
this.figureContainer.removeChild(bgSprite.pixiContainer); | |
bgSprite.pixiContainer = null; | |
this.figureObjects.splice(indexFig, 1); | |
const figObject = this.figureObjects[indexFig]; | |
if (figObject.pixiContainer) { | |
for (const element of figObject.pixiContainer.children) { | |
element.destroy(); | |
} | |
figObject.pixiContainer.destroy(); | |
this.figureContainer.removeChild(figObject.pixiContainer); | |
} | |
figObject.pixiContainer = null; | |
this.figureObjects.splice(indexFig, 1); |
function postBgStateSet() { | ||
if (isUrlChanged) { | ||
// 当 URL 发生变化时,清理旧的 hold 动画 | ||
WebGAL.gameplay.performController.unmountPerform(`animation-bg-main`, true); | ||
} | ||
} | ||
|
||
postBgStateSet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function postBgStateSet
is only called once, so it could be inlined to simplify the code. Additionally, its name is a bit misleading as it's called before the background state is set with dispatch(setStage(...))
. A name like cleanupPreviousBg
would be more descriptive if you decide to keep it as a separate function.
if (isUrlChanged) {
// 当 URL 发生变化时,清理旧的 hold 动画
WebGAL.gameplay.performController.unmountPerform(`animation-bg-main`, true);
}
}; | ||
|
||
function setFigureData() { | ||
function postFigureStateSet() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name postFigureStateSet
is a bit misleading, as it's called before the figure state is updated with dispatch
. A name like prepareFigureState
or cleanupAndPrepareFigureState
would more accurately reflect that it cleans up previous animations and prepares data for the new state.
function postFigureStateSet() { | |
function prepareFigureState() { |
Deploying webgal-dev with
|
Latest commit: |
ddef38f
|
Status: | ✅ Deploy successful! |
Preview URL: | https://6af40ab7.webgal-dev.pages.dev |
No description provided.