Page MenuHomePhabricator

[User Story US-6] Reader taps a passage and lands in the article at that passage (Android)
Closed, ResolvedPublic1 Estimated Story Points

Description

User Story

  • As a reader
  • I want tapping a passage to take me to the exact place in the article it came from
  • So that I can read it in context without hunting for it

Where in the flow: Transition from the Dive sheet into the article view. Section jumping is a property of result presentation across all Phase 2 approaches, not a feature specific to this arm.

Acceptance criteria

  • Tapping a card or show more opens the source article scrolled to the passage’s section anchor.
  • The passage is highlighted in the article on arrival, spanning several consecutive lines, using the same token as the passage card in US-5.
  • The highlight does not persist across navigation or app restart.
  • The highlight sits behind the text without obscuring inline reference markers or links.
  • When the passage has no section anchor, the reader lands at the top of the article without an error.
  • Back from the article returns the reader to the search screen with the query, the entry point, and the autocomplete list intact — not to a blank search.

[] The query is written to search history so the reader can return to it (see US-10).
TS: Per sync with Jaz on Sept 16, it was decided that the query is written to the "recent searches" list when navigating to Article (current behavior for all users).

  • The tap is logged with enough detail to reconstruct the funnel: query, result position, article, section.

TS: There should be handling if we fail to seek out the article text and scroll / highlight it (i.e. if an article has since been edited to remove text). We should show an error message in that case (TBD by design).

Notes and open questions

  • Highlighting depends on the Search team’s highlighting work — a cross-team dependency, not work in this task.
  • Test behaviour when the anchor no longer exists in the live article because a section was renamed or removed.
  • On Android the article bottom toolbar already contains "Find in article" and may need to be suppressed for experiment to cut confusion.

Design

Figma: https://www.figma.com/design/s3KF9DqhJg2aAHpZBS8lwg/iOS---Android---%3E-Semantic-Search-%7C-Phase-2?node-id=6413-22884&t=sKpzy4DDZ0ptJTXq-11

Note: Both platforms - please update the "link" (iOS) and "progressive color" (Android) in black and dark mode to follow what we have in Codex. Noted in Figma. Android, please follow the same token as iOS.

Android: please update the highlight tokens to match iOS (find-in-page). We'll use the findInPageMatch token for semantic search highlights, and they vary by theme (dark/light) — see the reference image. Also, when text has a highlight behind it, blue links within that passage should switch to underlined — see Figma for an example. Let me know if you have any questions.

Screenshot 2026-09-18 at 4.27.37 PM.png (1,060×746 px, 159 KB)

Event Timeline

ABendall-WMF renamed this task from [User Story] Reader taps a passage and lands in the article at that passage to [User Story US-6] Reader taps a passage and lands in the article at that passage.Sep 8 2026, 7:55 PM

I think we can get the article scrolling/highlighting this automatically via text fragments:

Take the highlighted portion from the semantic search endpoint, and generate an article URL like this:

https://en.wikipedia.org/wiki/Cat#:~:text=Cats%20have%20excellent%20night%20vision

On iOS, the in-app web view automatically scrolls to this text and highlights it.

Good point here:

Test behaviour when the anchor no longer exists in the live article because a section was renamed or removed.

I assume the highlighted passage wouldn't even show up in the card. Or is there a chance the highlight is indexed, but the corresponding article was updated? If so, we should consider an error toast for those cases.

@Tsevener, instead of auto-scrolling, can the segment instantly show on screen? If the paragraph is way to the bottom of an article, the auto-scroll can be disorienting to users / cause motion issues.

Taiss has confirmed that this one is almost completed so bringing it into the 'Ready for sprint' so you can discuss in your meeting - Tais said she just needs to comment in the requirement

Eng sync questions:

Is it possible that the search result will return something embedded into tables?

There is a change that our regex could fail to find the result in the article (for example, if the article revision changed and that text no longer exists). We should show an error toast or something in that case.

Tsevener renamed this task from [User Story US-6] Reader taps a passage and lands in the article at that passage to [User Story US-6] Reader taps a passage and lands in the article at that passage (Android).Sep 16 2026, 8:22 PM
Tsevener set the point value for this task to 3.

Note:

  • There may be times where highlight breaks, and backend will fallback to key words that highlighted.
  • Expected that the highlight color on both semantic search results and article is the same (it's brighter on article right now).
  • Aim for jumping to highlight directly, no scrolling

2 questions about the requirements here, as I am doing the Design QA for iOS

When the passage has no section anchor, the reader lands at the top of the article without an error.

Does this mean that if there is no highlight, the reader lands at the top of the article?

The query is written to search history so the reader can return to it (see US-10).

We updated that - can we update the AC here too? See comment from Toni here: https://phabricator.wikimedia.org/T437049 ( Per our last sync, Queries only appear in recent-searches list, NOT incorporated in the history list alongside articles.)

cc: @ABendall-WMF

This comment was removed by TLessa-WMF.

Sorry for the GitHubPRBot confusion ^ I referenced the wrong task when opening the iOS PR.

Available in: TestFlight Wikipedia 2026.09.30 (6189)

Testing for design review / QA:

The latest APK can be found here: https://github.com/wikimedia/apps-android-wikipedia/actions/runs/37954394651/artifacts/11627812307

Setup:

  • Please download the APK and add it to your device or emulator
  • Go to Dev Settings and ensure that the desired switches are enabled (see example image)
    • semanticSearchEnabled: must be ON
    • semanticSearchFirstUse: can be ON or OFF
    • semanticSearchOverrideSupportLanguage -> ON = All languages enabled | OFF = ar, ja, fr only
    • semanticSearchIsTestActive: must be ON
    • apps_semantic_search: must equal 1
      DevSetting.png (1,344×2,992 px, 282 KB)

Testing

  • Navigate to the Search screen
  • Type in a query, then click on the semantic search card
  • Select an article from the dialog bottom sheet
  • click the back button to return to the results screen

DQA done. If the card has a highlight, it links to the article as expected. Sometimes the card has no link, but the article has a highlight. This is due to our decision to clip the article after 8 lines. The rationale was that we had to compromise here since some cards would be quite long, and they would push other results down.

Approved and moving to the next column

ABorbaWMF added subscribers: SNowick_WMF, ABorbaWMF.

Testing on 50612-alpha-2026-10-19
Tested on:
Pixel 8, Android 16
Galaxy A36, Android 15

Requirement✅❓❌Notes
Tapping a card or show more opens the source article scrolled to the passage’s section anchor.✅Works as expected
The passage is highlighted in the article on arrival, spanning several consecutive lines, using the same token as the passage card in US-5.✅Works as expected
The highlight does not persist across navigation or app restart.✅Works as expected
The highlight sits behind the text without obscuring inline reference markers or links.✅Works as expected
When the passage has no section anchor, the reader lands at the top of the article without an error.✅Works as expected
Back from the article returns the reader to the search screen with the query, the entry point, and the autocomplete list intact — not to a blank search.✅Works as expected
The tap is logged with enough detail to reconstruct the funnel: query, result position, article, section.❓I assume this is fine, but should be checked by @SNowick_WMF