This message was deleted.
# compose
s
This message was deleted.
c
but you should not put long text in the main thread but just a TLDR and then the rest in the thread, so that people on smartphoes do not have to scroll the long wall of text and screenshots if they are not interested in answering your question.
s
Subcomposition exists as a continuation of a composition tree, just composed independently. The place where context is remembered marks that place in the parent composition, so that composition locals and tooling calls are propagated correctly.
Composition does not reference its children directly for exactly that reason, because it makes no sense for it to do so. We want to compose it separately anyways, and the important part is to pass composition context (read composition locals) from the place it was created.
No, there's no limit for compositions. SubcomposeLayout uses the same context for all subcompositions
Kind of, composition does not order children outside of tooling really, it just registers them in the context
Generally, yes, it just happens to be ordered in the creation order, so parents are generally recomposed before the children You can also subcompose in different order later (subcompositions are cached by key), and it will not change their order
The rendering order and recomposition order is different, rendering order is controlled by layout (order of placement + zindex) There's a single composition context per SubcomposeLayout, it just indicates what state composition locals were in at the place where subcompose layout was inserted
From the parent composition perspective, subcompositions don't really exist, only the context is in the slot table. You just connect it manually on the node layer.
It is a job of SubcomposeLayout really, applier will just create subtrees in the node it is given
I makes the child nodes per subcomposition and then composes into those nodes during measure / layout