Page MenuHomePhabricator

Insert link tool no longer suggests articles based on selected text
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

*Open the Wikipedia iOS app.
*Edit an article.
*Highlight a portion of the text in the editor.
*Tap the "Insert link" button.

What happens?:
The expected list of suggested articles based on the selected text does not appear.

What should have happened instead?:
Previously, selecting text and tapping "Insert link" would bring up article suggestions relevant to the highlighted text.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Wikipedia iOS app (latest version, as confirmed by the user)
iOS operating system (latest version, as confirmed by the user)

Other information (browser name/version, screenshots, etc.):

IMG_1561 (1).jpeg (2×1 px, 235 KB)

Screen record.

Event Timeline

HNordeenWMF triaged this task as Medium priority.Mar 4 2025, 6:39 PM
HNordeenWMF moved this task from Needs Triage to Bug Backlog on the Wikipedia-iOS-App-Backlog board.

hi @Tsevener could you look into this task (timeboxed to less than 1 hr) and see if it might be related to the system navigation changes?

@HNordeenWMF Yes, this looks like a regression from system nav bar. On 7.6.4 (pre-system nav bar), the editor pre-populated the Insert Link search bar text with the text the user highlighted.

7.6.4-smaller.gif (497×240 px, 792 KB)

Hello. So the expected behavior is when a highlighted word is selected, and the link button is pressed, it should call the search function and return the relevant results?

I would like to work on a fix for this.
Is this handled in the EditorViewController or ArticleViewController class or am I looking in the wrong files?

Hi @KelCodesStuff !

Thanks for looking into this!

The video Toni shared highlights the expected behavior if you'd like a video, but the goal is for the highlighted word to have the link button pressed, and then when search opens up, we want the highlighted word to be in the search bar, and a search to have already been kicked off. As far as files, I'd recommend starting by looking in InsertLinkViewController - there's a Link struct that should hopefully be prepopulated with the highlighted word.

Let us know if you have any other questions, and thank you again!

Hi @GOlson-WMF @HNordeenWMF !

I was able to get this working by modifying the viewDidAppear method to check if the Link object has a page value, if it does, it populates the search bar with the text.

Here is the video.

Here’s the PR

KelCodesStuff changed the task status from Open to In Progress.Mar 12 2025, 8:07 PM
KelCodesStuff changed the task status from In Progress to Open.
KelCodesStuff changed the task status from Open to In Progress.Mar 22 2025, 8:34 PM