Closed polina-c closed 1 year ago
This is by design (only Scenes that implement title
are placed in the generated file), but seeing as this behavior is fairly arbitrary and the thinking behind it was not informed by actual usage, I see no reason why this behavior couldn't be changed. Even if not, it could certainly stand to be documented :)
A few questions:
runApp(StagerApp(scenes:[...]))
. Maybe we could just get rid of codegen altogether? It seems without codegen I need to modify code to do this, it will add friction, because it is much faster and takes less mental effort to copy-paste the command to console, than to open IDE, find the right file and make right edits. So, yes, codegen is valuable from my perspective.
However, it is ok to declare that one file should contain only one scene, if it is easier to maintain.
one file should contain only one scene
That's not the issue here. If your code above implemented title
in HelloSceneDerived
, HelloSceneDerived
would be placed in the Scene list.
one file should contain only one scene
That's not the issue here. If your code above implemented
title
inHelloSceneDerived
,HelloSceneDerived
would be placed in the Scene list.
HelloSceneDerived has title equal to HelloSceneDerived
, as the title is based on runtime type. What would be different if title was implemented explicitly?
Yep, that's right – title has to be implemented explicitly. As I said earlier though, I don't feel like this is the best or most obvious way for a developer to signify which scenes they want to show or not show, so looking for ways to improve. Ideas:
showInApp
property to Scene
.showInApp
defaults to false, all non-abstract Scene subclasses are shown in the Stager app unless showInApp
is true).Closing this issue. Let's open a separate improvement request ticket since this is working as intended.
Scenes:
generated file: