Skip to content

Conversation

MakinoharaShoko
Copy link
Member

No description provided.

MakinoharaShoko and others added 8 commits September 23, 2025 22:21
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
Copy link

Summary of Changes

Hello @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

  • Enhanced Animation Control: Introduced a new mechanism to stop ongoing animations without forcing them to their final end state, which is particularly useful for managing 'hold' animations or when an animation needs to be interrupted cleanly.
  • Improved Null Safety: Implemented numerous null checks for pixiContainer properties across various animation and stage control files, making the system more robust and preventing potential runtime errors.
  • Refactored State Handling for Visual Elements: Improved the logic for cleaning up old animations when the background or figure URLs change, ensuring a smoother transition and preventing animation conflicts.
  • Dependency Updates: Updated core dependencies including axios, follow-redirects, form-data, and tar-fs to their latest stable versions, enhancing security and performance.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 947 to 957
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);

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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);

Comment on lines +96 to +103
function postBgStateSet() {
if (isUrlChanged) {
// 当 URL 发生变化时,清理旧的 hold 动画
WebGAL.gameplay.performController.unmountPerform(`animation-bg-main`, true);
}
}

postBgStateSet();

Choose a reason for hiding this comment

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

medium

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() {

Choose a reason for hiding this comment

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

medium

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.

Suggested change
function postFigureStateSet() {
function prepareFigureState() {

Copy link

cloudflare-workers-and-pages bot commented Oct 2, 2025

Deploying webgal-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: ddef38f
Status: ✅  Deploy successful!
Preview URL: https://6af40ab7.webgal-dev.pages.dev

View logs

@MakinoharaShoko MakinoharaShoko merged commit 5164ff1 into main Oct 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant