28 votes

Basic comment anchor links added

Tags: changelog

This is more of a stop-gap than a real solution, but it's now at least possible to link to a specific comment. On each comment, on the right side of the header "stripe", there's a # that links to that comment. It just uses an HTML anchor, so you're still linking to the full comments page, but it should scroll to the correct comment at least. You can also click the # on a comment from your notifications page or a user's page to go directly to that comment.

In the future we'll probably want to have a better view that highlights the linked comment more, and allows displaying context (the parent comments), but for now this should help a bit.

17 comments

  1. [2]
    Whom
    Link
    I honestly prefer the current implementation to what Reddit does. I don't see how having a page that only shows a specific comment is somehow better than jumping to the comment and giving me the...

    I honestly prefer the current implementation to what Reddit does. I don't see how having a page that only shows a specific comment is somehow better than jumping to the comment and giving me the option to look at what surrounds it if I like it. Especially on a site as lean as this, it's not like there's going to be scrolling weirdness caused by things loading in.

    Thanks for the addition, this is great!

    15 votes
    1. Amarok
      Link Parent
      Now that you mention it - I usually did make breaking out of the 'chain' view the first thing I did, to get the context. In fact I can't even see the value in having that silly shortened chain...

      Now that you mention it - I usually did make breaking out of the 'chain' view the first thing I did, to get the context. In fact I can't even see the value in having that silly shortened chain view - did they do it to reduce server load? Or did someone actually think viewing a tiny part of a thread without a larger context was a good thing?

      We definitely do not need to do it here. What we've got is already better than reddit.

      3 votes
  2. Emerald_Knight
    Link
    It's awesome to have at least something to link to a comment. It definitely makes navigation easier :)

    It's awesome to have at least something to link to a comment. It definitely makes navigation easier :)

    4 votes
  3. [14]
    crius
    Link
    Awesome @Deimos, but I think you skipped the inbox->unread page. There, it's probably even more important to understand the context of some replies you get, just an example here. I had to open the...

    Awesome @Deimos, but I think you skipped the inbox->unread page.
    There, it's probably even more important to understand the context of some replies you get, just an example here.

    I had to open the thread and CTRL+F for my name to get which comment it was referring to :D

    4 votes
    1. [13]
      cfabbro
      Link Parent
      Weird, the anchor is showing in reply notifications for me... Maybe with the dark theme the color of the # just matches the background too closely? It should be on the far right of the bar with...

      Weird, the anchor is showing in reply notifications for me... Maybe with the dark theme the color of the # just matches the background too closely? It should be on the far right of the bar with the username.

      1 vote
      1. [12]
        crius
        Link Parent
        I'm going to try in a second with the default theme, this is the HTML as I see it from the developer console (chrome on windows): <article id="comment-29g" class="comment" data-comment-id36="29g"...

        I'm going to try in a second with the default theme, this is the HTML as I see it from the developer console (chrome on windows):

        <article id="comment-29g" class="comment" data-comment-id36="29g" data-comment-depth="0" data-comment-user-tags="">
                  <div class="comment-itself" data-ic-id="2">
              <header>
                <button class="btn btn-comment-collapse" data-js-comment-collapse-button="">−</button>
                  <a href="/user/cfabbro" class="link-user">cfabbro</a>
                <time class="time-responsive" datetime="2018-05-21T05:42:59Z" title="2018-05-21 05:42:59 UTC" data-abbreviated="58m ago"><span class="time-responsive-full">58 minutes ago</span></time>
                <a class="comment-permalink" href="/~tildes/ky/basic_comment_anchor_links_added#comment-29g">#</a>
              </header>
              <div class="comment-text">
                <p>Weird, the anchor is showing in reply notifications for me...  Maybe with the dark theme the color of the # just matches the background too closely?  It should be on the far right of the bar with the username.</p>
              </div>
              <menu class="post-buttons">
                    <li><a class="post-button" name="vote" data-ic-put-to="https://tildes.net/api/web/comments/29g/vote" data-ic-target="#comment-29g .comment-itself:first" data-ic-src="https://tildes.net/api/web/comments/29g/vote" data-ic-verb="PUT" data-ic-trigger-on="default" data-ic-deps="ignore">Vote</a></li>
                  <li><a class="post-button" name="tag" data-js-comment-tag-button="">Tag</a></li>
                  <li><a class="post-button" name="reply" data-js-comment-reply-button="">Reply</a></li>
              </menu>
            </div>
            </article>
        

        Indentation is messed up "because chrome". The href is there but I can't see the # being rendered. Weird.

        Edit: Mistery solved. I was expecting the link to be close to the left side (where the timestamp was), instead it is aligned to the right :)

        2 votes
        1. [11]
          Emerald_Knight
          Link Parent
          User error may have been the problem, but "because chrome" hits just a little too close to home with some of the problems I've had to deal with trying to get something simple to work in that browser.

          User error may have been the problem, but "because chrome" hits just a little too close to home with some of the problems I've had to deal with trying to get something simple to work in that browser.

          1 vote
          1. [10]
            crius
            Link Parent
            Ah, mind sharing an example? I am a web developer by trade and honestly the only real headaches I recently got came from goddamn safari, rarely firefox, almost never chrome. Maybe you did some...

            Ah, mind sharing an example? I am a web developer by trade and honestly the only real headaches I recently got came from goddamn safari, rarely firefox, almost never chrome.
            Maybe you did some advanced / cutting-edge stuff with it and they weren't stable features yet?

            edit: I would like to tag myself as offtopic but apparently can only apply tags to other people comments. *heading to the feedback topic*

            3 votes
            1. [9]
              Emerald_Knight
              Link Parent
              Yeah, no problem. There's a really simple example, actually: the behavior when intercepting a checkbox toggle. There's a subtle but important difference in how the behavior occurs in e.g. Firefox...

              Yeah, no problem. There's a really simple example, actually: the behavior when intercepting a checkbox toggle. There's a subtle but important difference in how the behavior occurs in e.g. Firefox vs. Chrome. Specifically, one browser triggers the change event before committing the value toggle, whereas the other reverses the order and commits the value toggle before triggering the change event.

              Thus, if you e.g. want to defer fully committing the toggling of the checkbox until an Ajax request completes (if there's a server-side error, then you don't want the UI to incorrectly display a setting as enabled when it's still set as disabled server-side), then this will typically work with Firefox and other browsers but not so easily with Chrome, and attempting to write code that works equally correctly across all browsers is a massive pain in the ass.

              I could be wrong about some of the details as it's been a while since I had to deal with the problem, but that's roughly one of the problems I was dealing with.

              2 votes
              1. [8]
                crius
                Link Parent
                Oh my god, no, you're totally right and I ran into issues like this in the past as well. I ended up finding other way of designing the UI to not have to deal with these kind of issues most of the...

                Oh my god, no, you're totally right and I ran into issues like this in the past as well.
                I ended up finding other way of designing the UI to not have to deal with these kind of issues most of the time.
                Fortunately I've enough freedom in how I design the frontend at my current job, but yes, I totally understand your point now :-/

                2 votes
                1. [7]
                  Emerald_Knight
                  Link Parent
                  Haha, right? For that particular problem, I took the hacky route of covering the checkbox with an invisible overlay element and only triggered a click on the checkbox after the Ajax request...

                  Haha, right? For that particular problem, I took the hacky route of covering the checkbox with an invisible overlay element and only triggered a click on the checkbox after the Ajax request succeeded.

                  But oh well, it's not nearly as bad as having to deal with iOS compatibility. I had to modify an old, deprecated, minified (yes, that's right, I said minified) JS library last year in order to fix a critical feature. I can't even begin to tell you how much of a nightmare that was.

                  1 vote
                  1. [6]
                    crius
                    Link Parent
                    Oh god, don't make me started with the quirks of iOS browser's version. I just have received rumor of a change in device that will be used by staff on the ground and, inexplicabily, the web app...

                    Oh god, don't make me started with the quirks of iOS browser's version.

                    I just have received rumor of a change in device that will be used by staff on the ground and, inexplicabily, the web app used right now on windows tablet with Chrome, will have all the modals appear with a tighter width on iOS chrome.

                    Also I had to dig an obscure css (or maybe was an html meta) specific to make some design work on apple devices some weeks ago.
                    I swear to god everything apple does seems to be to piss me off. It's like they woke up one day and said "Hey, now that IE is gone for good who's going to make frontend development hell on earth?"

                    2 votes
                    1. [5]
                      cfabbro
                      Link Parent
                      What quirks with the iOS browser? It runs perfectly!... and so does Safari on macOS! Safari is the new IE.

                      What quirks with the iOS browser? It runs perfectly!... and so does Safari on macOS!

                      Safari is the new IE.

                      1 vote
                      1. [4]
                        Emerald_Knight
                        Link Parent
                        ...this wasn't always the case?

                        Safari is the new IE.

                        ...this wasn't always the case?

                        1 vote
                        1. [3]
                          cfabbro
                          Link Parent
                          Well, IE was IE at some point while Safari at least made an attempt to conform to the standards in a timely manner... but that does certainly feels like ages ago now.

                          Well, IE was IE at some point while Safari at least made an attempt to conform to the standards in a timely manner... but that does certainly feels like ages ago now.

                          1 vote
                          1. [2]
                            Emerald_Knight
                            Link Parent
                            That's true. Our tech evolves quickly enough that it's getting pretty difficult to accurately gauge how long ago certain changes occurred without being completely thrown off after looking it up.

                            That's true. Our tech evolves quickly enough that it's getting pretty difficult to accurately gauge how long ago certain changes occurred without being completely thrown off after looking it up.

                            1 vote
                            1. cfabbro
                              Link Parent
                              Yeah, years are going by in weeks now it feels like... and it's only going to get faster as we potentially approach the singularity, IMO. Ability of us and our governments to adapt to rapidly...

                              Yeah, years are going by in weeks now it feels like... and it's only going to get faster as we potentially approach the singularity, IMO. Ability of us and our governments to adapt to rapidly changing technology, culture and economics is going to get increasingly important or we're in for a world of hurt... especially once automation truly starts to take away jobs, even in fields that were once thought immune from it.

                              1 vote