mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
We now keep track of keys in buddy_list.js, so that when we insert/remove items, we no longer need to traverse all the DOM. Instead, we just find out which position in the list we need to insert the key in (where "key" is "user_id") and then find the relevant DOM node directly and insert the new HTML before that node. (And of course we still account for the "append" case.) There's a little more bookkeeping to make this happen, but it should help reduce some code in upcoming commits and pave the way toward progressive rendering optimizations. This commit should produce a minor speedup for activity-related events that go through buddy_list.insert_or_move(), since we are not traversing the DOM to find insertion points any more.
5.2 KiB
5.2 KiB