Page MenuHomePhabricator

[User Story US-5] Reader can tell where a passage came from and who wrote it (Android)
Closed, ResolvedPublic2 Estimated Story Points

Description

User Story

  • As a reader
  • I want each passage to show which article and section it came from and how well sourced it is
  • So that I can judge whether to trust it

Where in the flow: Passage card inside the Dive sheet, and reused as the example card in onboarding. This is the provenance surface that Phase 2 research measured.

Acceptance criteria

  • Card anatomy, top to bottom: quote-mark glyph, passage text, source row (thumbnail plus trail), attribution row.
  • The passage is rendered verbatim with the answering portion highlighted behind the text. The highlight can span several consecutive lines and stops where the answer ends, mid-sentence if that is where it ends. Highlight should be provided via Action API.
  • A single highlight token is used on both platforms, and the same token is used for the in-article highlight in US-6.

[] Inline reference markers and links inside the highlighted run stay legible and is not stripped out.
TS: Broken off into T439910: Show link and references in semantic search results due to API constraints

[] The trail uses pipe separators and supports one, two, or three levels: article alone ("Night vision"), article and section ("Communication | Definitions"), or article, section and subsection ("Cat | Senses | Vision").
TS: It was agreed in a sync meeting that we will show up to two pipings. We will not show an in-between parent section to avoid an additional API call. This piping will only be Article Title | Whatever section the highlight is in (which might be a first level section or a nested section).

[] The attribution row shows a contributors count with a people icon and a references count with a chart icon, as two labelled figures.
TS: It was agreed via Slack that counts will work as follows:

FR, AR, JA
Will display contributor count, which will come from the Attribution API

FR, JA
Will display reference count, which will come from the Attribution API

AR
For AR Wiki only, we will display a "Last Updated:" date instead of the reference count written in absolute time. This content also comes from the Attribution API.

  • Attribution figures are per result card 
  • Article thumbnail is shown when one exists
  • If no thumbnail image exists in the article, we should let the copy occupy the full available space
  • All attribution numbers come from a real data source — no placeholder or synthesised values in a shipped build
  • The highlight meets contrast requirements in light and dark mode

Notes

Attribution presentation is what moved authorship identification in the Phase 2 studies — do not simplify it away without checking with research.

Design

iOS and Android - https://www.figma.com/design/s3KF9DqhJg2aAHpZBS8lwg/iOS---Android---%3E-Semantic-Search-%7C-Phase-2?node-id=5985-35300&t=lRnznnewYVAmkn1L-11

API Details

See T437039: [User Story US-4] Reader runs a Dive query and sees passage results (Android) description for API Details

Event Timeline

The design for this is mostly ready but we need to decide on "Show more" - what this will look like
Also need to address the highlight issue on Sepia - Tais to confirm with Jaz

ABendall-WMF renamed this task from [User Story] Reader can tell where a passage came from and who wrote it to [User Story US-5] Reader can tell where a passage came from and who wrote it.Sep 8 2026, 7:54 PM

We will estimate once we have a better idea of how highlighting / contribution and reference counts will work.

Discussed the Sepia theme with Jaz today. I'll meet with Derek next week to explore accessible highlight color options for the Sepia theme.
Explored Show more vs truncation and leaning more toward truncation because it is cleaner (the card is already dense), and "show more" may give users the idea that the card will expand from that view.

Screenshot 2026-09-09 at 5.03.03 PM.png (1,418×1,422 px, 340 KB)

@TLessa-WMF @JTannerWMF @ABendall-WMF

I have some initial questions about this:

  1. How many semantic search results are we expected to see on this view? Per my discussion with Android (@cooltey to confirm), they displayed up to 3 semantic search results. Would up to 3 be acceptable again this time?
  2. Is it expected that we display the reference number that exists only in that displayed snippet? Or only in that article section? Or is the reference count for the entire article acceptable?
  3. Same question as #2, but for contributor count.

Thanks!

For the full article not the snippet. True for both references.

Potentially look at splitting the highlighting to not block this task.

Eng sync:

Can we only have the breadcrumbs show Article title | Subsection? That's all the API gives us, we would need to make an extra API call to get the in-between section title. So for this call:

https://en.wikipedia.org/w/api.php?action=query&format=json&generator=search&gsrprop=snippet%7Csectiontitle&formatversion=2&cirrusSemanticSearch=1&gsrsearch=Can%20cats%20see%20in%20the%20dark

We would show Cat | Vision, not Cat | Senses | Vision

More eng sync:

Attribution API returns reference count, but not for AR Wiki. https://en.wikipedia.org/w/rest.php/attribution/v0-beta/pages/Cat/signals?redirect=true&expand=trust_and_relevance
Also it's v0-beta, which may be unstable

Potentially we could fetch references content of article and count it ourselves. Not great though.

Tsevener renamed this task from [User Story US-5] Reader can tell where a passage came from and who wrote it to [User Story US-5] Reader can tell where a passage came from and who wrote it (Android).Sep 16 2026, 8:00 PM
Tsevener set the point value for this task to 5.

Tais has confirmed this should be good to bring in from a design POV so adding into 'Ready for sprint' so you can focus on estimating this to bring in

Another eng sync question:

Is it possible that the search result will return something embedded into tables? That will highly affect what we can display in the search result view.

Updated this task to reflect:

  • Article thumbnail is shown when one exists
  • If no thumbnail image exists in the article, we should let the copy occupy the full available space
  • Removing mention of "Show more" because the design has changed (please see design for final design and spreadsheet for copy)

Hi @TLessa-WMF

The implementation is ready for review, please download the APK to see it.
https://github.com/wikimedia/apps-android-wikipedia/pull/6875

To test, please first go to the dev settings:

  1. semanticSearchEnabled: must be ON
  2. semanticSearchFirstUse: can be ON or OFF
  3. semanticSearchOverrideSupportLanguage -> ON = All languages enabled | OFF = ar, ja, fr only
  4. semanticSearchIsTestActive: must be ON
  5. apps_semantic_search: must equal 1

Hi @TLessa-WMF

AC: Inline reference markers and links inside the highlighted run stay legible and is not stripped out. Currently stripping out

This is expected. The API currently does not return in-article links to us, so there's no way to show the links in the semantic result cards.

@ABendall-WMF Can we remove this from the requirements?

Inline reference markers and links inside the highlighted run stay legible and is not stripped out.

Links and reference markers get stripped out at the API layer, and it would be a big lift for them to fix.

Hi @TLessa-WMF

Please download the APK from the PR below to see the changes and let me know if you have questions. Thank you.
https://github.com/wikimedia/apps-android-wikipedia/pull/6875

Seddon changed the point value for this task from 5 to 2.Sep 30 2026, 4:19 PM

Toni said that @JTannerWMF will review the semantic search tickets in 'Design Review' in place of Tais (since she's OOO for two weeks and Sarah is busy before going on leave for 2 weeks) and then move them to QA review

Moving this forward. @ABendall-WMF please create a clean up task for this one with a checklist taken from this document

ABorbaWMF subscribed.

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

Moving to Blocked. All Dives I used in English and French report 0 contributors. Reference counts are present.

Screenshot_20261008_212547_Wikipedia Alpha.jpg (1,080×2,340 px, 592 KB)

Hi @ABorbaWMF

This is ready again now at https://wheresmyapk.toolforge.org/

Please download the latest alpha from semanticSearchV2_design and follow the test steps below to see the change:

To test, please first go to the dev settings:

  1. semanticSearchEnabled: must be ON
  2. semanticSearchFirstUse: can be ON or OFF
  3. semanticSearchOverrideSupportLanguage -> ON = All languages enabled | OFF = ar, ja, fr only
  4. semanticSearchIsTestActive: must be ON
  5. semantic-search-phase-2: must equal 1

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

Requirement✅❓❌Notes
Card anatomy, top to bottom: quote-mark glyph, passage text, source row (thumbnail plus trail), attribution row.✅Works as expected
The passage is rendered verbatim with the answering portion highlighted behind the text. The highlight can span several consecutive lines and stops where the answer ends, mid-sentence if that is where it ends. Highlight should be provided via Action API✅Works as expected
A single highlight token is used on both platforms, and the same token is used for the in-article highlight in US-6.✅Assuming this is correct. It appears to be fine to me
Attribution figures are per result card✅Works as expected
Article thumbnail is shown when one exists✅Works as expected
If no thumbnail image exists in the article, we should let the copy occupy the full available space✅Works as expected
All attribution numbers come from a real data source — no placeholder or synthesised values in a shipped build✅Works as expected
The highlight meets contrast requirements in light and dark mode✅Works as expected