We've already seen and felt some confusion between TypeaheadSearch and Lookup while building Codex and observing others starting to use Codex. Let's consider how we can better differentiate between the two and clearly show their distinct use cases in the code and in the docs.
Some ideas:
- Give the components more precise names. The names of the components currently do not differentiate them at all; they essentially mean the same thing. We may want to consider giving TypeaheadSearch a name that indicates its narrower use case, like PageSearch
- Clarify the different use cases in the docs. Lookup is a much more generic component that will be the right choice in most cases, while TypeaheadSearch is specifically meant to search pages and provide links to other pages for the user to visit. We should clarify this in the docblock of each component, which will also display on the components' doc pages.
- Consider moving TypeaheadSearch. We have discussed the idea of separating out components that cover specific use cases and are more app-like than component-like. Perhaps TypeaheadSearch should live in its own package, or we should have a separate folder within the codex package for [name of something bigger than components, like how molecules are composed of atoms?]