Page MenuHomePhabricator

Allow to middle-click through to the Wikidata item from search results when adding Depicts statements
Closed, ResolvedPublic

Description

As well put by @LucasWerkmeister:

On Wikidata, when I search for an item and the results are ambiguous (e. g. similar works of art), I can middle-click on them to open the items and inspect them more closely, since the search results are links. Here, even though the individual search results have a “pointer” cursor, they’re not actually links and I can’t follow them. If I want to find out which item is the correct one, I have to figure that out on Wikidata and then copy the item ID and paste that here.

The workaround here is that 'choosing' a value does not save the claim, and gets you a hyperlink to the Q-item, so you can investigate the value that way ; but a middle-click would be much appreciated. :)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The fix here is relying on the default behavior of middle-clicks, which is to open links in a new tab. I've tested on a few browsers locally but it would be a good idea to check this more thoroughly on different devices during QA.

Everything works as far as I can tell (I don't have a 3-button mouse to test with), but it introduces some changes to design and behavior that we should make sure are desired.

Since this patch changes the markup of the autocomplete suggestion boxes to wrap everything in a link, there is a visual change (all text is now underlined inside):

Screen Shot 2019-09-16 at 8.01.35 AM.png (239×822 px, 26 KB)

Is this okay from a design/UX perspective? Since all the text inside the autocomplete box is now a link, as a user I'd expect that clicking would open a new window in a separate tab. But that's not what happens – instead, the "click" event is intercepted by the OOUI widget as a "choose" event. The user can right-click the text inside the box and select "open link in new tab" (I'm assuming the middle-click functionality is basically a shortcut for this), but that's a little more tricky and probably less likely to be used much.

One potential solution would be to keep the link in the markup, but to remove the link styling here – in theory this would allow users to still middle-click or right-click to open a new tab, but we'd otherwise give no indication that anything has changed (and potentially confusing users who are not using this feature).