tl;dr: make survivor list a view instead of the array and make it efficient for the UI.
Right now we have an array of references for the active survivor list. I did this for performance reasons because the whole list we being re-rendered for any survivor change (eg: increase of it's stats) because a new list was returned, but equal to the previous one in terms of ordering.
The issue is that it gets flimsy with the drag-sort component, it sometimes creates duplicate entries.
Manual sort order would need to be considered as well (eg: filter, then order by a new 'order' attribute.), This would be tricky probably when manually ordering over a filtered list (I guess we should just swap the element's orderId)
Another issue is that the current approach limits future development. For example I would like to add a filter instead of the current alive/dead selector, so that you can quickly find specific survivors, some examples:
filter/sort by XP or any other stat (eg: survivors with str > 2)
filter by status (alive, retired, dead)
filter by departing (when I revamp the departing stuff)
tl;dr: make survivor list a view instead of the array and make it efficient for the UI.
Right now we have an array of references for the active survivor list. I did this for performance reasons because the whole list we being re-rendered for any survivor change (eg: increase of it's stats) because a new list was returned, but equal to the previous one in terms of ordering.
The issue is that it gets flimsy with the drag-sort component, it sometimes creates duplicate entries. Manual sort order would need to be considered as well (eg: filter, then order by a new 'order' attribute.), This would be tricky probably when manually ordering over a filtered list (I guess we should just swap the element's orderId)
Another issue is that the current approach limits future development. For example I would like to add a filter instead of the current alive/dead selector, so that you can quickly find specific survivors, some examples: