Page MenuHomePhabricator

Search image component for SVG Translate tool
Closed, ResolvedPublic8 Estimated Story Points

Assigned To
Authored By
Niharika
Sep 17 2018, 8:18 PM
Referenced Files
F27129905: Screen Shot 2018-11-08 at 2.56.25 PM.png
Nov 8 2018, 11:14 PM
F27129855: image.png
Nov 8 2018, 11:14 PM
F27129874: image.png
Nov 8 2018, 11:14 PM
F27129864: image.png
Nov 8 2018, 11:14 PM
F25983486: image.png
Sep 17 2018, 8:18 PM

Description

Value proposition (why do we need to do this)?

As a user, I want to be able to search for images from Commons so I can translate them.

Functionality and interface changes

  • Auto-complete image suggestions from Commons
    • Up to a maximum of 10 suggestions at a time
    • Only the image name appears in dropdown
    • Suggest translatable SVG images only
    • PrefixSearch with filetype=drawing
  • Strip away "File:" while searching if user enters that before the image name
  • The UI elements can either be, or use, the same design as the following OOUI elements:
  • Clicking (or pressing enter) on a suggestion populates the input box with the suggested image and automatically takes the user to the Translate view (we might change this behaviour later based on user feedback)
    • Input is populated and the page is redirected at the same time (like what happens when you search in Google).
    • Translate view can be blank for now

User interface changes

Screenshots/mockups:

image.png (1×2 px, 177 KB)

Does this need QA?

Yes.

Event Timeline

@Prtksxna Created this ticket for you to take on next. It's only for the search image feature in the tool.
Points in description with XXX needs you to add more detail. Also feel free to add anything I missed.

@Prtksxna I think we should clarify this bit further -

Clicking (or pressing enter) on a suggestion populates the input box with the suggested image and automatically takes the user to the Translate view

From our conversation yesterday it seems like we don't need to do the "populates the input box with the suggested image" bit, right? Clicking on suggestion should instantly take user to translate view?

From our conversation yesterday it seems like we don't need to do the "populates the input box with the suggested image" bit, right? Clicking on suggestion should instantly take user to translate view?

We'd want both, and the behaviour to be similar to what people see elsewhere (on Google, Wikipedia etc) where the input is populated and the page is redirected at the same time.

Niharika added a subscriber: Prtksxna.
Niharika triaged this task as Medium priority.Oct 2 2018, 11:37 PM
Niharika updated the task description. (Show Details)
Niharika set the point value for this task to 8.
Niharika moved this task from Needs Discussion to Up Next (June 3-21) on the Community-Tech board.

The first part of this is ready for review: https://github.com/wikimedia/svgtranslate/pull/14

It mostly is about adding OOUI and a custom search widget (that doesn't do anything yet).

I've switched the above patch to use SearchInputWidget as discussed, and it's ready for review again.

The autocomplete is functioning. It doesn't go anywhere yet, but that will come next.

Reviewed and had one small question/comment.

Did some testing on this.

I find the search results to be a bit off sometimes:

Screen Shot 2018-11-08 at 2.56.25 PM.png (846×1 px, 147 KB)
The first three results don't match up with the entered text (File). The ones after that do.
image.png (278×1 px, 32 KB)
In this one I was typing Cotton. I get unrelated results for Cott
image.png (202×1 px, 23 KB)
Nothing for Cotto
image.png (826×1 px, 154 KB)
Bunch of results for Cotton, as expected

@Niharika We are using the search API. We can take a look but it's possible these are just the vagaries of the search API and not much can be done about it by us.

Yes, I think we can't do much about the search API's vagaries.

We could switch to a prefix search though, if we are thinking that people will always be searching for a specific filename. We can't (as far as I can see) limit prefix searching to SVGs, but we could filter the results after retrieval (and do extra requests to progressively get up to ten results).

Niharika moved this task from QA to Q2 2018-19 on the Community-Tech-Sprint board.

@aezell Thanks for digging! It seems like a bug with the API to me. Should we file a ticket?

@Samwilson That's a fine idea. I'll keep it in mind and file a ticket for it separately, if needed, after talking to Prateek.

I'll close this ticket as the bug is not related to our work here.

@Niharika Good question. We can make a task. It may be working the way they want it to?

If they think returning Scarlet.svg is appropriate when the user searches for cott, then we have a bigger problem.