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

SearchVM, SearchService: improve search UX by reducing flickering #1117

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Sir-Photch
Copy link
Contributor

@Sir-Photch Sir-Photch commented Oct 26, 2024

This PR closes #617 and improves search UX by not redrawing search results until there are actual results by any SearchableRepository. This "fixes" the "flickering" that would otherwise occur when searching:

kvaesitso-noflicker.mp4

I also went and replaced MutableStateOf({Int,Float}) to the respective Mutable{Int,Float}StateOf that I found on the way, for good measure.

Now, I haven't tested this much, so I'm not sure whether or not this introduces any regressions. But I think the result of an UI that does not flicker when typing is quite promising. Let me know what you think.

And sorry for that messed up commit-history. 😅

Comment on lines 262 to 266
searchActionResults.clear()
mergeStateLists(appResults, apps)
mergeStateLists(workAppResults, workApps)
mergeStateLists(privateSpaceAppResults, privateApps)
mergeStateLists(hiddenResults, hiddenItems)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it makes sense to set previousResults here too?

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.

Use mutableStateListOf<Searchable>() instead of mutableStateOf<List<Searchable>> in SearchVM
2 participants