Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate when story has comments you haven't read #200

Closed
megamattron opened this issue Feb 14, 2014 · 7 comments
Closed

Indicate when story has comments you haven't read #200

megamattron opened this issue Feb 14, 2014 · 7 comments

Comments

@megamattron
Copy link
Member

Maybe this is a bad idea because we have to know what everyone's seen before, but it would sure be nice.

@swelham
Copy link
Collaborator

swelham commented Feb 14, 2014

Not such a bad idea - we would only need to know the last time they viewed the comments for a particular item and then just see if there are any new comments since that date.

@sriehl
Copy link
Contributor

sriehl commented Feb 14, 2014

I think a simple way to do it would be have a list of users who have seen the comments on that item. When a new comment is added, clear the list.

It's doesn't add any database calls when viewing the home page.

@kennethrapp
Copy link
Contributor

i'm working on this right now. It adds the date of the latest comment and name of the latest commenter to the news item object, and sets it in the view as data items in the comment link. I'm planning to use session storage (maybe) to check that when the document loads in main.js.

@chall8908
Copy link

@kennethrapp wouldn't it make more sense to use localStorage?

@kennethrapp
Copy link
Contributor

Probably.

Since I clearly can't decide on anything I just removed storage entirely pending further discussion, since I don't know what the best solution in node would be for that. I don't want to contribute to bloat too much. It just shows the time of the latest comment.

@treygriffith
Copy link
Collaborator

@sriehl editing the same array in mongodb at the same time (which would be the case any time two users viewed a story at the same time) can be tricky. Only the $push and $addToSet operators work for this purpose, and I'm generally wary of editing the story for what is fundamentally an attribute of the user.

@chall8908 I actually think localStorage is not the right answer for this since it wouldn't translate across devices. I know that's fairly small potatoes, but I'd rather design for a multi-device world at the outset.

megamattron added a commit that referenced this issue Feb 19, 2014
update to show last comment time (for #200)
@treygriffith
Copy link
Collaborator

I think this was addressed, at least for the time being, by using a query string in the url to the comments page (#246). That way your browser shows the comments link as a new one if there have been new comments since your last visit. It certainly isn't a comprehensive solution, but it's simple and gets the job done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants