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

Allow users to create discussion threads in addition to submitting links... #149

Merged
merged 1 commit into from Feb 12, 2014
Merged

Conversation

ghost
Copy link

@ghost ghost commented Feb 12, 2014

Here's my attempt at issue #64.

This change will allow users to create discussion threads ("self" threads, "Ask/Show *" threads, etc.) instead of posting links.

This commit does not include markdown (I assume markdown will be used for comments as well?) to keep the scope of these changes small.

There may be bugs here, But I wanted some early feedback to see if this feature was something that would be used or not. I believe It Works, but there is definitely some room for improvement...

@treygriffith
Copy link
Collaborator

This is definitely a useful change, but I have a couple of questions:

  1. Why are you relying on the source of the link to determine self-posts? It seems to me that there could be quite a few instances in which that fails either because the link is to another page on the site (e.g. pullup.io/some-new-page-that-everyone-should-see), or because the source is edited by the user.
  2. Why use the summary field as the content of the self-post? Maybe it's ok, but they seem like two very different pieces of information to me, which is why you had to mangle the display of the submitted item quite a bit based on whether or not this is a self post.

megamattron pushed a commit that referenced this pull request Feb 12, 2014
@megamattron megamattron merged commit 1af4753 into larvalabs:master Feb 12, 2014
@megamattron
Copy link
Member

Oops, I missed the discussion by @treygriffith here and merged it as it seemed mostly right. Now that I see it up on the site though, I think the summary reveal button might have been broken.

@ghost
Copy link
Author

ghost commented Feb 12, 2014

@megamattron The summary reveal works fine for me, what kind of problem are you seeing?

@treygriffith
These are two good points.

I agree on point 1. Improving this should be trivial and all links to this domain will appear as self-posts (Currently, the only difference is that the 'summary' is not hidden by default on self-posts).

As an aside, I don't understand the reason for allowing the user to edit the source field when submitting. Wouldn't it be more consistent to deduce it from the submitted URL. (e.g. I don't see how we would benefit from a post to 'example.com' having the source be something else).

Regarding point 2, It seemed to me that the comment & summary both serve the same purpose (i.e. a commentary on the submission). I don't see any reason for a self-post to include a summary in addition to the comment, although I suppose there could be a case for allowing a URL submission to have a summary & comment...

@megamattron
Copy link
Member

For me, in Chrome OS X clicking on the ... next to the story title does nothing. That used to reveal the story summary.

@treygriffith
Copy link
Collaborator

@cgroner

Editing the source field does seem silly - it's the domain of the submission, so it should be constant. I still think the flag for a self-post should be separate, but it's a good rule in general.

After thinking about it, I actually don't think you should ever have a comment on a URL link - if you do, it's really just like a comment that is stuck to the top of the discussion, which likely isn't what we want to encourage.

In which case, the "summary" for a Link and the "summary" for a self-post really are the same field. So I think I agree with you on point 2.

I'm having the same issue as Matt in that the "..." on the main page doesn't reveal the summary of self posts.

@megamattron I accidentally posted a discussion on pullup.io (I thought it was localhost). Since we don't have a delete feature yet, could you dump it from the database?

@ghost
Copy link
Author

ghost commented Feb 12, 2014

OK, I see it now. I mistakenly thought you were talking about the summary on the thread/comment page. #178 Should resolve this.

It does make a good case for some regression tests :)

@megamattron
Copy link
Member

I think the ... thing just got fixed in #178 which just got pushed, try it out. I'm going to leave your discussion post and just use it as a way to announce the new feature :)

@treygriffith
Copy link
Collaborator

Works for me!

@megamattron For a case like this where the original implementation did not include a flag on the document indicating it is a self-post, but we want to change that going forward, how do you see us modifying existing documents in the database? Should we use a migration tool like mongo-migrate? This might be important enough to open a new issue to deal with.

@megamattron
Copy link
Member

@treygriffith a very good question. To be honest, I'm not sure. I've done this with relational DBs before, but not mongo. Go ahead and open a new issue and we can discuss.

@ghost ghost deleted the feature-self-post branch February 12, 2014 21:52
@ghost
Copy link
Author

ghost commented Feb 12, 2014

@treygriffith

Since each self-posts URL points to it's own ._id, couldn't we just use that to identify self-posts in the models isSelfPost method? It seems to me that the only thing that sets a self-post apart from any other is that it references itself.

@treygriffith
Copy link
Collaborator

Yeah, that's actually a much cleaner solution, and you're right that it's the only unique part of the self-post. And then issue #182 wouldn't come into play, we can punt on that a bit longer 👍

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

Successfully merging this pull request may close these issues.

2 participants