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

Fix recompositions due to autofill #975

Merged
merged 11 commits into from
Jul 8, 2023

Conversation

MV-GH
Copy link
Collaborator

@MV-GH MV-GH commented Jul 5, 2023

Fix recompositions issues due to previous autofill, it used composed causing constant recompositions on any change.

before:

studio64_JkZYzhdaWG.mp4

after:

studio64_RKsfi3OxFh.mp4

After only the button and the column are constantly recompositioning, i looked into it and they login function is a lambda that uses AccountViewmodel (which is unstable to due to AccountRepo) that is unstable, causing the lambda to be unstable and causing the button and column to be unstable.

the AccountViewmodel stableness might be fixed due to #973.

@yate
Copy link
Contributor

yate commented Jul 5, 2023

@MV-GH AccountViewModel is still unstable on my branch

unstable class AccountViewModel {
  unstable val repository: AccountRepository
  unstable val currentAccount: LiveData<Account?>
  unstable val allAccounts: LiveData<List<Account>>
  <runtime stability> = Unstable
}
unstable class AccountRepository {
  runtime val accountDao: AccountDao
  unstable val currentAccount: LiveData<Account?>
  unstable val allAccounts: LiveData<List<Account>>
  <runtime stability> = Unstable
}

@MV-GH
Copy link
Collaborator Author

MV-GH commented Jul 6, 2023

I was more thinking about it injecting the viewmodels instead of passing them

@MV-GH MV-GH changed the title Other/fix autofill recomp Fix recompositions due to autofill Jul 7, 2023
@twizmwazin twizmwazin enabled auto-merge (squash) July 7, 2023 21:39
MV-GH added 3 commits July 8, 2023 09:25
# Conflicts:
#	app/src/main/java/com/jerboa/ui/components/login/Login.kt
@twizmwazin twizmwazin merged commit 90a3dd9 into LemmyNet:main Jul 8, 2023
@MV-GH MV-GH deleted the other/fix-autofill-recomp branch July 8, 2023 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants