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

The FlowPage is constantly being recomposed #622

Closed
lazzzis opened this issue Feb 17, 2024 · 1 comment
Closed

The FlowPage is constantly being recomposed #622

lazzzis opened this issue Feb 17, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lazzzis
Copy link
Contributor

lazzzis commented Feb 17, 2024

1. Environment

Latest build

2. Describe the bug

Add this log Log.i("RLog", "ArticleItem: recomposition ${articleWithFeed.article.title}") to ArticleItems.kt

@Composable
fun ArticleItem(
articleWithFeed: ArticleWithFeed,
onClick: (ArticleWithFeed) -> Unit = {},
) {
val articleListFeedIcon = LocalFlowArticleListFeedIcon.current
val articleListFeedName = LocalFlowArticleListFeedName.current

Build, launch and navigate to FlowPage.

In the logcat, I am seeing the ArticleItem is endlessly being recomposed.


I am sure this bug is introduced in commit #594, since this issue is not observed on the build based on its previous commit.

The debugger says these two values are changed during every recomposition

val onSwipeEndToStart = when (swipeToStartAction) {
SwipeStartActionPreference.None -> null
SwipeStartActionPreference.ToggleRead -> onToggleRead.value
SwipeStartActionPreference.ToggleStarred -> onToggleStarred.value
}
val onSwipeStartToEnd = when (swipeToEndAction) {
SwipeEndActionPreference.None -> null
SwipeEndActionPreference.ToggleRead -> onToggleRead.value
SwipeEndActionPreference.ToggleStarred -> onToggleStarred.value
}

If I hardcoded these two variables to null, this issue is not observed.

I don't understand why these two values are keeping changing. But I guess they are the root causes which make the flow page a little sluggish.

@lazzzis lazzzis added the bug Something isn't working label Feb 17, 2024
@JunkFood02 JunkFood02 self-assigned this Feb 18, 2024
@JunkFood02
Copy link
Collaborator

Thanks!

@Ashinch Ashinch added this to the 0.9.13 milestone Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants