[go: nahoru, domu]

Page MenuHomePhabricator

Notifications in Echo on Wikidata should display label as well as Q id
Open, Needs TriagePublic1 Estimated Story Points

Assigned To
Authored By
Addshore
Oct 27 2015, 3:06 PM
Referenced Files
F37096881: image.png
Jun 7 2023, 3:36 PM
F34944055: Skärmbild från 2022-02-07 09-24-44.png
Feb 7 2022, 9:58 AM
F29469102: image.png
Jun 11 2019, 11:52 PM
F2882049: pasted_file
Oct 27 2015, 3:06 PM
Tokens
"Love" token, awarded by matej_suchanek."Love" token, awarded by Luke081515."Love" token, awarded by Sjoerddebruin.

Description

As an editor on the client using the Echo extension, I want to see the Item label as well as the QID in order to easily understand what Item a notification is referring to.

Problem:
Currently only QIDs are displayed in notifications regarding an Item, see image below:

pasted_file (96×420 px, 7 KB)

We would like to add the Item label as well to help editors on the client to easily understand what Item a notification is referring to.

BDD
GIVEN an editor on the client receives a notification
AND the notification refers to an Item
WHEN they open the notification
AND
THEN they can see the Item label in the UI language of the editor as well as the QID

Acceptance criteria:

  • Notifications referring to an Item have the Item label in the UI language of the editor as well as the QID

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore set Security to None.

A possible temporary hack: changing the local page

Your {{PLURAL:$4|edit on [[:$2]] has|edits on [[:$2]] have}} been {{GENDER:$1|reverted}} by [[$5|$1]]. $3

to

Your {{PLURAL:$4|edit on {{#switch:{{NAMESPACE:$2}}|{{ns:0}}={{Q|$2}}|{{ns:120}}={{P|{{PAGENAME:$2}}}}|#default=[[:$2]]}} has|edits on {{#switch:{{NAMESPACE:$2}}|{{ns:0}}={{Q|$2}}|{{ns:120}}={{P|{{PAGENAME:$2}}}}|#default=[[:$2]]}} have}} been {{GENDER:$1|reverted}} by [[$5|$1]]. $3

This would however require modifying pages for all languages and also other notifications such as the linked-page and thank-you ones.

Should Wikibase be using a Linker hook or something for this? So it works in all of the UI?

Now that additional links were removed from the notifications, my idea is obsolete...

What about having an optional interface message for the titles which would by default be "$1" and on Wikidata could be changed to "{{label|$1}}"? (Otherwise some hooks are needed.)

Not sure if I need to make another task, but there are also other notifications showing a Q id.

Yes, showing just the Q number is not very useful in most cases - it would be good to add label and perhaps description if these are available in the relevant language.

And yes, this should not just apply to revert notifications but to notifications on Wikidata more generally.

matej_suchanek renamed this task from Revert notifications in Echo on Wikidata should display label as well as Q id to Notifications in Echo on Wikidata should display label as well as Q id.Nov 29 2017, 8:33 AM
matej_suchanek awarded a token.
matej_suchanek added a subscriber: ChristianKl.
Lydia_Pintscher raised the priority of this task from Low to Needs Triage.Dec 21 2018, 7:17 PM
Lydia_Pintscher moved this task from External to Needs Discussion on the Growth-Team board.

I'm moving this back to incoming for both the growth and wikidata team as we both seem to have pushed this to the other one. We should figure it out because otherwise no-one does it ;-)

Catrope added subscribers: MMiller_WMF, Catrope.

We discussed this with the team earlier this week.

On a technical note (from me): this would require some Echo work to allow Wikibase to plug in and change how titles are rendered in notifications. I'm not sure offhand how that would be done, maybe through a hook. But I'm assuming that Wikibase already has a utility to get the display label of a given QID in a given language, in which case the hardest part of this task is figuring out how to cleanly integrate this into Echo (or rather, let Wikibase hook into Echo) without making the code in Echo overly Wikibase-specific/dependent.

On a product/planning note (from @MMiller_WMF): How important is this in the scheme of things that are being worked on for Wikidata? Our team is pretty busy, so we want to figure out what to do here.

On a product/planning note (from @MMiller_WMF): How important is this in the scheme of things that are being worked on for Wikidata? Our team is pretty busy, so we want to figure out what to do here.

I think it's not super critical on Wikidata itself. People there are used to the IDs and it's mainly an annoyance to have to take an additional step to figure out what's behind the ID. The picture changes for me when we're also showing IDs in notifications we're showing to Wikipedians because they are not as familiar with them. I'm not sure if we do have this issue right now as I don't remember the exact texts. There is one for example where we notify an editor about an article they created being connected to an item. It will become much more of a problem later this year when we start working on allowing editing of Wikidata directly from within the other projects.

Thanks, @Lydia_Pintscher. I'm going to triage this to Growth's "Q4" column, which means we will re-triage it again in April, and consider it as a task for Q4. Please let us know if something changes on your end, or if you all get to this task first.

JTannerWMF moved this task from Q1 2019-20 to External on the Growth-Team board.
JTannerWMF subscribed.

We are moving this task to External on our board as we believe Wikidata should work on it in parallel with T223686

So this and T223686 are both slightly different.

This task requires work to go into echo first to allow extensions to plug in and optionally format page titles / change the way they are displayed, as described in T116762#4874473.
The other task requires echo to allow extensions to plug in and optionally format edit summaries / change the way they are displayed.

I'm not 100% sure if the Wikidata teams should be poking around in echo too much when another team technically owns it though?
But perhaps a discussion has happened elsewhere that decided that we should do the whole thing? (not sure if I missed something)

I think it's not super critical on Wikidata itself. People there are used to the IDs and it's mainly an annoyance to have to take an additional step to figure out what's behind the ID. The picture changes for me when we're also showing IDs in notifications we're showing to Wikipedians because they are not as familiar with them.

I guess technically these messages do appear on wikipedias and other sites as we have global notifications!

For example, if I scroll through my read notifications:

image.png (219×619 px, 8 KB)

I guess technically these messages do appear on wikipedias and other sites as we have global notifications!

This is more than just technically true. Every day I start on my Wikimedia activities on my svwiki watch list and have a dropdown like this:

Skärmbild från 2022-02-07 09-24-44.png (355×514 px, 32 KB)

I can't be expected to be able to make an informed decision based on the q-id's. It would be useful with the labels to at least have a chance to know whether these seem to make sense or not and if I should further inspect them.

I started on a userscript that could show the labels instead of QIDs but was unable to get it to work and kind of gave up. Here's the link if anyone would like to try to get it to work: https://www.wikidata.org/wiki/User:Lectrician1/WikibaseEcho.js

I forked @Lectrician1's userscript and made a first working version: https://www.wikidata.org/wiki/User:Zvpunry/WikibaseEcho.js

So far, I've tested it with the "A link was made from Q218728 to Q202886." notification. That kind of notification should now read after a few seconds: "A link was made from Shire (Q218728) to Mordor (Q202886)."

Let me know what you think 🙂

I'm trying to work on this right now. I'm trying to implement the same mechanism that gets the title in the correct language for an entity that's shown on your Watchlist to work for the title shown on an Echo notification.

Ok, I did some investigation as to how entity page links on Wikibase wikis on your watchlist, Q templates, and other special pages currently render. Wikibase uses the https://www.mediawiki.org/wiki/Manual:Hooks/HtmlPageLinkRendererEnd hook to output a new title link that will be in the label and QID of the entity page if the page link requested is an entity page and is not an API request or non-Special page.

However, we don't need a HTML page link to output for an Echo notification. We just need the page title in the form of "<entity label> (<entity ID>)" as a string. To get this, we can use the same methods that Wikibase's HtmlPageLinkRendererEnd currently uses to output the entity label and ID. How should we implement this technically though? Should we make a RenderPageTitle Mediawiki hook for Wikibase to use?

Actually, what would be easier to implement and what would also make more sense from a UX perspective is if we changed the presentation model of Echo page notifications so that individual page names are links inside of the notification and not strings. That way we can use the current LinkRenderer which fires the HtmlPageLinkRendererEnd hook to render the page names as labels in the correct language.

I have filled a separate task proposing this change: T324848

Change 870732 had a related patch set uploaded (by Lectrician1; author: Lectrician1):

[mediawiki/extensions/Echo@master] Change notification page names to links

https://gerrit.wikimedia.org/r/870732

Change 874030 had a related patch set uploaded (by Lectrician1; author: Lectrician1):

[mediawiki/extensions/Wikibase@master] Output entity labels for page links API requests

https://gerrit.wikimedia.org/r/874030

karapayneWMDE set the point value for this task to 1.
karapayneWMDE subscribed.

2023 sprint 1 note - if review shows the patch is not ready, pass back to author and remove from sprint

@karapayneWMDE FYI the Growth team may not find the implementation I made to be be suitable as it makes the page names inside of notifications links instead of strings. In the past, Echo used to have links for page names in notifications but that was removed. I personally find benefits though to having links instead of strings though.

If you need me to create an implementation that does output strings instead of links, I can create a new MediaWiki hook for when the the string title of a page is retrieved that Wikibase can then modify to output the label of the entity page instead. I just need to know if that's what you need me to do - or some other implementation you come up with.

Also, tests have not been added on the Echo change yet as I don't know if this patch is good, but I'll add them when you let me know it's okay.

Change 874030 had a related patch set uploaded (by Lectrician1; author: Lectrician1):

[mediawiki/extensions/Wikibase@master] Output entity labels for page links API requests

https://gerrit.wikimedia.org/r/874030

Note that this wouldn’t just affect Echo: Wikibase would add entity labels to links in edit summaries whenever API requests return edit summaries. For example, if you get the edit summary of this edit using this API request, it currently looks like this:

<span dir="auto"><span class="autocomment">Changed claim: </span></span> <a href="/wiki/Property:P460" title="Property:P460">Property:P460</a>: <a href="/wiki/Q112795079" title="Q112795079">Q112795079</a>

‎Changed claim: Property:P460: Q112795079

With the change, it would look like this:

<span dir="auto"><span class="autocomment">Changed claim: </span></span> <a href="/wiki/Property:P460" title="‎said to be the same as‎ | ‎this item is said to be the same as that item, but it's uncertain or disputed‎"><span class="wb-itemlink"><span class="wb-itemlink-label" dir="ltr" lang="en">said to be the same as</span> <span class="wb-itemlink-id">(P460)</span></span></a>: <a href="/wiki/Q112795079" title="‎Wikidata Sandbox 4‎ | ‎sandbox for testing‎"><span class="wb-itemlink"><span class="wb-itemlink-label" dir="ltr" lang="en">Wikidata Sandbox 4</span> <span class="wb-itemlink-id">(Q112795079)</span></span></a>

Changed claim: said to be the same as (P460): Wikidata Sandbox 4 (Q112795079)

(Note that the “rendered” representation is pretty incomplete due to Phabricator limitations.) Is this something we want? (IMHO this could be considered a significant change according to the stable interface policy.)

Is this something we want? (IMHO this could be considered a significant change according to the stable interface policy.)

Decision from a call with Lydia: Yes, we want to do this; tracked at T327062: Show entity labels in parsed edit summaries in API requests as well.

Moving to Waiting until we’ve implemented T327062 (with feature flag) and decided when to announce and deploy the change.

Change 870732 abandoned by Lectrician1:

[mediawiki/extensions/Echo@master] Change notification page names to links

Reason:

Uh yeah this ain't happening

https://gerrit.wikimedia.org/r/870732

It looks like although the updates have been made to show entity labels in parsed edit summaries in API requests: T327062

There is still a piece missing here for Echo. Here is a screenshot of a recent notification:

image.png (79×500 px, 10 KB)