Been thinking about this some more in conjunction with some good points raised over on the demo forum:
...won't long discussions be difficult to load in their entirety on old browsers/machines? I know my browser usually freezed whenever I tried to open a sticky on /v/. Also, one of the benefits of endless scrolling is supposed to be that you can read a whole discussion without ever clicking on anything, but having to click on "45 more posts" "12 more posts" etc kinda defeats that purpose, doesn't it?
He's absolutely right on both counts. As you load more and more posts, old devices will slow down because of the huge amount of DOM to work with, not to mention the growing lag when Mithril performs a redraw. And I agree, those "gaps" do kind of defeat the purpose of the infinite scroll — it works fine if you're loading posts at the start/end, but if you start at the beginning and then jump straight to the end, everything in the middle has to be loaded manually which sucks.
To address the first point, we need to look into implementing occlusion culling, i.e. only rendering what is visible on the screen at any given time. This is kind of similar to what you're suggesting in that off-screen posts will be replaced by a big placeholder element. So those implementations will hopefully go hand-in-hand.
For the second point, I think we should consider changing the behaviour to kind of reset the stream's state each time you jump to a different position in the discussion. So if you're at the start of the discussion and you jump to the end, then the start is "unloaded" and scrolling back up will load posts from the bottom. To get back to the start you have to jump back up to it. I think this might be more intuitive.