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

Resetting the workspace state when entering data in num and funcs #2305

Closed
1 task done
bbrudastyy opened this issue Apr 3, 2024 · 5 comments
Closed
1 task done
Labels
category: plugin Anything in the plugins folder type: bug Something isn't working

Comments

@bbrudastyy
Copy link

bbrudastyy commented Apr 3, 2024

Check for duplicates

  • I have searched for similar issues before opening a new one.

Component

workspace Minimap

Description

The problem is in the mirror method of the Minimap class in the first check with early return. When entering data into the num block, Blockly sends 3 consecutive events starting with the (-) sign. change, inter..., change. Because of this, mirror makes an early return and the application stops working correctly when trying to enter a negative number further. The same situation occurs when trying to change the name of a function, when the block for calling this function is also located on the workspace

Reproduction steps

For NUM

  1. Initialize the minimap library
  2. Launch the application
  3. Add the num block to the workspace
  4. Enter (-) in the field of the num block
  5. To see that the ability to enter values further stops

For funcs

  1. Initialize the minimap library
  2. Launch the application
  3. Add a block of functions
  4. Add a call to this function
  5. Try to change the name of the function

Stack trace

-

Screenshots

No response

@bbrudastyy bbrudastyy added triage type: bug Something isn't working labels Apr 3, 2024
@maribethb
Copy link
Contributor

I think this is most likely caused by google/blockly#7966 and if we fixed that issue in core this would go away.

Thanks for filing this! If you're interested in contributing a fix we'd accept a PR in core for this :)

@maribethb maribethb added category: plugin Anything in the plugins folder and removed triage labels Apr 3, 2024
@johnnesky
Copy link
Member

I couldn't replicate the bug with entering a (-) sign in the number field but typing a letter in the field prevented me from entering further characters, which sounds similar to the above description. I was able to replicate the bug with changing a function name, it stopped letting me add input after the first character.

I linked against the latest commit of blockly/develop using the directions in #2035 (comment) and this appeared to fix the number field bug, but not the function name bug. I'll investigate further.

@maribethb
Copy link
Contributor

Thanks for confirming! The function name bug is tracked in #2131 I've assigned you to that.

I'll close this since you confirmed the fix in core resolves this. Thanks!

@johnnesky johnnesky reopened this May 3, 2024
@johnnesky
Copy link
Member

johnnesky commented May 3, 2024

Reopening because it's only half fixed! The procedure renaming bug is still present.

I think the problem is that when a procedure name is edited, the call blocks are also renamed. The edits to the procedure name are correctly fired as intermediate events, but the change to the call block is fired as a block change event, which is causing the problem where I can't keep typing in the open field input widget.

EDIT: Maybe the best option would be for the changes to the call block names to be fired as intermediate events as well, and then when the changes to the procedure block are confirmed with a block change event, then we should also fire block change events confirming the changes to the call blocks. Otherwise, every character entered in the procedure block field would result in change events (from the call blocks) which is what we were trying to avoid with the intermediate event feature.

@maribethb
Copy link
Contributor

I closed it because there is a separate bug open for the procedure renaming bug which I assigned you to, #2131

your last comment sounds reasonable to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: plugin Anything in the plugins folder type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants