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

Bugfixes for master #931

Merged
merged 3 commits into from Sep 24, 2017

Conversation

Projects
None yet
3 participants
@ewpatton
Member

ewpatton commented Sep 22, 2017

This PR includes the following changes:

  • Fixes a bug where the block position in older projects was sometimes forgotten during an upgrade
  • Fixes a bug introduced in the Blockly update where switching projects didn't trigger the ReplMgr to update the companion
  • Fixes a rendering glitch on project load caused by 2 second delay in MockForm.refresh()

The changes have also been submitted to gerrit for CI.

ewpatton added some commits Sep 1, 2017

Store block positions during upgrades
Blocks workspace upgraders sometimes operate on the workspace in XML
form rather than workspace form. When we did the Blockly update in May
2017, we moved updating the positions of blocks to occur immediately
before the first render of the workspace rather than at workspace load
time. This results in all blocks being at 0, 0 if the project relied
on a component where the upgrader used XML because the blocks do not
get positioned until after the upgrade has run.

This code wraps the blockToDOMWithXY function to update the position
of the block during serialization to XML if rendering is turned off,
i.e. we are loading the workspace.

Fixes #920

Change-Id: Ie19cbe4207e6c36979c2adb767748bb54def4551
Fix project switching when connected to REPL
The Blockly update broke how the REPL interacted with App Inventor
when switching between projects after connecting. This change ensures
that pollYail is called when a workspace is made active so that the
screen will be updated accordingly.

Change-Id: I3b10365e59d247590a7f5f9e522a450b7ad2ab4b
Use immediately deferred timer for MockForm refresh
Large projects demonstrated that an O(n^2) behavior for the MockForm
refresh function caused significant slowdown when loading and
rendering large projects in the designer. Jeff originally fixed this
by introducing a timer so that at least 2 seconds were provided
between refresh calls. However, this introduces some visual glitches
when components are dragged or immediately after project load due to
the fact that up to two seconds must elapse before the component sizes
are updated.

This commit uses a timer that immediately fires after the current
JavaScript execution context finishes so that changes to the form and
its components takes effect immediately on the next render pass. To
prevent O(n^2) behavior, only one timer is scheduled at any one point,
and the timer is only cleared after the refresh pass has completed.

Change-Id: I7c43ec19b6aad2d8fa6de2d5cdbf9913dec44abf

@ewpatton ewpatton requested review from halatmit, afmckinney and jisqyv Sep 22, 2017

@jisqyv jisqyv self-assigned this Sep 23, 2017

@jisqyv jisqyv merged commit 2fbb4bd into mit-cml:master Sep 24, 2017

@ewpatton ewpatton deleted the ewpatton:master-bugfixes branch Oct 6, 2017

@moliata

This comment has been minimized.

Contributor

moliata commented on 853908e Dec 27, 2017

This did not fix an issue, currently opening an issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment