Page MenuHomePhabricator

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

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:

Does this need QA?

Yes.

Event Timeline

Niharika created this task.Sep 17 2018, 8:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 17 2018, 8:18 PM
Niharika updated the task description. (Show Details)Sep 17 2018, 8:18 PM

@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 updated the task description. (Show Details)Sep 20 2018, 6:51 AM
Prtksxna updated the task description. (Show Details)Sep 20 2018, 11:48 PM

@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 updated the task description. (Show Details)Sep 23 2018, 2:36 PM
Niharika removed Prtksxna as the assignee of this task.Oct 2 2018, 5:58 PM
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 To be estimated/discussed to Estimated on the Community-Tech board.
Samwilson moved this task from Ready to In Development on the Community-Tech-Sprint 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.

aezell added a subscriber: aezell.Nov 7 2018, 9:07 PM

Reviewed and had one small question/comment.

This is merged, and can be used on the test site now: https://tools.wmflabs.org/svgtranslate-test/

Did some testing on this.

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

The first three results don't match up with the entered text (File). The ones after that do.
In this one I was typing Cotton. I get unrelated results for Cott
Nothing for Cotto
Bunch of results for Cotton, as expected
aezell added a comment.EditedNov 8 2018, 11:18 PM

@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 closed this task as Resolved.Nov 15 2018, 11:07 PM
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.

Hahahaha. I can make a ticket.