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 state | As the user types |
|---|---|
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.

