Display unread count for each topic on /unread
-
It would be nice if the /unread page was showing, for each topic, how many unread messages there are.
At the moment, it shows the total number of messages plus some info about the last one, but that's all. I would appreciate before going to a topic knowing whether it's for one message (and if it's a one-liner, the preview on /unread is enough and avoids letting do its magic dance when loading a topic) or a more significant discussion.
-
@remi IIRC we concluded that this would require a plugin or changes in the core, not sure which. We do have some people already comfortable with this though, maybe this time we can actually get it done?
+1 in any case
-
@Onyx said in Display unread count for each topic on /unread:
+1 in any case
+3 but please take into account the 66% error rate.
-
btw, is the number of view an interesting information for many of you? I can see how on some forum with topics with real information but a low post count, that might be an interesting stat, but here?
I mean, in relation to this topic, I would see more value in having the number of unread rather than the number of views on the summary page (to keep only 2 numbers displayed to avoid crowding things... you know how white space is precious, you wouldn't want to put too much stuff in it!).
-
@remi well, both of those numbers are a global topic metadata, number of unread is per user and needs to be recalculated on each refresh. I buttume that's why one is present and the other one isn't.
-
It is worth having only if it is accurate. If it not accurate, no point bothering with it, and right now read tracking is flaky.
-
@Onyx Makes sense, yes. But if it's useless information, there is no point showing it even if it can be computed (and even if it might be of interest to the admins).
Back to the original topic, I understand that computing the number of unread is slightly more work than just the global stats. But since knows where I was in each topic, it must have the relevant information somewhere...
-
@Arantor said in Display unread count for each topic on /unread:
right now read tracking is flaky.
Ok but if click on the link it takes me a certain post mid-topic, right? The one that's presumed to be the last read. So would it be impossible to deduce the remaining number of posts below that?
-
@Arantor said in Display unread count for each topic on /unread:
It is worth having only if it is accurate.
Fair point, having a wrong number is worse than no number. But, as @Luhmann says, if I click the topic I get sent to a specific post: even if it's not really the last one I was reading, this could be used to give a number? At least I would know how many posts are between where takes me when clicking the topic and the end.
(plus, may I respectfully suggest that if read tracking is flaky, that should be one more incentive to fix it...)
(and I don't want to rehash that theme too much, but the phpBB forums I'm using don't seem to have any issue with read tracking, so that's probably not that difficult to do...)
-
@Luhmann said in Display unread count for each topic on /unread:
@Arantor said in Display unread count for each topic on /unread:
right now read tracking is flaky.
Ok but if click on the link it takes me a certain post mid-topic, right? The one that's presumed to be the last read. So would it be impossible to deduce the remaining number of posts below that?
The problem is, it isn't always the last read. More than once, I've gone to "the last post I saw" only to find replies from me after it because flaky connection and not dealing with it very well.
The actual calculation isn't so hard in practice.
-
@remi said in Display unread count for each topic on /unread:
Fair point, having a wrong number is worse than no number.
Actually, I'd say exactly the opposite: even a wrong but close-enough number is better than nothing.
If I see a thread with 2000 posts in it, and it says I've read 1358 posts, and I've actually read 1362 posts, big deal. At least I know I'm 2/3 of the way through it and have approximately 650 to go in order to get caught up. That's useful information to have, even if it's not perfectly accurate.
-
@masonwheeler
All of the various "Discocounting" memes that show up in the forum history suggest that WTDWTFers do not agree with you about the severity of reporting 642 unread posts instead of 638.
-
@izzion Yeah, but we're a community that's made an entire meme/running joke about ry. That doesn't mean that a good first-order approximation has no value to most of us.
-
The unread page already knows what your last read post index was, so this would just be a question of what the UI should look like. There wouldn't be any need for any extra database calls.
-
@ben_lubar Honestly, I think this is close enough:
Which is just an extra
<span class="badge">
after the<a>
. Maybe a bit of alignment fiddling, but that's minor, IMHO.ETA: ignore the
test
part, I messed up something and didn't notice it before screenshoting
-
@masonwheeler I can understand some people not liking seeing 642 instead of 638, if nothing else because it gives a wrong picture of accuracy (and if you know this number is wrong, you start doubting all other numbers...). If really there is no way to get the exact number (which would be surprising, honestly!) then we could at least have an approximate one, like for the posting times. What you want to know from the number of unread is indeed 1 or 1000, not really 642 or 638.
-
@remi said in Display unread count for each topic on /unread:
(which would be surprising, honestly!)
Mongo to the rescue! Dealing web-scale surprise to programmers with lethal efficiency!
-
@remi said in Display unread count for each topic on /unread:
If really there is no way to get the exact number (which would be surprising, honestly!) then we could at least have an approximate one,
Here's the problem: NodeBB's reliance on websockets means the connection is flaky, so it frequently misses posts you've read. Including marking my 'last read' as before posts I've made in the topic. This does not bode well for unread purposes, especially if it tells me there's 1-2 unread in a topic, where said 1-2 unread have been read several times.
-
@Arantor @dkf so once again, using trendy new techs means we can't have useful features that boring old techs could deliver. I love modern tech...
Can we go back to CS, please? It might not have had many features, but at least it didn't pretend to...
-
@remi Maybe I ought to code one up over the weekend. How hard can it be?
-
select COUNT(post_id) FROM topics LEFT OUTER JOIN posts ON topics.topic_id = posts.topic_id GROUP BY topics.topic_id
That is too hard for WEBSCALE.
-
@Lorne-Kates that tells you the number in each topic, not the number left unread which is a bit more complex.
However, it's still better than #webscale
-
@masonwheeler said in Display unread count for each topic on /unread:
@remi Maybe I ought to code one up over the weekend. How hard can it be?
You'd be surprised.
-
@Arantor said in Display unread count for each topic on /unread:
@Lorne-Kates that tells you the number in each topic, not the number left unread which is a bit more complex.
However, it's still better than #webscale
Yeah yeah-- add another join to unread or where read=0 or whatever.
My point's the same. #woobSCALE doesn't do useless, unused features like JOIN or COUNT.
-
@Lorne-Kates who does JOINS?
Oh wait, every fucker with even vaguely relational data. Guess forums aren't relationa-- shit.
-
@Lorne-Kates I was going to say that you need a relational DB for that and make a snippy joke but I think that's already been done to death (and I've been ed as well...).
-
@Onyx said in Display unread count for each topic on /unread:
@ben_lubar Honestly, I think this is close enough:
Which is just an extra
<span class="badge">
after the<a>
. Maybe a bit of alignment fiddling, but that's minor, IMHO.ETA: ignore the
test
part, I messed up something and didn't notice it before screenshotingOh hi there Discourse.
-
@aliceif I will neither confirm nor deny any inspirational influence.
-
$("h2[component='topic/header'] > a").each(function(idx, el) { var lastReadArr = $(el).attr('href').split('/'); var lastRead = lastReadArr[lastReadArr.length - 1]; var total = $(el).closest("li").children("div:eq(2)").children("span").attr("title"); var delta = total - lastRead; if (delta != 0) { $(el).append("<span style='background-color:#bbbbbb'>" + delta + "</span>"); } });
Haven't figured out how to make it trigger on infinniscroll, and that append should probably check whether a span was added there already, but the general concept seems possible client-side.