Homec4science

Reduce thumbnail flickering in comment previews

Authored by epriestley <git@epriestley.com> on Apr 6 2016, 23:48.

Description

Reduce thumbnail flickering in comment previews

Summary:
Ref T10262. Currently, we always render a tag like this when you {F123} an image in remarkup:

<img src="/xform/preview/abcdef/" />

This either generates the preview or redirects to an existing preview. This is a good behavior in general, because the preview may take a while to generate and we don't want to wait for it to generate on the server side.

However, this flickers a lot in Safari. We might be able to cache this, but we really shouldn't, since the preview URI isn't a legitimately stable/permanent one.

Instead, do a (cheap) server-side check to see if the preview already exists. If it does, return a direct URI. This gives us a stable thumbnail in Safari.

Test Plan:

  • Dragged a dog picture into comment box.
  • Typed text.
  • Thing didn't flicker like crazy all the time in Safari.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10262

Differential Revision: https://secure.phabricator.com/D15646

Details

Committed
epriestley <git@epriestley.com>Apr 7 2016, 00:52
Pushed
aubortJan 31 2017, 17:16
Parents
rPH8aad862cd4e2: Normalize casing on property boxes
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH5664c838fbbc: Reduce thumbnail flickering in comment previews (authored by epriestley <git@epriestley.com>).Apr 7 2016, 00:52