Page MenuHomePhabricator

[Alpha/Labs] Add "no results found" state for depicts auto-suggest dropdown
Closed, ResolvedPublic

Description

Problem:

When attempting to add an item that does not have a Wikibase entity stored, there is no message informing the user that the entity does not exist:

Example GIF:

zero-depicts.gif (242×668 px, 57 KB)

Expected Behavior:
The dropdown should display a "No results found" element as below (bg color #fee7e6)

autosuggest-zero.PNG (84×543 px, 5 KB)

Event Timeline

Change 493131 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] Display a "no results found" message in Depicts autocomplete widget

https://gerrit.wikimedia.org/r/493131

@Ramsey-WMF and @PDrouin-WMF, I just submitted a patch to handle this scenario. You can see the new UI for "no results found" in context below:

Screen Shot 2019-02-26 at 3.54.25 PM.png (1×2 px, 1 MB)

I'm relying on the OOUI MenuOptionWidget for this, since that's what pops up when there is a successful match. I have set the element to disabled so that the user can't select it, but I don't know how to make this element red without resorting to hacking my own style overrides. However, my feeling is that making the box red might be sending a stronger signal than is needed – the user hasn't done anything wrong necessarily, they are just searching for something that does not exist yet.

For text, I've currently set the label to read No results found. Let me know if that should change and I'll update the messages.

Sweet! Pending code review, this looks like it's mostly there. I'll leave the decision on the coloring of the element to @PDrouin-WMF (I'm fine with the "salmon" colored #fee7e6 color that is currently desired, and there is precedent for its use).

@egardner's patch looks great - merged it (with white background)
If we want to change copy or background colors, we can submit follow-up patches.

Change 493131 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Display a "no results found" message in Depicts autocomplete widget

https://gerrit.wikimedia.org/r/493131