The 'New' icon next to sub-boards was just the same as board status icons: an indicator that a message was posted today in that board. I didn't intend for it to be confusing, I only forgot to change the way it's shown.
I tried doing it differently (adding a custom icon instead of the 'New' text), but it didn't work, so...
Went for a different solution.
A bit crazy but...
1- Board icon opacity still represents the board's activity, i.e. date of the most recent post.
2- Redirect board icon now has a glyph to indicate it's a redirect board. (Can't be seen here, but..)
3- Sub-boards NO LONGER show an activity indicator, and instead they show you the exact number of unread posts in that board. (Main boards also do that, next to the board name.)
Yes, you read it right... The very thing I removed from Wedge this week because it was buggy. I somehow "fixed" it, and made it more interesting, by actually giving you the number of unread posts for a board.
The only problem is that it tends to give too much information now. Ah ah. The problem is not EVEN the performance of that query. It just is satisfying to me. It takes something like a millisecond to run -- faster than most other queries used to get the board list!
What do you think..? Feel free to comment on points 1 and 3 (given that 2 isn't visible for now.)
Posted: April 2nd, 2014, 11:06 PM
It takes something like a millisecond to run -- faster than most other queries used to get the board list!
Correction-- the unread topic query takes a millisecond to run, while the unread boards query takes a tenth of a second to run. That's much higher. Maybe the query can be optimized (it's currently using a filesort, and I'm afraid I'm still not comfortable enough with finding ways to improve on that), possibly by adding some safeguards or maybe new columns.
Still, it's a cool addition, and even if it doesn't make it to Wedge, it might make it to a user setting of sorts, something that could be disabled by default, so that only those who WANT it can view the number of unread board posts.
Update is online here...
Can you spell "boring"?!
I don't know what you'll think. I'm not happy with it, personally. I do like the effect on the main menu, though. Also maybe on the notification popups. The rest... Not so much. Not enough visible on topic pages, not enough on unread counters either.
Please share opinions.
Or, even better, screenshots of how you think it could be improved!
Note: I've reached the 100-day milestone on github's "longest streak", and as I promised myself I wouldn't go beyond that (I only kept committing everyday because I didn't want to end my longest streak on an unlucky number, but above 100 means I'd have to do that every six months, err, don't bother), I probably won't commit anything tomorrow. Or, if I do, I'll try to rewrite history so that it shows as from the day before... :P
Posted: April 6th, 2014, 12:08 AM
@Nao:
I'll take a look into it.
But not before Monday. Hope this is OK for you.
Well, I gave up yesterday, so you're my only hope at this point. :lol:
Honestly, I'd be happy with just a quick query that finds at least one unread post in every board, and stops after that. But I don't think it'll work in making the query faster.
Right now, here's what the query does:
- Gather all id_msg
- Gather all read positions (log_topics...)
- For each msg, determine if its topic is in the read topics list. If yes, if current msg is > msg of the read topics list, then consider we have unread posts in that topic. Mark as unread.
- If not, then try to find the same in log_mark_read.
- If not, then it means we never marked the topic as read, so it's unread. Mark as unread.
- Then, we just group by board.
One of the things that could be done to improve everything, is to store the last id_msg that was sent at the time of our registration. This would serve as a 'threshold', i.e. any posts sent BEFORE my registration should be marked as read.
I don't remember what log_mark_read does. I think it marks a board as read, meaning it makes our work much easier.
However, wasn't that what log_boards was supposed to do..? Hmm... I don't really remember. I'm tired. Bed time!
Posted: April 6th, 2014, 12:19 AM
Please allow one last stupid question on this.
There's already a list with all unread topics, complete with boardnames etc.
What makes it so hard to have a indication per board that the board has unread topics.
Well, that's what it's doing right now... If it has a number, then it's unread.
It's more precise than the old system. But it's also much slower.
And whether I store read status or number of unread posts, it's the same: it's very slow. I tried to cache that data, it makes it very fast of course, but it requires a load of work that I'm unwilling to put in for now. (Emptying the whole cache everytime a new post is sent somewhere or any of many other actions is performed, seems like unnecessary crap.)