3

Possible Duplicate:
Direct Link to a Comment

SE sites assist users who want to link directly to questions or to answers. I believe they should also assist users who want to directly link to comments.

Use case: this answer has a link below it, titled "link" that can be clicked to provide me with a URL. However, I would like to link to the comment Ivo Flipse has added to that answer. Unfortunately, and in contrast to linking to the question (if I wished to do that), there is no obvious means to do so.

1

2 Answers 2

4

Probably a bad idea. Comments are second class citizens and often disappear from time to time. This could be because:

  • An accepted answer has over 20 comments, yet the useful comments were incorporated into the answer. At that time, a moderator may elect to remove excessively long comment threads.

  • A flame war broke out that resulted in a conversation so broken (after flagged comments were removed) that a moderator decided to just remove all comments.

  • A user deletes their own comment. This is far more likely than a user deleting their own question or answer.

In short, I think this would result in a lot of broken links.

Comments, officially are temporal conversations that should be used to provide clarification, point out mistakes, or anything else related to improving the quality of a post. I don't think we should be giving them any significance beyond what we do, which is the pundit badge.

3

Comments are meant to be so lightweight that this is not something contained in the core engine. Comments are also sometimes not loaded on the initial page load if there are too many, which causes problems with things like this.

However, on the Stack Apps site, a site for standalone apps and browser scripts to enhance the sites, you could search for an existing script or request one be written.

I am familiar with SE Modifications -- Username autocomplete in comments, inline revision source, and utility links which makes the timestamp of a comment become a link to the comment, but feel free to search for others.

5
  • But: please do not post links that only work with some client-side add-on installed. Only use them for, well, nowhere I guess!
    – Arjan
    Apr 23, 2011 at 7:23
  • @Arjan, you'll still be taken to the answer if the comment isn't displayed, so it isn't totally broken. Apr 24, 2011 at 3:07
  • Ah, I thought it created new ids for linking, but now I see it uses the existing ids from the HTML. Still then: a URL can only have a single "fragment" like #comment-219500. Using the fragment to link to a specific comment, replaces the fragment that links to the answer. So: the regular /questions/88565/allow-linking-to-comments/88567#88567 becomes /questions/88565/allow-linking-to-comments/88567#comment-219500. If that comment is deleted or hidden (if there are many comments) then the browser will not scroll at all, so one will effectively see the question, not taken to the answer.
    – Arjan
    Apr 24, 2011 at 7:30
  • @Arjan, I've previously tested it with putting in a bogus id number for the comment and I still get scrolled to the answer. I forget what browsers I tested it in though. Apr 24, 2011 at 16:48
  • That makes me curious, Rebecca! I really cannot see how a URL could have two fragments, and how the stock Stack Exchange HTML could ever handle that. And: I'm quite sure they simply don't. Maybe that user script fetches all comments (even if it does not show them)? Then we're back at my earlier concern: don't trust the URL to work when not having the script installed. That said: on Meta, I often do link to comments in answers, as some source of some statement. Shame on me... ;-)
    – Arjan
    Apr 24, 2011 at 22:12