Show HN: HN Unread Comments v1.1 released (chrome extension)
chrome.google.com
chrome.google.com
Looking at the source I see that you calculate and store an md5 hash for each comment:
var commentContentMd5 = md5($this.find('table td:eq(2) span.comment').text());
However each comment on HN has a unique id, that can be found on the links of the up and down keys: <a id="up_1943152" href="vote?for=1943152&...
Wouldn't it be easier (and maybe faster) to use these ids to identify comments?Perhaps you could do both and mark edited comments with a different color.
edit: bonus "feature" of md5-ing the comments is, that if a comment changes it is marked as unread again ...
The score is in a span that has the same id:
<span id="score_1944875">3 points</span>
> if a comment changes it is marked as unread againBut identical comments in different conversations are marked as read... ;-)
>But identical comments in different conversations are marked as read... ;-)
true, but that seems highly unlikely here on HN, where you don't have comments like "lol :)" everywhere.
YMMV ;-)
1) If you've already read a comment you've already read it regardless of where you read it, and if the comments are exactly the same they are probably not terribly context sensitive.
2) I believe that if a submitted comment is exactly the same as one in memory than it is auto-killed so in general this is a moot point anyway.
Making read comments a lighter shade of grey would, unfortunately, not go well with how HN handles comments with <= 0 score.
If you have any more ideas please share them, I know this isn't the optimal solution right now, but I can't find anything better ...
Maybe you could give the option for the user to set their own CSS values for read and unread.
It's available here:
Otherwise, pretty cool. Installed.
The hash thing is interesting for detecting edits, but since comments can be edited only for a limited amount of time (an hour maybe?) it doesn't need to be stored for a long time.
Therefore maybe you could do:
- hash => sessionStorage
- article_id;highest_comment_id => localStorage
If I haven't read any of the comments on a post, there is no need to show me that they are new. The entire thread is new, I know that. In essence, the extension gives comments two states: new or old. I perceive that there are three states: new, old, and new-since-last-viewed.
I am only interested in special highlighting for the third state, new for threads I have visited before.
The red border is unbearable.