Page MenuHomePhabricator

MinT MVP: Search for topic
Closed, ResolvedPublic

Description

As part of MinT for Wiki Readers MVP (T359072), this ticket proposes to support users to find a specific topic they want to get a machine translation of. The user will reach this step form the "Home" step (T359401), and will continue to the "Confirm" step next (T359512).

Initial empty stateAs the user types
MinT Search Topic - Empty state.png (568×320 px, 24 KB)
MinT Search Topic.png (568×320 px, 22 KB)

Design details

This step includes the following elements:

  • Header. An action to go back to the "Home" step (T359401) using the ArrowPrevious icon, and the "Search a topic" title is shown at the top of the view. This step takes over the whole view for the user to focus on the activity.
  • Search bar. The search bar allows the user to find a topic (more details about search behaviour below). See the SearchInput Codex component.
  • Language tabs. Tabs allow to specify a specific language in which to make the search. See the Tabs Codex component.
    • There are up to three tabs shown: the "All" option which is always shown, and additionally 1-2 specific languages.
    • Initially, the specific languages are based on source and target languages selected in the previous step. For example, if the user selected "English -> Korean" at the "Home" step, the language tabs will show 3 tabs: "All", "English", and "Korean". However, if the user selected "All -> Korean" at the "Home" step, the language tabs will show 2 tabs: "All", and "Korean".
  • More languages ("…"). At the end of the tabs, a "…" action will lead users to the standard language selector (T287860) to pick a language to search in. The newly selected language will become the second tab. If the second tab was not empty, that language will replace the first tab. For example, with the initial 2 tabs ("All" and "Korean"), picking "Igbo" will result in three tabs ("All", "Korean" and "Igbo"). Then, selecting "Zulu" will result in 3 tabs ("All", "Igbo", "Zulu").
  • List of results. Items matching the search query will be shown in a list. They will include an image, title and description. Wikidata labels and descriptions will be shown in the language of the current tab, or, when "All" tab is selected, in the target language. See the MenuItem Codex component.

Empty states

When the query is empty, the search bar will show a placeholder and the search results will include a text:

  • Search bar placeholder: "Search for a topic"
  • Search results text: "Search for any topic. Contents for a topic can be different on each language."

Search behaviour

Searching is intended to be flexible to facilitate finding articles to translate from languages the user may not know. This is supported with different types of search and a flexible query approach.

Types of search:

  • Search term. When the user types a search term (e.g., "Moon") the search will work differently based on the selected language form the tabs:
    • When "All" is selected, the search will work as the Wikidata item search but including only items for which there is a Wikipedia article in at least one language. Wikidata items whose labels in any language match the search query will be selected.
    • When a specific language tab is selected. Search on the tab language Wikipedia is performed using both the user query term and an automatic translation of the query into the tab language. For example, selecting the "English" tab the user should be able to find the "Moon" English Wikipedia article by typing the term in both English and Korean (which could be translated into English in the absence of a better multilingual search support).
  • Wikidata Q-ID. Typing a Wikidata ID such as "Q2432366" which corresponds to the Moon Wikidata item will show the Moon result.
  • Wikipedia url. Typing (or pasting) a url to a specific article will show the article in the results. The "All" tab will be selected automatically if the article does not exist for the currently selected tab.

Additional considerations

Related Objects

Event Timeline

Pginer-WMF moved this task from Backlog to Product integration on the MinT board.
Pginer-WMF renamed this task from Mint MVP: Search for topic to MinT MVP: Search for topic.Mar 7 2024, 8:18 AM

Change #1025359 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] MinT MVP: Introduce search topic page

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

ngkountas changed the task status from Open to In Progress.Apr 29 2024, 2:08 PM
ngkountas claimed this task.

Change #1026500 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] MinT: Add usePageMetadata composable

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

Change #1025359 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] MinT MVP: Introduce search topic page

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

Change #1026500 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] MinT: Add usePageMetadata composable

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

Test status: QA PASS

  • Empty state : Search for a topic placeholder is displayed
  • Clicking the search bar: 3 tabs are displayed; All, Sorce language and Target Language
  • searching a topic that exists by typing: Article preview loads and is displayed ( image, title and description )
  • searching a topic that exists by using a link: Article preview loads and is displayed ( image, title and description)
  • searching a topic that exists by using a Wikidata ID: Article preview loads and is displayed ( image, title and description )
  • searching a topic that DOES NOT exist : BLANK white screen is displayed

Agreed, this needs some polishing work but the MVP was the context for the ticket.