ingoclaro / kdm-companion

Other
1 stars 1 forks source link

fix survivor list handling #24

Open ingoclaro opened 5 years ago

ingoclaro commented 5 years ago

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: