Page MenuHomePhabricator

Add a link: previously selected suggestion briefly shown when coming back from read mode
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Enable link recommendation, click on task from Special:Homepage
  • Click on a suggestion (other than the first one)
  • If on desktop, click on "Read"; on mobile, close the editor
  • Open "Edit" tab again

What happens?:
The suggestion that was previously selected is shown and then the first suggestion is selected again.

What should have happened instead?:
The first suggestion should be selected when coming back from read mode.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

addlink_reload_prevSuggestion.gif (982×1 px, 3 MB)

Note: This bug only occurs if the suggestion is clicked. If the suggestion is navigated to via prev/next buttons in the link inspector, the first suggestion is selected after coming back from read mode.

Event Timeline

When the user clicks on a suggestion and navigates to read mode, the link inspector is destroyed and set up again. onAnnotationClicked is called when setting up the link inspector again since mw.hook is used (if an event is fired, and a handler added afterwards, the handler is called right away with the last given argument).

Change 708574 had a related patch set uploaded (by MewOphaswongse; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@master] Add a link: No-op onAnnotationClicked when the handler is called when it's added

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

Change 708574 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add a link: No-op onAnnotationClicked when the handler is called when it's added

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