As part of the work to support Custom translation suggestions (T113257), users can define their areas of interest in order to get relevant suggestions. While the initial support for topic selection allows users to select one (T368422) or more (T369268) topics from a list. This ticket is focused on the support for users to search for a specific filter to apply.
Searching allows for users to find topic areas across a much wider topic space. They should be able to search for:
- Any of the items present in the "Adjust suggestions" menu (i.e., users can search for the "Videogames" option as a quick way to select this filter with no need for browsing).
- Any Wikidata topic to get similar suggestions to it.
- Lists of topics as part of group translation activities such as campaigns and wiki projects. This will be supported as part of the corresponding ticket about group translation support.
The core steps of the search process are illustrated below:
- Initial. A Search input component is used with a "Search topics or collections" placeholder.
- Focused. The focused state will follow the usual behaviour in the Search input component (e.g., the input focus will result into the virtual keyboard showing on mobile).
- Search results. Once the user provides some input, the elements below the Search input will be replaced by the search results. Some considerations:
- Clearing the search:
- Clear option ("x" icon) appears when text is present
- Clearing returns to previous state
- Implemented using the "end icon" property of Text input element -Loading.
- Result structure:
- The result items. The results will be displayed using the Menu item element.
- Flat list structure without group headers
- Visual differentiation through icons and metadata
- Result appear in order of relevance(article, topic, collections)
- Result types and presentation:
- Wikipedia/Wikidata articles:
- Thumbnail when available
- Title: Article name, 1 line, If more, truncate.
- Secondary text: 1 line article description. If more, truncate.
- Topic areas:
- Search icon.
- Title: Topic name, 1 line, If more, truncate.
- Secondary text: "Topic • Browse articles
- Collections:
- Article group icon(icon name - cdxIconArticles)
- Title: Collection name, 1 line, If more, truncate.
- Secondary text: "Collections • [X] articles
- Wikipedia/Wikidata articles:
- Clearing the search: