Hello,
at present all #Region section are uncollapsed if the code is compiled/runs.
It should be secured that the question wether #Region is collapsed or not is only managed by the developer in any case and it is not changed by other.
To realize it would make the editor usage more friendly.
By the way this may be done for any Editor in any code lange (B4A/B4I/B4J/B4R).
I assume it was just an oversight on your part.
I tried with the Main and then with B4XMainPage, first with the Regions expanded, then with them collapsed. Everything remains as I left it.