Re-organization by Accident

I accidentally clicked on Arrange Blocks Horizontally and refreshed before I realized what I'd done. Now I have to figure a whole new organization out and I've been working with the old organization for years. I know there's nothing that can be done, I just wanted to mention it to folks who could understand.

You might improve the situation by doing

  • reorganize by Type, then
  • Clean Up

This gets your blocks into a vertically scrollable setup, non-overlapping, by type.

You can grab blocks and helicopter scroll them off screen.

I have 8,366 blocks on that screen. I fear that fiddling with it more would just make everything worse. Thank you though.

You are very close to the edge with that number of blocks...

It still compiles.

It happily compiles in fact. :slight_smile:

When you have too many blocks spread out over too large a surface area,
the Blocks Editor hits a complexity limit when it tries to generate a blocks.png file for the screen.

There are two main approaches to deal with this:

  • Start a Google Doc with a Table of Contents explaining your app, with sections for Design, Data, Code, including Downloaded Png images of all Events, Procedures, Globals, and with html cross-links for easy navigation. Such a doc becomes easier to read than a complete blocks image, because you have FIND, Next, PREV, back functionality, and you can add paragraphs of commentary around your code. This is my preferred life saver when doing a very large complex app. If you go this route, try to arrange your blocks geographically in a column matching the order of your Table of Contents, then do periodic Clean Up Blocks to pull them inline. This sometimes lowers the load on the Blocks Editor.
  • Reduce your block count:
    • Use parametrized procedures for common code
    • Use Media text files instead of big clumps of text blocks
    • Use generic blocks instead of repeating component event blocks
    • Encode repeating decision patterns into lookup tables loaded from Media csv text files (does your blocks image look like a box of combs?)
    • You don't need a component for every data instance. Reuse those components.
    • If you can't fit data into a ListView or List Picker, show a small subset of the data in an Arrangement and slide it across the larger list of data.
1 Like

But it happily compiles. The only problems I have is that my laptop isn't happy with it, so I use a desktop and, as I noted. I accidentally clicked on Horizonal Organization when I was trying to use the Find feature.(that's too easy to do 'cause you have to right-click in the window or ctrl-f only gets you the browser's find, not App Inventor's find). Your suggestion, although appreciated, seems like a lot of work for not that much benefit.

This will depend on your blocks...:slight_smile:

Let's see, every bit of code I used 2-times or more is in a procedure (maybe about 100). There is limited art and few instances of a lot of text. Mostly it's math, moving information from one screen to the other, saving presets, putting in or removing commas from numbers, changing the color of text to let you know if it's been recently changed or not and, of course, more math. Math's gonn'a math though and it takes space up.

Don't you have an .aia (recent) ?
If yes, most probably it's faster (I don't say easier) to restart from there ?
All the best.

Interesting. I assume that's the file that tells App Inventor where in space the blocks live.

I have made changes to the code since the incident. Not a lot, but it's work I'd rather not redo as it's for a new version that's going live on Sat. or Sun. do you think that matters?

Without saving any .aia project exports?

This board gets sob stories monthly about lost projects.

1 Like

Dear @Frank_Harr,
let me say it in another way: if you have stored on your PC an .aia before the "disaster", by restoring it (the .aia) you will overwrite the last code, and the blocks will be shown back with their original positions.
This means that the modifications done after the blocks reallocation are lost, but is up to you to balance whether it is worth to just recode that portion.
Best wishes :muscle:

I'm doing this as a hobby so I have to manage time. I have version I've downladed and then trashed 'cause I made more adjustments and it may be worth it. I may be able to swing this. Thank you!

Well, no. I do download and trash as needed for testing. And I suppose a resent version may be in the trash someplace. But it's not a .aia, it's a .apk. Anyway, I must have got lucky.

I just realized, that those are .apk's, so it's not going to work. Thank you though.

Ops no, the apk does not rescue you..... :weary: :weary: :weary: it's already an "executable" while the .aia is a backup copy of your source.

Well, this version's live a couple of days. The fussing is done. I'm just reorganizing right now. Thank you though.