Skip to content
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

fix: block_svg disable/enable ops lead to unsync state and render #6989

Merged
merged 3 commits into from
Apr 19, 2023
Merged

fix: block_svg disable/enable ops lead to unsync state and render #6989

merged 3 commits into from
Apr 19, 2023

Conversation

dimaaan21
Copy link
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Fixes #6988

Proposed Changes

Behavior Before Change

Behavior After Change

Reason for Changes

Test Coverage

Documentation

Additional Information

@dimaaan21 dimaaan21 requested a review from a team as a code owner April 18, 2023 15:46
@dimaaan21 dimaaan21 requested a review from maribethb April 18, 2023 15:46
@google-cla
Copy link

google-cla bot commented Apr 18, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the PR: fix Fixes a bug label Apr 18, 2023
@dimaaan21 dimaaan21 changed the title fix: disable/enable block_svg downstream blocks fix: block_svg disable/enable ops lead to unsync state and render Apr 18, 2023
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Apr 18, 2023
@BeksOmega BeksOmega requested review from BeksOmega and removed request for maribethb April 18, 2023 21:58
@BeksOmega BeksOmega assigned BeksOmega and unassigned maribethb Apr 18, 2023
Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

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

Thanks for finding this bug! This fix looks like it works great :D But I have a recommendation for a slightly different approach.

It looks like the issue is that we need to update next blocks regardless of whether the current block has the proper visuallyDisabled state or not. But, we can still skip rendering all of the /inner/ children of a block to gain a little bit of performance.

So I think this would look something like:

if (this.visuallyDisabled === disabled) {
  this.getNextBlock()?.updateDisabled();
  return;
}

Does that look like it'll solve the bug(s) you're running into?

@dimaaan21
Copy link
Contributor Author

Thanks for finding this bug! This fix looks like it works great :D But I have a recommendation for a slightly different approach.

It looks like the issue is that we need to update next blocks regardless of whether the current block has the proper visuallyDisabled state or not. But, we can still skip rendering all of the /inner/ children of a block to gain a little bit of performance.

So I think this would look something like:

if (this.visuallyDisabled === disabled) {
  this.getNextBlock()?.updateDisabled();
  return;
}

Does that look like it'll solve the bug(s) you're running into?

LGTM! I suggest, thanks.
Applied new version.

@BeksOmega BeksOmega enabled auto-merge (squash) April 19, 2023 15:08
@BeksOmega BeksOmega merged commit acd046e into google:develop Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

block_svg: render isn't sync OK with the state after disable/enable ops
3 participants