Page MenuHomePhabricator

Design spec for new Vue.js search experience
Closed, ResolvedPublic

Description

Design specifications for the new Vue.js search experience. Demo is available here: https://di-searchland-3.web.app/Pancake

Overview & terminology

There are three main elements in the search component:

  • Search box (input)
  • Search button
  • Results list

image.png (768×1 px, 148 KB)

Search box + search button

The search box follows OOUI guidelines in terms of styling and interactivity. Please refer to either OOUI or the demo for additional details.

Specs

Note: when the search box is inactive there's a border that wraps around the search box + the search button. It's a bit difficult to show in static mocks so please refer to the interactive demo.

image.png (182×663 px, 18 KB)

States
stateimagenotes
inactive
image.png (32×500 px, 2 KB)
bounding border #A2A9B1
hover search box
image.png (32×500 px, 3 KB)
search button becomes visible (OOUI/"Normal"), search box border darkens (#72777D)
hover search button
image.png (37×508 px, 4 KB)
search button background lightens (#FFFFFF) / text lightens (#404244), search box border initial
active & focus
image.png (54×524 px, 5 KB)
search box border (2px / #3366CC), search icon opacity (1), search box grows 20px wider from the left
has value
image.png (77×525 px, 16 KB)
search box text color #000 / bottom-left corner border radius (0)

Results list

The results list follows OOUI guidelines in terms of styling and interactivity. Please refer to either OOUI or the demo for additional details.

Specs

image.png (662×827 px, 129 KB)

Styling of page title
The part of the page title that does not match the search term will be bolded, e.g.

image.png (469×496 px, 20 KB)

Keyboard support
Keyboard support should match the current experience on Wikipedia. This can also be seen on the demo.

  • up/down keys to navigate to different search results
    • the text in the search box should update to reflect whatever result is currently selected
  • enter key to submit a search
States
hovering search result
image.png (190×457 px, 34 KB)
background darkens (#EAECF0)
initial load
image.png (80×525 px, 6 KB)
demo: https://di-searchland-2.web.app/
subsequent loads (if needed)
image.png (217×525 px, 35 KB)

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Initial sketches

Apologies for not posting sketches along the way. Here is some in-progress work from the past few weeks:

General terminology

image.png (890×2 px, 154 KB)

Search box states

image.png (613×2 px, 46 KB)

Configurability of the results list
We've learned that for some projects (e.g. Wikidata) it does not make sense to include thumbnails in the results list. For other projects (e.g. Commons) it might not make sense to include descriptions in the results list. Rough assumption: the more configurable the search component is the more places we will be able to use it in (e.g. mobile, portal, VE, etc.).

titledescription
image.png (416×420 px, 21 KB)
image.png (468×420 px, 43 KB)
thumbnail (left)
image.png (496×420 px, 50 KB)
image.png (496×420 px, 68 KB)
thumbnail (right)
image.png (496×420 px, 50 KB)
image.png (496×420 px, 69 KB)

Loading state for search box / results list on slow connections

image.png (897×1 px, 94 KB)

Thumbnail alignment challenge

Through discussions with the design team and others we've come to the conclusion that for the main search experience, in cases where we're including thumbnails in the results list, the best practice should be to left-align the thumbnails:

image.png (298×369 px, 15 KB)

However we also concluded that it'd be best to have the search term left-aligned with the titles (+ descriptions), which potentially leaves an awkward gap on the left-side of the search box:

image.png (392×369 px, 20 KB)

From there some questions arise:

  1. What, if anything, should we put in that weird gap space to make it less weird?
    image.png (1×1 px, 148 KB)
  2. Should the gap be present before the results list is rendered (like the images above)? Or should we extend the search box to the left by X pixels upon focus? Here is a GIF of what it might look like to expand the search box upon focus:
    search.gif (760×1 px, 216 KB)
  3. How context-specific is this solution? how will it work/not work in other places where we want to re-use the search component?
Custom icons & non-main namespace searches

[more in-progress design thoughts] the current search experience allows you to limit your search to specific namespaces by using Namespace:[search term], e.g. if I wanted to search for a specific user I could search User:Stephen. Currently in the mobile web search experience and the VE insert link search we show the generic thumbnail next to these results:

mobile webVE insert link
Screen Shot 2020-07-13 at 4.40.39 PM.png (464×397 px, 32 KB)
Screen Shot 2020-07-13 at 5.05.33 PM.png (570×398 px, 43 KB)

We might want to consider a more nuanced approach to these non-main namespace searches. Two options that come to mind:

  1. use a context-specific image - even if we didn't have have a custom image for every namespace we could at least cover the most popular ones and then use the generic thumbnail for the rest
    Screen Shot 2020-07-13 at 5.10.16 PM.png (541×543 px, 50 KB)
  1. don't display an image - this could be a little tricky if we pursue the offset in the input because then all of a sudden the result text is no longer aligned with the search text
    Screen Shot 2020-07-13 at 5.12.14 PM.png (435×533 px, 44 KB)

@alexhollender, these results look nicer but I don't think we have page namespace in the search responses.

Re: Namespace search. The search API only searches the main namespace unless the beginning of the query matches the namespace name exactly.

Screen Shot 2020-07-14 at 6.27.57 PM.png (262×712 px, 35 KB)
Screen Shot 2020-07-14 at 6.29.38 PM.png (212×690 px, 27 KB)
Screen Shot 2020-07-14 at 6.28.15 PM.png (364×700 px, 64 KB)
no namespace, only mainFuzzy namespace match, nopeExact match, yup

Technically, we could fetch the list of namespaces via the meta=siteinfo API, (sandbox link here) and match the namespace to the query based on that. However, this is certainly a non-trivial amount of work, an extra API request, and it's potentially Wikipedia specific. I don't know how we would set up different thumbnails for Wikiversity for example, which has a different set of namespaces like "School" and "Module". Maybe we could stick to common namespaces like "User" and "Template", but I'd certainly put this feature in the "nice-to-have" bucket.

@alexhollender one state that I didn't see in the designs above is when a user hovers/focuses on an actual search suggestion. It's not vital for mouse interactions but it helps with keyboard navigation.

Also re:Loading indicator, I think we have to take into account when we exactly we want that to appear, and how likely it is that someone will see it.
I don't know if we've settled on the loading strategy for the widget, but if we load the code for the widget lazily, e.g. we wait until someone focuses or hovers on the search input before we initiate the search-suggestion code, then it's likely that the initial search suggestions will be delayed (for the benefit of loading less code upfront). In this scenario it might be good to notify the users that some results are on the way, but if we show some sort of loading indicator on subsequent API requests, while users are typing, in between keypresses, I think that might be distracting.

Another often overlooked aspect of loading indicators is error-state handling. Infinite loading spinners are a sign that something went wrong, but that error is rarely conveyed to end users. I think if we have a loading state with text like "loading results...", we'll also have to include some sort of "no results found" or "error loading results" text as well.

@Jdrewniak, loading strategy hasn't changed as compared to the existing experience, except there's a lot more code to load. Code loads on focus. See T249306.

loading indicators is error-state handling.

I think you would be a good fit to work on T254695 when time allows. Regarding error handling, true, but we also have to keep the code smallish or users will have to wait until the code to load the code they actually want is available.

Misc. design updates

Input offset
My current thinking is to go with the a magnifying glass icon (🔍) on the left, and an explicit Search button on the right. See mockup below (or you can also check it out in the updated demo: https://di-search-3.web.app/Volvo)

Screen Shot 2020-07-16 at 4.59.38 PM.png (305×523 px, 56 KB)

One consideration to keep in mind here is that the word "Search" varies in length across languages. In the table below I've included an assortment of examples (also available in the demo via the language switcher):

languageimage
German
Screen Shot 2020-07-16 at 1.59.35 PM.png (113×535 px, 8 KB)
Burmese
Screen Shot 2020-07-16 at 2.01.54 PM.png (99×530 px, 9 KB)
Korean
Screen Shot 2020-07-16 at 1.59.53 PM.png (115×529 px, 7 KB)
Vietnamese
Screen Shot 2020-07-16 at 2.00.36 PM.png (123×521 px, 16 KB)
Russian
Screen Shot 2020-07-16 at 4.38.45 PM.png (70×530 px, 4 KB)

The various words for "Search" used above and in the demo are coming from the placeholder text found in the search box in Vector. So far the German word "Durchsuchen" is the longest I've encountered (though interestingly Google uses "Suche" and Ebay uses "Finden", so perhaps there are shorter alternatives - generally speaking, not just for German).

If the offset pattern as explored above is concerning to us, or ends up being technically complex, we can still consider:

  • eliminating the offset on the left altogether
    Screen Shot 2020-07-16 at 1.44.51 PM.png (298×536 px, 61 KB)
  • following the Google pattern, which avoids the need for a persistent icon in that area (see GIF below)
    expandingSearchBox.gif (95×829 px, 11 KB)

Width of search results menu
I was wondering if the width of the results menu should match the input field width PLUS the width of the button, or just the input width. Thus far 6 people (5 of them designers) have expressed a preference for matching the input field (option A below)

image.png (816×1 px, 202 KB)

cc @ovasileva

Search button refinements

Continuing to play around with the Search button. Based on some feedback from @Volker_E about there being too many mentions of "Search" (leading icon, placeholder text, button) I'm playing around with two ideas:

  1. what if we only showed the search button on hover/focus?
  2. what if we tried an ⮕ icon instead of the text “Search”?

Demo here: https://di-searchland.web.app/ (use the radio button in the gray box on the bottom corner to switch between text & icon)

texticon
Text.jpg (1×948 px, 261 KB)
Icon.jpg (1×948 px, 259 KB)

@MNeisler @Mayakp.wiki — we have been discussing various options for the search button for the new search component. Currently, in the existing search experience, there are 3 ways ways to submit a search:

  1. clicking the search icon on the right
  2. clicking on a result in the dropdown menu that appears once you start typing in the search box
  3. pressing enter on your keyboard
    Screen Shot 2020-07-27 at 1.12.38 PM.png (428×367 px, 89 KB)

Additionally, if you press the search icon (#1 above) without entering any text into the search box you are taken to the advanced search page (link).

I am wondering if we have any data on the usage of this button? I would be interested in knowing:

  • what percentage of submitted searches are submitted via the button?
  • how often is the button clicked with the search box empty?

noting that in VE insert link search widget there are custom icons for disambiguation and redirect results

image.png (350×415 px, 33 KB)

@alexhollender : Can you please file a task, set a priority and tag Product-Analytics ? We can triage this request tomorrow in our Board Refinement meeting.

I am wondering if we have any data on the usage of this button? I would be interested in knowing:

  • what percentage of submitted searches are submitted via the button?
  • how often is the button clicked with the search box empty?
Loading state

cross-posting here for those who aren't following T254695 — today I worked on a search loading experience. There are two possible states, though maybe we only need the initial one. Link to prototype.

initial loading experiencesubsequent loading experience (if needed / slow API?)
Screen Shot 2020-08-05 at 4.52.37 PM.png (417×803 px, 165 KB)
Screen Shot 2020-08-05 at 4.52.55 PM.png (420×805 px, 162 KB)
Search result title text formatting
Note: this may be out of scope for our project but wanted to add thoughts here in case we decide to work on it. Also this might be a bit of a moving deck furniture around situation, i.e. not worth spending much time on.

There are three different approaches I've seen regarding how to format the search result title in relation to the search term:

bold the matching portion (we do this currently)bold the non-matching portiondon't bold anything
single word
image.png (486×496 px, 17 KB)
image.png (486×496 px, 17 KB)
image.png (486×496 px, 17 KB)
multi-word
image.png (486×496 px, 19 KB)
image.png (486×496 px, 20 KB)
image.png (486×496 px, 19 KB)

It seems that bolding patterns shown above are most effective with a multi-word search term & results, particularly when the first word has been completed in the search box. For example with the term "Vermont" entered either of these options look good (though I do think that bolding the non-matching part is more helpful here):

Screen Shot 2020-08-07 at 4.32.43 PM.png (273×293 px, 26 KB)
Screen Shot 2020-08-07 at 4.25.36 PM.png (284×298 px, 28 KB)

When the search term & results are only one word the pattern seems much less helpful:

Screen Shot 2020-08-07 at 4.37.32 PM.png (272×293 px, 23 KB)
Screen Shot 2020-08-07 at 4.25.48 PM.png (282×300 px, 21 KB)

Based on that observation we could look at the data to see whether single word or multi-word search terms & results are more common. If single is more common we could ditch the bolding altogether. If multi is more common we could go with the pattern where we bold the non-matching part. Or if we don't think that the bolding presents an issue for single word search terms & results we could just go with bolding the non-matching portion without even looking at data.

Some other notes from recent conversations:

Bolding the matching portion

  • bolding the beginning highlights the content that has been confirmed by the user...since it is uniform in length it acts as a column that may add less visual noise (looking more like a block than a bunch of elements).
  • bolding the first part helps the user understand why the search result appears in the list.
  • why highlight the common piece in each suggestion?

Bolding the non-matching portion

  • Bolding the non-matching part emphasizes the part of the text that the user may be looking at, but may add more visual noise since lots of different elements of different size get emphasized. It also feels a bit weird when the bold part is a meaningless. That is, “Bread slicer” looks better than “Apple

Don't bold anything

  • Google has recently changed their suggestion bolding scheme—they don't apply bolding to "entities" (people & places with thumbnails and mini descriptions), but they do apply it to suggested searches. Maybe its time as a design pattern is over?
    image.png (572×387 px, 69 KB)

Also there was a discussion about this in 2017: T153417#3170622

When thinking more thoroughly about the current search experience in legacy Vector, the outlined current spec similar to the first iteration here on top T255603#6293760, there are a few things to consider:

Consider not having “Search” button at all
All the items in the autocomplete are direct actions and let you jump to another view. The buttons is labelled “Search”, but the action is actually a “Go”.
The only time the bound action is really “Search” is when there's no direct match for the query. In larger wikis that have a lot of articles that might be the exception, on smaller wikis, it would be more common.
With the instrumentation in T259766 soon taking place we should gather more insights how often the button is used.
But in order to cut the knot in confusing UI elements, it's worth considering to remove the Search button entirely under the current two-way bound action – and with ensuring to not add usability or accessibility hurdles.

Highlight color of active typeahead results
Current layouts use Accent90 as background color, this has been shortly proposed in T166560, but never got prioritized. Current interface standard is to use Base80 for :hover and Accent90 for (pre)selected items. Compare ComboboxWidget or Special:RecentChanges

Typeahead results should carry cursor:pointer
All results should carry pointer cursor, as all the results are direct action elements (see reasoning about unnecessary button above)

An experiment on marrying current widget's input padding and icon position with each other, normal state equals normal paddings, focus state indents the icon and the query input value position:

alexhollender_WMF updated the task description. (Show Details)

@Niedzielski @ovasileva this spec is as complete as I think makes sense. Any other details would be best discussed in individual tasks. Not sure what the next steps here should be. I'm happy to copy&paste certain parts to the appropriate tasks as we've done in the past.

noting that there's a loading state for the search on Wikidata, in case that's a useful reference:

2020-08-24 17.48.54.gif (466×628 px, 106 KB)

was just noticing that it's common for the search term to remain in the search box once the search has been submitted. I think this makes sense for search experiences where search leads you to a list of results. I'm not sure if it still makes sense in our case where you land on a specific result (rather than a list). Thoughts @RHo @Volker_E @ovasileva? I feel like it might help to reinforce what has just happened, though I'm not sure there's an issue with how it currently works.

Here are some examples of sites that keep the search term in the box after it has been submitted:

Screen Shot 2020-08-27 at 12.08.44 PM.png (905×1 px, 841 KB)
Screen Shot 2020-08-27 at 12.06.43 PM.png (905×1 px, 690 KB)
Screen Shot 2020-08-27 at 12.14.20 PM.png (905×1 px, 570 KB)
Screen Shot 2020-08-27 at 12.25.25 PM.png (905×1 px, 456 KB)

To further clarify with images:

current behavior
image.png (697×1 px, 323 KB)
image.png (686×1 px, 309 KB)
wondering if we should do this
image.png (697×1 px, 323 KB)
image.png (675×1 px, 304 KB)
In T255603#6416710, @alexhollender wrote:

was just noticing that it's common for the search term to remain in the search box once the search has been submitted. I think this makes sense for search experiences where search leads you to a list of results. I'm not sure if it still makes sense in our case where you land on a specific result (rather than a list). Thoughts @RHo @Volker_E @ovasileva? I feel like it might help to reinforce what has just happened, though I'm not sure there's an issue with how it currently works.

Here are some examples of sites that keep the search term in the box after it has been submitted:

Screen Shot 2020-08-27 at 12.08.44 PM.png (905×1 px, 841 KB)
Screen Shot 2020-08-27 at 12.06.43 PM.png (905×1 px, 690 KB)
Screen Shot 2020-08-27 at 12.14.20 PM.png (905×1 px, 570 KB)
Screen Shot 2020-08-27 at 12.25.25 PM.png (905×1 px, 456 KB)

Agree this seems to make more sense for experiences which lead to a results list, so that you can easily go in and modify/refine your search term ("elephant +asian", "toaster oven +bagel setting"), so it makes sense being kept in the Advanced search.

Another distinction might be that these other examples are where the intention of the search box is more about exploring more broadly (what are the different toasters available that match a specific criteria) vs search box on the Wikipedia page being more about finding specific articles that exist for a given subject. So once a user is on an article, its wikilinks enable navigation to related/more in-depth articles more quickly than changing the search term (e.g., the Elephant article has links to the specific Asian and African species).

Maybe there is no harm i leaving the search term there, but in that case it would be more important to have a "clear" button so users have a quick way to clear the search result. Also, ideally this is much more useful if the search box could provide better recommendations/related results than we currently do. Consider the Elephant example:

Alphabetically-related "elephant __" articles
image.png (812×1 px, 372 KB)
vs Google
image.png (652×682 px, 57 KB)

was just noticing that it's common for the search term to remain in the search box once the search has been submitted. I think this makes sense for search experiences where search leads you to a list of results. I'm not sure if it still makes sense in our case where you land on a specific result (rather than a list).

Just pointing out that we do in fact have a search results page https://en.wikipedia.org/wiki/Special:Search

If you submit the search query and land on that page (when there isn't an exact title match or redirect) that query does appear in the big search box.

Now why that page has two search boxes and the global one isn't integrated with that page at all is another question :P

@alexhollender - just to make sure I'm following. This is the current behavior:

  • Search that goes directly to the page - search results does NOT appear in the search box
  • Search that goes to the advanced search page - results does appear in the search box

And the question is whether we should also have it appear in the search box when you do go to a single page?

Just pointing out that we do in fact have a search results page https://en.wikipedia.org/wiki/Special:Search
If you submit the search query and land on that page (when there isn't an exact title match or redirect) that query does appear in the big search box.

Ah sorry, yes that's what I meant when I mentioned "Advanced search"

Now why that page has two search boxes and the global one isn't integrated with that page at all is another question :P

That would make a lot of sense, but I suspect is out of scope for this project... Although, how hard would it be technically to load the Special:Search results page with a header that doesn't include the searchbox?

@alexhollender - just to make sure I'm following. This is the current behavior:

  • Search that goes directly to the page - search results does NOT appear in the search box
  • Search that goes to the advanced search page - results does appear in the search box

Yes that's correct.

And the question is whether we should also have it appear in the search box when you do go to a single page?

Yes, that's what I was wondering about. To further clarify with images:

current behavior
image.png (697×1 px, 323 KB)
image.png (686×1 px, 309 KB)
wondering if we should do this
image.png (697×1 px, 323 KB)
image.png (675×1 px, 304 KB)

All tasks now created, resolving this

@TJones I was wondering if you have any opinions regarding the question I raised here: T255603#6416710?

In T255603#6463954, @alexhollender wrote:

@TJones I was wondering if you have any opinions regarding the question I raised here: T255603#6416710?

As a user, I find it very useful to have my query retained on a page with a list of results, in case I want to edit it because I didn't get the results I wanted (often because of a typo). I get annoyed at sites that don't do that.

I don't have strong feelings about keeping the search terms in the search box when you get to an individual result page (like a specific Wikipedia page). I would want to test it by enabling it for a small percentage of users and seeing how often they do another search with a similar query, versus rewriting it entirely, or not searching again.

At the extreme end of holding onto queries, I find it deeply weird that YouTube, for example, keeps your query in the search box as you navigate from video to video. Six clicks later and the query has nothing to do with the video you are watching. I guess it's an interesting bread crumb.