-
Notifications
You must be signed in to change notification settings - Fork 327
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
Improve preview loading message flickering #1154
Improve preview loading message flickering #1154
Conversation
@joelim-work Thanks for working on this. I'm generally ok with this behavior but a couple of points below:
|
Hi @gokcehan, thanks for sharing your thoughts on this, you raise some good points. Here are my responses:
I have tested this using previews for directories, text files and images (via |
Added a The default value is 0 to maintain the original behaviour. In other words, this feature is opt-in. |
@joelim-work I was waiting for the discussion to settle before taking another look at this. I liked the idea of using 100 milliseconds for the timeout as it felt right in practice. It seems that you now added this as an option with a default of 0. I know I was the one suggesting this but I should say I'm also ok if you want to throw away the option altogether and/or make the default 100 milliseconds. I think we have similar hard-coded delays in the program (e.g. timeout for the esc key). I don't care that much either way so let me know your final decision and I think we can then merge this. |
Hi @gokcehan Thanks for your comments. After some thinking I have decided for now to just hard-code the timeout value to 100 milliseconds for the following reasons:
|
@joelim-work Sounds good, thanks for the patch. |
Fixes #414
Changes:
previewLoading
variable, which decides if a preview is taking too long to load, in which case theloading...
message will be displayed (as opposed to a blank screen).previewLoading
will initially be set tofalse
, and a timer is set toone second100ms (restored toone second100ms if it is already running). When the timer expires,previewLoading
will be set totrue
.