Page MenuHomePhabricator

Add a simple way to reference a particular post in a Phabricator discussion
Closed, InvalidPublicFeature

Description

Feature summary : an ability to quickly reference a particular post in Phabricator discussion; thus for example not just [T339292] (the whole ticket) but [T339292#8936708] (a particular post)

Use case(s) : It is periodically necessary to reference a particular post in a local (Wikipedia) techforum. Because it is a summary of a problem/solution or other reasons. In a lengthily discussion the entire ticked and "search there by this sentence" is not a convenient option.

Right now I personally have to right-click the post, choose View code, find that the HTML element ID is 8936708, manually form the link [T339292#8936708], use it for local references.

Benefits : It would be helpful to have some "Copy link to this post" in the right drop-down of each post (where "Quote Comment" is)

Sorry in advance if something like this is already implemented and I just overlooked it.

Event Timeline

Right now I personally have to right-click the post, choose View code, find that the HTML element ID is 8936708, manually form the link [T339292#8936708], use it for local references.

Click the date/time next to the post.

Oh, a conveniently well hidden feature :-) - but it works (can be copied after from the address bar).
Well, I said "Sorry in advance", so the request should be closed then.

P.S. Just to mention: in order do not bother anyone - and myself - anymore with the issue, I wrote a primitive Tampermonkey script (see below).

It adds 🔗 button right after "... added a comment" at each post. on click it adds to clipboard a wiki-link to that particular post in the form [[phab:T000000#1111111|]]

It works fine to me, if ever needed - here it is under CC0 -

// ==UserScript==
// @name         PhabLink
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  to get a wiki-link to clipboard
// @author       Neolexx
// @license      CC0; https://creativecommons.org/publicdomain/zero/1.0/
// @match        https://phabricator.wikimedia.org/T*
// @grant        none
// ==/UserScript==

(function() {

'use strict';

var tic = document.location.pathname.substring(1);
var len = document.anchors.length;
var ref = null;

for (var i=0; i<len; i++) {
    if (document.anchors[i].className == 'phabricator-anchor-view') {
        ref = document.anchors[i].nextSibling.appendChild(document.createElement('SPAN'));
        ref.innerText = String.fromCodePoint(0xD83D, 0xDD17);
        ref.style.marginLeft = '1em';
        ref.style.color = '#4B4D51';
        ref.style.cursor = 'pointer';
        ref.title = 'copy wiki-link to clipboard';
        ref.onclick = new Function('navigator.clipboard.writeText("'.concat(
            '[[phab:', tic, '#', document.anchors[i].name, '|]]");'
        ));
    }
}

})();