Open Bug 1858020 Opened 1 year ago Updated 11 months ago

Bring back Crossfade animations for Review Checker shadows

Categories

(Fenix :: Shopping, task, P3)

All
Android
task

Tracking

(firefox119 wontfix, firefox120 wontfix, firefox121 fix-optional)

Tracking Status
firefox119 --- wontfix
firefox120 --- wontfix
firefox121 --- fix-optional

People

(Reporter: verdi, Unassigned)

References

Details

(Whiteboard: [fxdroid] [fakespot-android-mvp])

Attachments

(1 file)

Attached video shadows.mp4

Steps to reproduce

  1. Open the review checker

Expected behavior

When the the cards load, they appear fully rendered.

Actual behavior

When the cards load, the shadows on the sides of the cards (and the shadow on the top of the first card) are missing. Then they pop in after everything else is loaded.

Device information

  • Firefox version: 120.0a1 (Build #2015978850)
  • Android device model: Samsung Galaxy S9
  • Android OS version: 10

Any additional information?

Blocks: 1857981
Severity: -- → S3
Priority: -- → P2
Whiteboard: [fxdroid] [fakespot-android-mvp]

Hey Verdi, I think this is because of a crossfade transition we're currently applying between the loading animation placeholder and the product analysis. This effectively causes the loading animation to still be present for ~300ms as the UI transitions to the product analysis.

Should we instead opt for an instantaneous state transition (i.e. no animation) between these two states?

Let me know if you would like to do some paired prototyping.

Assignee: nobody → nbond
Status: NEW → ASSIGNED
Flags: needinfo?(mverdi)

Why does the transition not affect the shadows on the top and bottom? I don't know what happens in code but it appears as if the transition is limited to a box that is the with of the cards without a shadow but includes the space between cards. Then once the transition is done we go, "oh I have to expand the box to show the full shadows (the stuff on the side)." I'd like to see if we can fix that instead of removing the transition.

Flags: needinfo?(mverdi)

After doing ~8 hours of investigating into this so far, this is likely an issue with the Crossfade component from Google causing unnecessary recompositions (full re-draws) of the UI. (Crossfade is an animation wrapper API that's supposed to make it seamless to animate state changes) An additional hypothesis could be that this component does not play well with animating state changes involving elevation (shadows), further exacerbating the recomposition issue.

Technical notes can be found here

Hey Chris and Verdi, after spending a few more hours investigating this, I wanted to post my notes here for whoever picks this up.

Findings

It is indeed an issue of using Crossfade combined with some weirdness of having it synced into our Redux pattern.

Expanding either the settings or grade info cards causes a full recomposition here.

  • To handle this, the crossfade should ignore state changes that are simply data model updates (e.g. a card expansion boolean was changed).

As a sanity check, I removed the elevation from all of the the cards and confirmed that there aren't any other weird visual artefacts appearing as a result of the Crossfade. So it is for sure a weird interaction of the Crossfade wrapper transitioning something that has elevation (elevation is the UI property on Android that drives the rendering of shadows).

Local branch I was using to debug

Recommendations

  • We should still fix the recompositions (the redraws of the UI) to help with performance as part of Bug 1859984.
  • Two options for the short term are in front of us for this particular issue: 1) Gut the Crossfade 2) Ignore it until we have time for a proper fix.
    • Option 1 would at least hide the UI weirdness (if the defect is highly undesirable) until a better animation solution can be found.

Either short term fix won't fix the unnecessary recomps, so that should still be a priority.

Assignee: nbond → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(cpeterson)

We should still fix the recompositions (the redraws of the UI) to help with performance as part of Bug 1859984.

Will fixing bug 1859984 resolve this shadow issue? Or just make it less obvious?

Two options for the short term are in front of us for this particular issue: 1) Gut the Crossfade 2) Ignore it until we have time for a proper fix.
Option 1 would at least hide the UI weirdness (if the defect is highly undesirable) until a better animation solution can be found.

Does this Crossfade issue only affect the Review Checker? Does this issue all Android OS versions?

Does "gutting the Crossfade" mean removing the component? Do we use it in UI components besides Review Checker?

Flags: needinfo?(cpeterson) → needinfo?(nbond)
See Also: → 1859984

Will fixing bug 1859984 resolve this shadow issue? Or just make it less obvious?
It could help make it better, but I believe they're two distinct issues.

Does this Crossfade issue only affect the Review Checker?
Yes; the Crossfade component is only being used in the Review Checker.

Does this issue all Android OS versions?
Yes (maybe not Android 5, as the shadows rendered on that version aren’t the same as 6+).

Does "gutting the Crossfade" mean removing the component? Do we use it in UI components besides Review Checker?
Yes. It is not being used anywhere outside of Review Checker (it's used in two locations).

Flags: needinfo?(nbond)
See Also: → 1865452

Crossfade animations were removed in bug 1865452.

Type: defect → task
Summary: Shadows pop in when sheet loads → Bring back Crossfade animations for Review Checker shadows
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: