Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reader] Implement "Tags" feed horizontal posts list item component loading #20634

Merged

Conversation

RenanLukas
Copy link
Contributor

@RenanLukas RenanLukas commented Apr 13, 2024

Warning

Should be merged after #20614

Fixes #20628

Screen.Recording.2024-04-15.at.7.01.45.PM.mov
Screen.Recording.2024-04-15.at.7.01.56.PM.mov

To Test:

The UI component is not being used yet, so in order to test it you can run HorizontalPostListItemLoadingPreview and compare with Figma specs.


Regression Notes

  1. Potential unintended areas of impact

    • None
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual testing
  3. What automated tests I added (or what prevented me from doing so)

    --


PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 13, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20634-c54757c
Commitc54757c
Direct Downloadjetpack-prototype-build-pr20634-c54757c.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 13, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20634-c54757c
Commitc54757c
Direct Downloadwordpress-prototype-build-pr20634-c54757c.apk
Note: Google Login is not supported on these builds.

…t' into issue/20268-implement-horizontal-post-list-ui-shimmer
…t' into issue/20268-implement-horizontal-post-list-ui-shimmer
@RenanLukas RenanLukas changed the title Issue/20268 implement horizontal post list UI shimmer [Reader] Implement "Tags" feed horizontal posts list item component loading Apr 15, 2024
@RenanLukas RenanLukas marked this pull request as ready for review April 15, 2024 22:11
isLoadingCompleted = false,
)
}
ShimmerBox(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe nitpick - I see creation of ShimmerBox instances with similar modifiers. Is there a way to further abstract these calls?

Copy link
Contributor Author

@RenanLukas RenanLukas Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniloercoli I think the color and shape repeats in many cases. The shape is not always the same, though, so maybe I can move the color to the ShimmerBox component? WDYT?

(Edit)
I've extracted the shimmer background color to the generic component.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Feel free to merge this PR.

@daniloercoli daniloercoli self-requested a review April 16, 2024 10:22
Copy link
Contributor

@daniloercoli daniloercoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Left a minor comment.

…t' into issue/20268-implement-horizontal-post-list-ui-shimmer
Base automatically changed from issue/20587-implement-horizontal-posts-list-ui-component to feature/tags-ia April 16, 2024 20:43
Copy link

@osullivanchris osullivanchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Looks cool so far. The shimmer color looks a bit too vibrant. Maybe it could be made more subtle, particularly on dark mode. I am not sure if the shimmer is a color or white/black with opacity. but if its white/black make it more transparent. If its a flat color, make it a color closer to the grey boxes.

@RenanLukas
Copy link
Contributor Author

@osullivanchris @daniloercoli Sorry, but I had to change the implementation of the shimmer. Could you please review it again?

@osullivanchris I saw your comment about the shimmer color, but since I had to change the implementation I decided to show you how it looks right now before changing the colors. Here are the updated videos:

Screen.Recording.2024-04-17.at.3.04.42.PM.mov
Screen.Recording.2024-04-17.at.3.04.28.PM.mov


background(
brush = Brush.linearGradient(
colors = listOf(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i got it correctly we're using hard-coded colours. Does it work fine with all theme settings (light/dark mode)?
Should we use a theme-appropriate colours? Or add the ability to color values to be passed as parameters ?

)
)
.onGloballyPositioned {
size = it.size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check if the size has changed to prevent unnecessary recompositions? something like

.onGloballyPositioned { layoutCoordinates ->
    val newSize = layoutCoordinates.size
    if (size != newSize) {
        size = newSize
    }
}

)
}

@Suppress("MagicNumber")
Copy link
Contributor

@daniloercoli daniloercoli Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's worth the effort, but we can introduce 2 new constants and avoid the MagicNumber annotation?

const val SHIMMER_START_MULTIPLIER = -2
const val SHIMMER_END_MULTIPLIER = 2

Copy link
Contributor

@daniloercoli daniloercoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments you may want to address. Among them, there is one about performance, which I would like to double-check with you, since this component will be used in a complex UI. Other than that, feel free to merge - 👍

@osullivanchris
Copy link

@RenanLukas it still looks a bit too intense to me. I tried a quick prototype. What worked for me was:

  • slower time for the shimmer to come across the screen (900ms in this example)
  • using white rather than black overlay in dark mode, so the shimmer actually makes it brighter, like light casting across it. I have used white with opacity.
  • I have a slight ease in / easy out animation happening so the shimmer feels more natural, not completely linear animation

Not sure how feasible this is or how much control you have. By the way, this could apply to any screen in our app.

shimmer.mov

Copy link

sonarcloud bot commented Apr 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

codecov bot commented Apr 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.15%. Comparing base (f1b2baf) to head (c54757c).
Report is 6 commits behind head on feature/tags-ia.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/tags-ia   #20634      +/-   ##
===================================================
- Coverage            40.33%   40.15%   -0.18%     
===================================================
  Files                 1474     1465       -9     
  Lines                67878    67522     -356     
  Branches             11225    11183      -42     
===================================================
- Hits                 27377    27114     -263     
+ Misses               38034    37959      -75     
+ Partials              2467     2449      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RenanLukas
Copy link
Contributor Author

As discussed in DM, the shimmer effect won't be implemented in this PR and will be taken care in #20679

This PR only implements the loading (grey rectangles) without shimmer effect.

@RenanLukas RenanLukas merged commit bbe122d into feature/tags-ia Apr 18, 2024
20 checks passed
@RenanLukas RenanLukas deleted the issue/20268-implement-horizontal-post-list-ui-shimmer branch April 18, 2024 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants