User Story
- As a reader
- I want to tap Dive and get passages from inside articles that answer my query
- So that I do not have to open several articles and skim them myself
Where in the flow: Dive bottom sheet, raised from clicking the entry point in the result list over the search screen.
Acceptance criteria
- Tapping the feature in the list raises a bottom sheet with a grabber, the title "Dive", the Beta pill, and a close control.
- Sheet header layout is the same on both platforms: title and Beta pill left-aligned, close control on the right.
- The sheet opens at a medium height and expands to full when the reader drags the grabber. On iOS this is the medium and large detents per Apple’s sheet guidance; Android implements equivalent behaviour.
- The sheet does not repeat the query. It is sized so the reader’s query stays visible on the screen behind or above it — that is what carries the context, and it is the stated reason for opening at medium.
- A loading state is shown while results are in flight (native behaviour)
- On success, passage cards are rendered in returned order; ranking is not re-sorted client-side.
- An empty result set shows a distinct empty state, not an error.
- Error states are handled and distinguishable: general failure, rate limiting, and backend unavailable.
- An in-flight request is cancelled if the reader dismisses the sheet. Keyboard isn’t active when bottom sheet is up.
- The sheet is dismissible by grabber drag-down, close control, scrim tap, and the platform back gesture, and returns the reader to the search screen with the entry point, the query, and the autocomplete list intact.
- Result count, logs, good abandonment parameters (talk to Shay) and latency are logged per query.
Notes and open questions
- The medium-first height is load-bearing for the decision not to repeat the query. If a platform cannot keep the query visible at that height, that is a design decision to make, not a silent fallback to echoing the query in the sheet.
- The prototype calls the MediaWiki Action API per language host; the production surface points at the Phase 2 semantic endpoint.
- The mockups show two to three cards at full height. Confirm the maximum number of passages and whether the sheet paginates, lazy-loads, or truncates.
Out of scope
Follow-up or conversational querying inside the sheet.
Generated or summarised answers — passages are word for word only.
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
Semantic search call:
https://{lang}.wikipedia.org/w/api.php?action=query&format=json&generator=search&gsrprop=snippet%7Csectiontitle%7Credirecttitle&cirrusSemanticSearch=hl&gsrsearch={searchText}&gsrwhat=text&gsrnamespace=0&prop=pageimages&piprop=thumbnail&gsrlimit=3&errorsuselocal=1&errorformat=html&formatversion=2Note the cirrusSemanticSearch=hl param - it triggers semantic search instead of lexical, and an hl value returns highlighted text within <span class=\"searchmatch\"></span> tags.
We should page results when the user reaches the bottom of the results, fetch the next 3 using a gsroffset= parameter.
For each search result:
- You will fetch thumbnail data to populate the image, as usual
Both the contributor and reference count data will come from the Attribution API, using a call like this:
https://{lang}.wikipedia.org/w/rest.php/attribution/v0-beta/pages/{title}/signals?redirect=true&expand=trust_and_relevance
- To populate contributor count, fetch and use contributor_count. Just a note that this currently returns null in the API, but it is on track to be implemented by the end of September.
- To populate references count, we will go with two approaches: A: For FR and JA Wiki, use the reference_count data point in https://{lang}.wikipedia.org/w/rest.php/attribution/v0-beta/pages/{title}/signals?redirect=true&expand=trust_and_relevance. B: For AR Wiki, use the last_updated data point in https://{lang}.wikipedia.org/w/rest.php/attribution/v0-beta/pages/{title}/signals?redirect=true&expand=trust_and_relevance. We will want to switch the label to Last Updated: (check with Design). We are falling back to last_updated date as a trust signal for now, because most AR Wiki reference_counts are currently null. Those are slated to be fixed around early November. We might make a followup task to switch AR Wiki back to reference_counts, if the experiment is still running.