Currently the top borders are added on page load and whenever any date element is added, but it's pretty useless when this happens.. I recommend we add a check so this only works when account page is sorted by date.
I did some r&d and i think this function can help check if account is sorted by date..
https://github.com/toolkit-for-ynab/toolkit-for-ynab hosts a number of plugins for YNAB. A version for their toolkit would be nice, although it will have to be done in a different repository. A link here to the repo and PR can be maintained here.
Making use of their observe(changedNodes: Set): void should be good enough for this. I recommend this to be done after fixing #3, which can used for shouldInvoke() method.