yeah I recommend you look at staltz's ssb-threads. I've got branch logic in scuttle-threads but I plan to move this upstream into ssb-thread for better performance and to consolidate methods in one place.
The code you linked @matt is using the branch
field to do nested or direct replies. I want to strongly request that you don't conflate history building with replies. They are sometimes correlated but not always. If you're not sure what I mean I really want to talk to you. If you disagree, that's cool too, but I want to talk so we aren't building shit that fucks each others stuff up