Skip to content

Discover message card design #5590

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

Open
wants to merge 16 commits into
base: recommended-reading-list-design
Choose a base branch
from

Conversation

Williamrai
Copy link
Collaborator

What does this do?

  • adds recommended reading list discover card

Phabricator:
https://phabricator.wikimedia.org/T394055

- code/ui fixes
- adds compose layout on ReadingListsFragment.kt
- adds a function get 4 latest images for recommended reading list
- instead of retrieving images url now gets the new recommended articles
@Williamrai Williamrai changed the base branch from main to recommended-reading-list-design May 23, 2025 15:52
) {
Column(
modifier = Modifier
.weight(1.1f),
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure but should this be a fixed dimension based on the design?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This weight is for horizontal distribution. I'm not using a 1 to 1 because it makes the image slightly wider, which doesn’t look visually good.

LazyVerticalGrid(
modifier = Modifier
.clip(RoundedCornerShape(12.dp))
.weight(0.9f),
Copy link
Contributor

@voyagerfan voyagerfan May 28, 2025

Choose a reason for hiding this comment

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

Same question about the fixed dimension here (based on design dimensions or is it OK to use weights)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes it is okay to use weights.

Comment on lines 145 to 146
placeholder = ColorPainter(WikipediaTheme.colors.borderColor),
error = ColorPainter(WikipediaTheme.colors.borderColor),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @Williamrai This looks like a fallback which is a great idea. I was wondering if the color was ok to use? I couldnt find an example of a placeholder/error color.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm using the default color we typically use for placeholders, and I'm also applying the same color for errors. You can refer to the loadImage function in the CoilImageServiceLoader class.

@@ -60,6 +63,23 @@ fun Modifier.pulse(
}
}

fun Modifier.rippleClickable(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @Williamrai I like this extension function! It definitely provides consistency for ripple behavior when clicking. One thought I had was the usage of the function. If we plan to use it a lot then its definitely worth keeping but if it sees limited use then perhaps it make may be easier to use modifier.clickable() and set the parameters there?

This isn't a request to change anything right now. Overall, it’s a good idea and a solid addition!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A similar function was created by Cooltey in one of his PRs, so once the PR is merged, we'll use one of the two implementations.

fun DiscoverReadingListView(
modifier: Modifier = Modifier,
title: String,
@DrawableRes subtitleIcon: Int,
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be worth considering hardcoding the drawable into the Icon composable since the DiscoverReadingListView is a specialized composable for this feature.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we can do that, but I believe it's helpful to keep this as a parameter. This way, the icon can be modified directly from the caller without needing to dive into the implementation. It also allows flexibility in the future if we decide to use different icons for different scenarios.

Copy link
Contributor

@voyagerfan voyagerfan left a comment

Choose a reason for hiding this comment

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

Hi @Williamrai I only reviewed the jetpack compose code but please let me know if you have any questions.

@Williamrai
Copy link
Collaborator Author

Hi @Williamrai I only reviewed the jetpack compose code but please let me know if you have any questions.

@voyagerfan Thank you for your review.

@Williamrai Williamrai requested a review from voyagerfan May 28, 2025 18:51
…card-design

# Conflicts:
#	app/src/main/java/org/wikipedia/readinglist/ReadingListsFragment.kt
…card-design

# Conflicts:
#	app/src/main/java/org/wikipedia/readinglist/ReadingListsFragment.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants