User stories
As a Wikidata user, I want to be able to easily find other entity types (aside from items) using the platform's main search.
Background
- Description: The scoped search allows users to select an entity type from a dropdown attached to a search input. The users' selection will restrict the scope of their search.
- Previous implementations: No previous implementations of a similar solution have been found in our ecosystem. Nevertheless, this element is composed by two existing components that are available in the Codex library: Select and TypeaheadSearch. The latter being the component currently in use by Vector 2022 to provide a main search in all projects.
Design specifications
Acceptance criteria
The new scoped TypeaheadSearch component is implemented following the design specifications:
- The component's visual properties match the design guidelines (see design specs)
- The component's interactive properties match the design guidelines (see prototype)
- The component adjusts to different reading directions (LTR, RTL)
- The component is fully usable via keyboard
- The prefix selection automatically deselects any other namespace selections
Note: https://phabricator.wikimedia.org/T380031 The solution in this ticket can be used to quickly verify ux changes. Its a MVP product, so please let us know if there's anything super bonkers/unwieldy or particularly good
Open questions and considerations
- Ownership/maintenance: The scoped TypeaheadSearch pattern will be built using the combination of the Codex components Select and TypeaheadSearch, but it won't be introduced into the Codex library. We need to decide if this element would belong into a potential library of "LOD components" (see T338631)
- Based on the discussion in the Wikidata leads sync, let's add the new component to a library of "LOD components"
- Select menu header: The current implementation of the Codex Menu doesn't include a menu heading slot. We'll need to decide which team will implement that missing element. It's also unclear if menu headers should take descriptions (to be discussed with the Design Systems team).
- Wikidata will implement the Select Menu Header element.
- Select menu width: We need to adjust the Menu component (used by Select) to make it wrap (fit) its content by default and take a max-width (see linked specs for more details). This might need to be customized, the current width of the Codex's menu is 100% (of its parent).
- Should this be implemented as two separate components instead of a composite component? Possibly we would then need to only inject the select/menu into vector and could reuse the existing typeahead search component
Notes
- Skins: The new search solution will be implemented in Vector 2022 only. We’ll investigate and evaluate making the new solution available in other skins (Vector legacy, Minerva) if we get specific requests.







