Page MenuHomePhabricator

Show loading indicator when fetching a new version of the image
Closed, ResolvedPublic1 Estimated Story Points

Description

Value proposition

As a user, I would like to be informed whether the image preview fetch is in progress, especially in case of complex images where it may take longer, so I am aware that the tool is working as expected and that I need to wait for the preview to show up.

Proposed solution

  • Add an indeterminate progress bar below the image while it updates. Adding anything on top of the image might obscure part of what the person is translating. The progress bar is displayed from the moment the translation data is sent to the server for generating the PNG. The progress bar animation is stopped as soon as the preview renders.
  • Add cursor:wait to the image while the image preview is being generated.
Design

https://codepen.io/anon/pen/WYoVNy

Event Timeline

Niharika changed the task status from Open to Stalled.Nov 16 2018, 9:31 PM
Niharika triaged this task as Medium priority.
Niharika updated the task description. (Show Details)
Niharika moved this task from New & TBD Tickets to Product backlog on the Community-Tech board.

@Prtksxna Thanks for creating this. I will hold off on prioritizing this until the Preview ticket is complete and we have a sense of how fast/slow the feature is.

Niharika changed the task status from Stalled to Open.Jan 15 2019, 6:36 AM

The preview is indeed slow and this will help. Will prioritize this ticket for estimation.

Looks great. Will work much the same if we move to a box-o-leaflet as well.

Is it still a done thing to put cursor: wait on the image?

Looks great. Will work much the same if we move to a box-o-leaflet as well.

Is it still a done thing to put cursor: wait on the image?

Good idea! I'll add that to this ticket.

Niharika set the point value for this task to 1.Feb 7 2019, 12:34 AM
Niharika moved this task from Needs Discussion to Up Next on the Community-Tech board.
Samwilson moved this task from Ready to In Development on the Community-Tech-Sprint board.

(Sorry, I know I'm working on this out of order, but I'm on a train and it seemed quick.)

PR: https://github.com/wikimedia/svgtranslate/pull/78

Merged. This is now live on the staging site and ready for QA.

@Samwilson Previews are broken on the staging site and I think this feature caused it. I don't see the loading indicator either.

The entire staging site was broken (because I broke it). None of the right asset files were loading. I've fixed that and this feature seems to be working.

Okay, I tested this again and I can't get it to work every time. It works sometimes though and I'm not sure what's the cause.
Steps to reproduce:

  1. Go to https://tools.wmflabs.org/svgtranslate-test/File:Rsvg_text_rendering_test_2.svg
  2. Select a To language
  3. Enter text in label 1, press Tab, enter text in label 2, press Tab, enter text in label 3.

Expected outcome: Every time a new preview is generated, a loading indicator is seen.
Actual outcome: No loading indicator is seen.

It is possible that for this file the preview is generated really quickly and that's why I don't see it. If that's the case, let's put this in production so I can test with bigger files. It doesn't seem to cause anything to break.

You're correct, it's loading too quickly for the progress indicator to show. With a larger image it does show.

However, there's a bug I think: the indicator is removed after the response is received from the server rather than after the new image is loaded. The response contains the URL of the new image. I'll modify it to not remove the loading indicator until later on.

Merged and now live on the staging site. Ready for QA.

@Samwilson Looks good to me. Let's get this on production.

This has been included in version 0.4.0 and is now in production.