Page MenuHomePhabricator

Discussion tools source mode should display navigation popups when enabled
Open, Needs TriagePublic

Description

Demonstration

  1. Enable the navigation popups gadget
  2. Load any talk page and open discussions tools (e.g. by replying to a post)
  3. In source mode, type any sequence of characters that includes an internal link, e.g. [[Brazil]]
  4. .
    1. Select the link in the editing window and mouse over the selection
    2. Mouse over the link in the preview

Expected results

  • (for both A and B) the navigation popup preview of the Brazil article opens

Actual results

  • (case A) nothing happens
  • (case B) a tootip showing the name of the linked page is displayed

Event Timeline

Thryduulf renamed this task from Discussion tools source more should display navigation popups when enabled to Discussion tools source mode should display navigation popups when enabled.Thu, Apr 8, 5:14 PM

For case A, I don't think we can do much, Popups only handles that in the old wikitext editor.

For case B, we might be able to fix this by using the 'wikipage.content' hook. Popups has some code that handles it, although I haven't tested it. This would also fix some other JavaScript enhancements, e.g. collapsible content (somewhat unlikely to appear in talk page comments, but still).

[for reference: https://en.wikipedia.org/wiki/MediaWiki:Gadget-popups.js]

Change 678031 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Fire the 'wikipage.content' hook on previews

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

Firing wikipage.content may however cause new issues as well. As far as I know, currently wikipage.content is always fired with the one and only content block on the page (although the documentation doesn’t state this). If it’s fired with the preview, this expectation is broken and this may cause undefined behavior regarding the rest of the page (as scripts may consider it to be removed from the DOM tree).