jerone / UserScripts

🐵 My UserScripts
https://github.com/jerone/UserScripts#readme
GNU General Public License v3.0
339 stars 39 forks source link

(Reply Comments) commented on [null] #143

Closed aspiers closed 5 years ago

aspiers commented 5 years ago

At some point fairly recently, this now generates attribution lines which read something like:

PERSON commented on null:

where null is the hyperlink to the quoted comment.

jerone commented 5 years ago

@aspiers commented on Jan 24, 2019, 1:56 PM GMT+1:

At some point fairly recently, this now generates attribution lines which read something like:

PERSON commented on null:

where null is the hyperlink to the quoted comment.

Hmmm, I can not reproduce this. Can you provide more details about where it happens...

aspiers commented 5 years ago

@jerone commented on null:

@aspiers commented on Jan 24, 2019, 1:56 PM GMT+1:

At some point fairly recently, this now generates attribution lines which read something like:

PERSON commented on null:

where null is the hyperlink to the quoted comment.

Hmmm, I can not reproduce this. Can you provide more details about where it happens...

It happens everywhere, as you can see here :-)

jerone commented 5 years ago

Can you provide the HTML from the header above (with class timeline-comment-header) this comment, where it says my name and when I commented.

Also, are you running any other UserScripts or add-ons that might be interfering?

aspiers commented 5 years ago

Sure, here's the HTML (with some blank lines near the beginning deleted for brevity):

<div class="timeline-comment-header clearfix rgh-timestamp-tree-link">
  <div class="timeline-comment-actions">
  <details class="details-overlay details-reset position-relative d-inline-block js-socket-channel js-updatable-content js-reaction-popover-container js-comment-header-reaction-button" data-channel="reaction:issue-comment:457761538" data-url="/_render_node/MDEyOklzc3VlQ29tbWVudDQ1Nzc2MTUzOA==/comments/comment_header_reaction_button">
    <summary class="btn-link timeline-comment-action" aria-label="Add your reaction" aria-haspopup="menu">
      <svg class="octicon octicon-plus-small add-reaction-plus-icon" viewBox="0 0 7 16" version="1.1" width="7" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 4H3v3H0v1h3v3h1V8h3V7H4V4z"></path></svg>
      <svg class="octicon octicon-smiley" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm4.81 12.81a6.72 6.72 0 0 1-2.17 1.45c-.83.36-1.72.53-2.64.53-.92 0-1.81-.17-2.64-.53-.81-.34-1.55-.83-2.17-1.45a6.773 6.773 0 0 1-1.45-2.17A6.59 6.59 0 0 1 1.21 8c0-.92.17-1.81.53-2.64.34-.81.83-1.55 1.45-2.17.62-.62 1.36-1.11 2.17-1.45A6.59 6.59 0 0 1 8 1.21c.92 0 1.81.17 2.64.53.81.34 1.55.83 2.17 1.45.62.62 1.11 1.36 1.45 2.17.36.83.53 1.72.53 2.64 0 .92-.17 1.81-.53 2.64-.34.81-.83 1.55-1.45 2.17zM4 6.8v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2H5.2C4.53 8 4 7.47 4 6.8zm5 0v-.59c0-.66.53-1.19 1.2-1.19h.59c.66 0 1.19.53 1.19 1.19v.59c0 .67-.53 1.2-1.19 1.2h-.59C9.53 8 9 7.47 9 6.8zm4 3.2c-.72 1.88-2.91 3-5 3s-4.28-1.13-5-3c-.14-.39.23-1 .66-1h8.59c.41 0 .89.61.75 1z"></path></svg>
    </summary>

<details-menu class="dropdown-menu dropdown-menu-sw add-reaction-popover js-add-reaction-popover anim-scale-in" aria-label="Pick your reaction" role="menu">
  <!-- '"` --><!-- </textarea></xmp> --><form class="reaction-popover-form js-pick-reaction" action="/users/jerone/reactions" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓"><input type="hidden" name="_method" value="put"><input type="hidden" name="authenticity_token" value="QtqI5bgFRGJvoKVxv+ge8OWanMWBBGuuhqq4EFoji+sFcxJEXfDPjW3kOjkrWZW11PpudOZrm3TZm9oJ+zko9Q==">
    <p class="text-gray mx-2 my-1">
      <span class="js-reaction-description">Pick your reaction</span>
      <img alt="" width="16" height="16" class="loading-spinner" src="https://github.githubassets.com/images/spinners/octocat-spinner-32.gif">
    </p>

    <div class="dropdown-divider" role="none"></div>

    <div class="add-reactions-options mx-1 mb-1">
      <input type="hidden" name="input[subjectId]" value="MDEyOklzc3VlQ29tbWVudDQ1Nzc2MTUzOA==">

        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="+1" name="input[content]" aria-label="React with thumbs up emoji" value="THUMBS_UP react">
          <g-emoji alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" class="emoji" title=":+1:"><img class="emoji" alt="+1" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png"></g-emoji>
        </button>
        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="-1" name="input[content]" aria-label="React with thumbs down emoji" value="THUMBS_DOWN react">
          <g-emoji alias="-1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44e.png" class="emoji" title=":-1:"><img class="emoji" alt="-1" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44e.png"></g-emoji>
        </button>
        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="Laugh" name="input[content]" aria-label="React with laugh emoji" value="LAUGH react">
          <g-emoji alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png" class="emoji" title=":smile:"><img class="emoji" alt="smile" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png"></g-emoji>
        </button>
        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="Hooray" name="input[content]" aria-label="React with hooray emoji" value="HOORAY react">
          <g-emoji alias="tada" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f389.png" class="emoji" title=":tada:"><img class="emoji" alt="tada" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f389.png"></g-emoji>
        </button>
        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="Confused" name="input[content]" aria-label="React with confused emoji" value="CONFUSED react">
          <g-emoji alias="thinking_face" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f615.png" class="emoji" title=":thinking_face:"><img class="emoji" alt="thinking_face" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f615.png"></g-emoji>
        </button>
        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="Heart" name="input[content]" aria-label="React with heart emoji" value="HEART react">
          <g-emoji alias="heart" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2764.png" class="emoji" title=":heart:"><img class="emoji" alt="heart" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/2764.png"></g-emoji>
        </button>
        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="Rocket" name="input[content]" aria-label="React with rocket emoji" value="ROCKET react">
          <g-emoji alias="rocket" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png" class="emoji" title=":rocket:"><img class="emoji" alt="rocket" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png"></g-emoji>
        </button>
        <button type="submit" role="menuitem" class="btn-link add-reactions-options-item js-reaction-option-item" data-reaction-label="Eyes" name="input[content]" aria-label="React with eyes emoji" value="EYES react">
          <g-emoji alias="eyes" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f440.png" class="emoji" title=":eyes:"><img class="emoji" alt="eyes" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f440.png"></g-emoji>
        </button>
    </div>
</form></details-menu>

  </details>

<details class="details-overlay details-reset position-relative d-inline-block ">
  <summary class="btn-link timeline-comment-action" aria-haspopup="menu">
    <svg aria-label="Show options" class="octicon octicon-kebab-horizontal" viewBox="0 0 13 16" version="1.1" width="13" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm5 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM13 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"></path></svg>
  </summary>
  <details-menu class="dropdown-menu dropdown-menu-sw show-more-popover text-gray-dark anim-scale-in" style="width:185px" role="menu">
        <clipboard-copy class="dropdown-item btn-link" for="issuecomment-457761538-permalink" aria-label="Copy link" role="menuitem" tabindex="0">
    Copy link
  </clipboard-copy>

        <button type="button" class="dropdown-item btn-link d-none js-comment-quote-reply" role="menuitem">
    Quote reply
  </button>

<details class="details-reset details-overlay details-overlay-dark lh-default text-gray-dark ">
  <summary class="dropdown-item" aria-haspopup="dialog" role="menuitem">

    Reference in new issue
  </summary>
  <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast Box-overlay--wide" aria-label="Reference in new issue" role="dialog">
    <div class="Box-header">
      <button class="Box-btn-octicon btn-octicon float-right" type="button" aria-label="Close dialog" data-close-dialog="">
        <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"></path></svg>
      </button>
      <h3 class="Box-title">Reference in new issue</h3>
    </div>

      <div class="Box-body overflow-auto">

<!-- '"` --><!-- </textarea></xmp> --><form action="/comments/issues" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓"><input type="hidden" name="authenticity_token" value="czfWn0Od2LrJteP27mjahzsT7OepP3Jj2b/ASBhIsrxFDhDn/WD5uFCRGEpAyCgkTpQx+Mym1U1UA74cWq+N2A==">
  <dl class="form-group">
    <dt><label for="convert-to-issue-repository-MDEyOklzc3VlQ29tbWVudDQ1Nzc2MTUzOA==">Repository</label></dt>
    <dd>
      <details class="details-reset details-overlay select-menu">
        <summary class="btn select-menu-button" data-menu-button="" aria-haspopup="menu">
          <input type="radio" class="d-none" name="issue[repository_id]" value="14820389" checked="">
          UserScripts
        </summary>
        <details-menu class="select-menu-modal position-absolute" style="z-index: 99;" src="/jerone/UserScripts/related_repositories" role="menu">
          <div class="select-menu-header">
            <span class="select-menu-title">Repositories</span>
          </div>
          <div class="select-menu-filters">
            <div class="select-menu-text-filter">
              <filterable-input src="/jerone/UserScripts/related_repositories" aria-owns="related-repositories-menu">
                <input type="text" class="form-control" aria-label="Type to filter" placeholder="Find a repository" autofocus="" autocomplete="off" spellcheck="false">
              </filterable-input>
            </div>
          </div>
          <include-fragment class="octocat-spinner my-6" aria-label="Loading"></include-fragment>
        </details-menu>
      </details>
    </dd>
  </dl>
  <dl class="form-group">
    <dt><label for="convert-to-issue-title-MDEyOklzc3VlQ29tbWVudDQ1Nzc2MTUzOA==">Title</label></dt>
    <dd><input id="convert-to-issue-title-MDEyOklzc3VlQ29tbWVudDQ1Nzc2MTUzOA==" class="form-control" type="text" name="issue[title]" value="Can you provide the HTML from the header above (with class `timeline-comment-header`) this comment, where it says my name and when I commented." aria-label="Issue title" autofocus="" required=""></dd>
  </dl>
  <dl class="form-group">
    <dt><label for="convert-to-issue-body-MDEyOklzc3VlQ29tbWVudDQ1Nzc2MTUzOA==">Body</label></dt>
    <dd><textarea id="convert-to-issue-body-MDEyOklzc3VlQ29tbWVudDQ1Nzc2MTUzOA==" name="issue[body]" class="form-control" aria-label="Issue body" edit_id="eta_5">Can you provide the HTML from the header above (with class `timeline-comment-header`) this comment, where it says my name and when I commented.

Also, are you running any other UserScripts or add-ons that might be interfering?

_Originally posted by @jerone in https://github.com/jerone/UserScripts/issues/143#issuecomment-457761538_</textarea></dd>
  </dl>

  <div class="d-flex d-sm-block">
    <button type="submit" class="btn btn-primary" data-disable-with="Creating issue..." data-disable-invalid="" data-ga-click="Issues, create new issue, location:comment_menu logged_in:true">
      Create issue
    </button>
  </div>
</form>
      </div>

  </details-dialog>
</details>

  </details-menu>
</details>

  <button type="button" title="Reply to this comment" aria-label="Reply to this comment" class="GithubReplyComments btn-link timeline-comment-action tooltipped tooltipped-ne"><svg class="octicon octicon-mail-reply" height="16" width="16"><path d="M6 2.5l-6 4.5 6 4.5v-3c1.73 0 5.14 0.95 6 4.38 0-4.55-3.06-7.05-6-7.38v-3z"></path></svg></button></div>

    <span class="timeline-comment-label text-bold tooltipped tooltipped-multiline tooltipped-s" aria-label="This user is the owner of the UserScripts repository.">
      Owner
    </span>

  <h3 class="timeline-comment-header-text f5 text-normal">

    <strong class="css-truncate">

  <a class="author text-inherit css-truncate-target rgh-fullname" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=55841" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/jerone" aria-describedby="hovercard-aria-description">jerone</a>

    </strong><a href="#issuecomment-457761538" id="issuecomment-457761538-permalink" class="timestamp js-timestamp"><span class="ghst-time time" datetime="2019-01-25T22:52:17Z">January 25, 2019 10:52 PM</span></a> <a href="/jerone/UserScripts/tree/HEAD@{2019-01-25T22:52:17Z}" class="timeline-comment-action btn-link rgh-timestamp-button tooltipped tooltipped-n" aria-label="View repo at the time of this comment"><svg aria-hidden="true" class="octicon octicon-code" width="14" height="16"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"></path></svg></a>

    <span class="js-comment-fragment">
      <include-fragment class="js-comment-edit-history d-inline">
      </include-fragment>
    </span>
  </h3>
</div>

I am running other userscripts and refined-github but I have no idea if one of those is interfering. However I can help debug if you give me hints on what to look for.

jerone commented 5 years ago

Personally I'm running Refined GitHub too, and no conflicts there. I also tried with clean profile. Or GitHub is testing some new feature on your profile or some Userscript is interfering. Maybe you can do some tests...

The HTML you posted above is missing the <relative-time>-element. image

aspiers commented 5 years ago

Ahhh, OK it must be a conflict with this userscript:

https://github.com/Mottie/GitHub-userscripts/wiki/GitHub-static-time

It's a nice userscript so it would be awesome if they worked nicely together ;-)

jerone commented 5 years ago

Ah that makes sense. Looking at the code I see that the whole element is being replaced. That perse is not bad, but it's missing the title-attribute here.

I can make a fallback to the .textContent property, but it would be so much better if @Mottie could add the title-attribute with the new time.

@aspiers Maybe you can send a PR to @Mottie...

Mottie commented 5 years ago

Oh! Yeah, I replaced the relative-time elements since they constantly update their own contents. I guess I could have hidden them... Anyway, I'm working on an update now.

jerone commented 5 years ago

@Mottie commented on January 29, 2019 3:38 AM:

Oh! Yeah, I replaced the relative-time elements since they constantly update their own contents. I guess I could have hidden them... Anyway, I'm working on an update now.

I see you updated your UserScript. Awesome.

Just installed the new version and I can confirm it works now (see above). @aspiers Let it know if it doesn't for you.

aspiers commented 5 years ago

@jerone commented on January 29, 2019 8:54 PM:

Just installed the new version and I can confirm it works now (see above). @aspiers Let it know if it doesn't for you.

As you can see it works for me too! Thanks so much both, you guys rock!