I think we'll want a big doc-block here.  Based on my reading here, I'd go with something like:

"""
The DOM node corresponding to the message being displayed in the message reader.  This allows us to track whether there are messages before or after the currently viewed message.  We track this by using DOM nodes rather than MailHeader instances in our slice for consistency with our existing logic.  (That logic uses DOM nodes because we may de-persist the message list at startup before we have any MailHeader instances.)

This reference is kept up-to-date as messages are removed in onMessagesSplice.

It is safe to use nextElementSibling and previousElementSibling because all message DOM nodes live within the "msg-messages-container" container and only message DOM nodes are placed in there.
"""

Action items hinted at in that comment would be:

- You need to check in onMessagesSplice if we are removing the node that is currently the currentMessageNode.  I suggest just doing something like if (currentMessageNode === removingNode) currentMessageNode = removingNode.nextElementSibling || removingNode.previousElementSibling.

- You'll want to also check if added nodes cause us to need to call emitHasSiblingEvents.  I'm thinking we call if (insertBuddy === null && messagesContainer.lastElementChild === currentMessageNode) implying that there is a change in next, or if (insertBuddy === currentMessageNode && messagesContainer.firstElementChild === currentMessageNode) implying that there is a change in previous.