Don't flicker the screen for very fast operations#399
Merged
sosthene-nitrokey merged 2 commits intoNitrokey:mainfrom Jan 22, 2026
Merged
Don't flicker the screen for very fast operations#399sosthene-nitrokey merged 2 commits intoNitrokey:mainfrom
sosthene-nitrokey merged 2 commits intoNitrokey:mainfrom
Conversation
I'm not sure it changes anything in practice, but it seemed wasteful and might lose some state for example for screen readers
Some very fast interactions shouldn't cause a full screen flicker like it currently does
daringer
approved these changes
Jan 21, 2026
robin-nitrokey
approved these changes
Jan 21, 2026
Contributor
Author
|
Looks like this leads to the PIN prompts to get disabled because the view disabling now happens after the prompt is opened, so the prompt ends up being disabled too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously the busy state was set immediately when an operation is run, this could cause screen flickers for very fast or even instant operations.
This PR makes the busy state visible only if it's still busy after 100ms. 100ms is enough for it to still feel "instant", but gives some lee-way for almost-instant operations to run.
This PR also fixes potential race conditions where if two workers run in parallel the busy state could stop after only the first one:
This would require 2 views operating at the same time so it's unlikely but not impossible. A busy task counter replaces this.
Got annoyed by the constant flicker in the settings screen while working on #398