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: Group field validator changes with field value changes. #8589

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

johnnesky
Copy link
Member

@johnnesky johnnesky commented Sep 24, 2024

The basics

The details

Resolves

Fixes #8588

Also fixes #6456

Proposed Changes

Creates a change group before performing any field validation, and uses this group for the field value change event.

Reason for Changes

There are field validators in the core blockly library that make workspace changes in response to field value changes. For example, the block list_getIndex creates or destroys an input connection depending on the value of a dropdown. However, these changes do not get grouped with the field value changes, which causes problems when undoing.

This PR also allows change listeners to retroactively create changes that are grouped with the changes that they are responding to, which is a technique that is already used by some plugins but is incompatible with fields that don't assign any group id to their value changes.

Test Coverage

All existing tests pass, except for the 4 WorkspaceSvg cleanUp test methods that are already currently broken in the
develop branch. (Are these known? I'm testing on a Mac and some coordinates are slightly off.)

@johnnesky johnnesky requested a review from a team as a code owner September 24, 2024 20:03
@github-actions github-actions bot added the PR: fix Fixes a bug label Sep 24, 2024
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Sep 24, 2024
@johnnesky johnnesky merged commit 8d44a4d into google:develop Sep 24, 2024
12 checks passed
@johnnesky johnnesky deleted the nesky_field_group branch September 24, 2024 23:09
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
2 participants