We need a way to sort a composited model. This require the ability to insert object anywhere we want into the children list.
|Open||None||T8177 Collection_View Tracking ticket|
|Open||None||T8349 Add an Efl.Ui.Sorted_Model|
|Open||felipealmeida||T7377 [MVVM] Model Insertion Features|
|Open||None||T8348 Add support for batching children creation in Efl.Model|
I think that this model can have two strategy for the sorting. On the first notification of a child being added or if the count > 0 when the compositing is done, the model batch fetch all the child of the composited model and sort them using a merge sort. The idea would be to keep just an index mapping of which child of the sorted model map to which child in the composited model.
The sorting function should either provide a list of property that needs to be ready for it to give a result and always provide a result when they are ready, or the sorting function should be asynchronous. I tend to think that the later case will be safer to write even if it means inserting things in a non batch way to start. Later we could have a job that group all the insertion ready for a frame and do only one call for that.
As there is no event on an model that is not loaded, it will be impossible to sort a Model after it has been sorted and it isn't watched anymore. This is a known limitation of the MVVM infrastructure we have built. If someone needs to sort a Model again, it should remove it and add it again. This is what happens in Efl.Io when a file is renamed anyway. So I do think this is acceptable.