-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Reader] Implement "Tags" feed horizontal posts list item component loading #20634
Conversation
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
…t' into issue/20268-implement-horizontal-post-list-ui-shimmer
…t' into issue/20268-implement-horizontal-post-list-ui-shimmer
isLoadingCompleted = false, | ||
) | ||
} | ||
ShimmerBox( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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
There was a problem hiding this 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.
@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.movScreen.Recording.2024-04-17.at.3.04.28.PM.mov |
|
||
background( | ||
brush = Brush.linearGradient( | ||
colors = listOf( |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this 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 - 👍
@RenanLukas it still looks a bit too intense to me. I tried a quick prototype. What worked for me was:
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 |
Quality Gate passedIssues Measures |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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. |
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
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
--
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones):