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

Blocks move when a project is reloaded #5947

Open
martinwork opened this issue Sep 13, 2024 · 8 comments
Open

Blocks move when a project is reloaded #5947

martinwork opened this issue Sep 13, 2024 · 8 comments
Assignees
Labels

Comments

@martinwork
Copy link
Contributor

Describe the bug

Arising from support ticket https://support.microbit.org/helpdesk/tickets/82439 (private)

After creating a project with blocks neatly aligned, the blocks move in an apparently unpredictable way when the project is reloaded.

The movement seems to vary - does it depend on which block was moved last?

The moving blocks move across more on each reload.

I don't know if functions are essential - but the example in the ticket has functions.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://makecode.microbit.org/_hLc2Ve1zYbEz
  2. Position blocks as below
  3. Visit Home and reload the project
  4. See error

Expected behavior
Blocks don't change position.

Screenshots
Before reload
image

After reload
image

micro:bit version (please complete the following information):
not hardware related

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 10
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 128
@martinwork
Copy link
Contributor Author

Related to this, though not a regression, I don't think... Should I create a separate issue?

Create a new project
image

Reload it - border is smaller
image

===========================

Sometimes there's no border...
image

becomes
image

==========================

Or a border on one side...
image

becomes
image

@riknoll
Copy link
Member

riknoll commented Sep 23, 2024

i've run into this; seems like the blockly xml loader now likes to bump blocks when parsing the xml file which causes these little nudges to happen.

the behavior in your second comment, however, is how it's always been iirc. we've always adjusted the workspace to align everything to the top-left when loading a project

@martinwork
Copy link
Contributor Author

Thanks @riknoll I suppose users want to lay out blocks in neat columns and rows and not have that undone with overlapping blocks when the project is reloaded.

The second part is not new, but I noticed it again while looking at the first thing and thought it might be related. I had two thoughts:

  • the border of a new project and a reloaded project should be the same width
  • no border on either or both sides doesn't look right

@riknoll
Copy link
Member

riknoll commented Sep 24, 2024

i agree that the nudging behavior is something we should fix, but i believe that we made the aligning to the top-left change in response to feedback from user testing. people were getting "lost" when they opened large projects iirc

@riknoll riknoll removed this from the Hotfix ongoing milestone Sep 24, 2024
@martinwork
Copy link
Contributor Author

OK, I don't feel strongly about the the border behaviour, which has clearly stood the test of time!

@martinwork
Copy link
Contributor Author

@riknoll But I don't understand why this issue about blocks moving on reload was removed from the hotfix milestone. Was that a mistake because I've confused the issue?

@Vegz78
Copy link

Vegz78 commented Oct 29, 2024

@riknoll But I don't understand why this issue about blocks moving on reload was removed from the hotfix milestone. Was that a mistake because I've confused the issue?

I concur! Something is rotten in the new state of Denmark!

Especially when reloading back to block based code from text based ("JavaScript"), the code reappears as if it has been randomly drawn from a tombola...:

  1. Finished project:
    Image

  2. Reloaded from .hex file:
    Image

  3. Returning from the "JavaScript" editor (tombola-effect, comments hidden and also added two variable declarations in grey blocks...):
    Image

Related?: #5959

@martinwork
Copy link
Contributor Author

Also reported in support ticket https://support.microbit.org/helpdesk/tickets/83796 (private) that, paraphrasing, when the page is reloaded, blocks move around and often end up overlapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants