Page MenuHomePhabricator

Consider ping parser function instead of link-based mention
Open, Needs TriagePublic

Description

https://www.mediawiki.org/wiki/User:Legoktm/pings

Pings suck because:

  • Based on username linking, which is used for other things... like linking to users (c.f. <code><nowiki>{{noping}}</nowiki></code> on enwp)
  • No way to verify you actually pinged someone
  • Requires a signature
  • Can't go back and adjust text to ping someone
    • Three preceding bullets are about same general issue, namely that you can't reliably trust pings to work
    • Technically possible to "go back" by re-signing the edit, probably?

Idea!:

  • Create a PST magic word thing so you type in "<nowiki>{{#ping:User}}</nowiki>", which upon save is transformed into "<nowiki>[[User:User|User]]</nowiki>" (and support multiple users with $wgContLang->commaList()).
    • Pinging has historically been a bit weird with template expansion; we used to have "phantom" pings caused by someone transcluding a page, mass-pinging, and then having that transclusion reverted
  • Echo hooks into PST somehow to do the transformation and note which users were mentioned
  • Easy for users to verify their pings went through
    • How?
      • Because if it went through, the wikitext would be transformed into <nowiki>[[User:User|User]]</nowiki>
    • Maybe use Special:Log to log pings?
      • Might help prevent abuse
  • Pinging has to be deliberate, but most people are already using the wrapper template so it shouldn't be too disruptive
  • Need to account for pinging abuse/mis-use
    • Current pinging has hard limit for users that can be pinged
      • Right, how do you handle the maximum ping limit? Does the parser function just not get transformed in this case?
        • We can also display a warning and stop the edit.

Notes:

  • Is this even technically possible???
    • Discussed in #mediawiki-parsoid on 2016-08-15 with Lego, Tim and MZ. Mostly these are Tim's recommendations:
      • Add a flag like Parser::SFH_SUBST_IMPLIED to Parser::setFunctionHook(), check it in Parser::braceSubstitution() before the check for mSubstWords
      • Note: Check for PST mode using <code>$parser->ot['wiki']</code>
      • Add new method to Content which returns the full ParserOutput as well as the new Content object; use Parser::getOutput() after preSaveTransform() returns and then prepareContentForEdit() would put the PST ParserOutput object into mPreparedEdit in a new member
  • On-wiki templates might be implemented differently, so overriding them with magic word might cause problems.
    • Syntax is different (<code><nowiki>{{#ping:foo}}</nowiki></code> instead of <code><nowiki>{{ping|bar}}</nowiki></code>), should be fine
  • What about saving pages that already have a old "ping" template on them? Will it trigger new notifications?
    • Matt pointed out that the syntax would be <nowiki>{{#ping:User}}</nowiki> so it wouldn't conflict.

Event Timeline

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

Re the reasoning: There are also so called "hidden pings" which are super annoyable (using constructions like {{#ifeq:{{{hide}}}|yes|<span style="display:none">}}@{{{1}}}{{#ifeq:{{{hide}}}|yes|</span>}})


Re the implementation: Please use the {{#ping:User1|User2|...}} form. (= have the trailing # there).

Perhelion subscribed.

I strongly support:

Create a PST magic word thing so you type in "{{#ping:User}}

It is absolutely disturbing to see how advanced users use it wrong (after 2 years). This would make also several tasks like T52393 obsolete.

Regarding "No way to verify you actually pinged someone" -> in Special:Preferences you can meanwhile configure to get notified if you pinged somebody or if pinging went wrong.

Practicable example what is intended from today
(I also opened a thread on German :WP:Echo - with only very small feedback)

Restricted Application added a subscriber: Liuxinyu970226. · View Herald Transcript
kostajh subscribed.

Growth-Team will not work on this in the short-to-medium term.