PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Peek preview area flickers when jumping to next/previous file

Open rbtk1 opened this issue 1 year ago • 2 comments

Microsoft PowerToys version

0.83.0

Installation method

WinGet

Running as admin

Yes

Area(s) with issue?

Peek

Steps to reproduce

Jumping from one file to the next using he arrow keys with Peek open, the preview area flickers every single time it previews the next file. This might be considered a minor issue, but it looks quite bad and it reflect badly on the polish of the app.

✔️ Expected Behavior

No flickering when switching between previewed files with the arrow keys

❌ Actual Behavior

The preview area is cleared for a milisec before displaying the next file, making it flicker, especially if you quickly preview a bunch of files after one another.

Other Software

No response

rbtk1 avatar Aug 31 '24 16:08 rbtk1

This is a bugbear of mine, too, so thank you very much for raising it as an issue! The underlying reason is related to the fact that the old previewer is removed and a new one created every time you navigate to a new file, which leads to the window background being shown briefly. It may be that keeping the old previewer around until the new one has finished loading the new file would be a viable solution, but there's some subtlety about how long to wait before showing that Peek has registered your input, so perhaps a new way of showing progress would be needed.

I'd like to look at this, but it's a medium-to-large complexity task affecting some fundamentals of how the different previewers are created and managed, so may take a while.

daverayment avatar Sep 11 '24 20:09 daverayment

go for it @daverayment

ethanfangg avatar Sep 12 '24 17:09 ethanfangg

@rbtk1 Can I ask you a couple of questions about this, please?

  1. Do you notice this with a specific type of file? I notice it most when navigating between image files, and so that's where I've started my work, but I didn't want to assume anything. I'd like to know if you've encountered this with other specific file types, too.
  2. When switching between files of different dimensions, the Peek window resizing itself could be seen as a 'flashing', too, where the new file's content pops into view after the window resizing happens. Do you think it would be preferable for the new content to load and then for the window resize to happen (which is the opposite of the current implementation), or is this not an issue for you?

Thank you!

daverayment avatar Sep 16 '24 21:09 daverayment

@daverayment Thanks for taking a look at this, and good to hear others agree these smaller visual issues are important too 😁

For images its more noticable when flicking through very bright images since it will breifly flash dark (im using dark theme, so might be different reversed with the light OS theme), but i actually started this thread when i preview a whole bunch of folder and Peek unsupported files where it just shows the icon and the metadata, and got a bit annoyed the icon and text flashed every time selecting next/previous. for images its especially annoying if comparing 2 similar images and go back and forth between them.

The window resizing im not sure about what i would prefer. As long as the image is not starting scaled down then scaled up afterwards along with the window frame and thereby would again appear to flicker, then i dont think i have a preference.

rbtk1 avatar Sep 18 '24 13:09 rbtk1

@rbtk1 It's a small, but certainly not a minor issue, so thanks again for raising it. It's not just a comfort issue, as some people are very susceptible to flashing lights.

Thanks so much for answering the questions; it's really going to help prioritise the work and give me an idea what's important to test for. I have a fix for the image previewer now, and it's much more pleasant to rapidly move through a folder now.

daverayment avatar Sep 18 '24 14:09 daverayment

I agree it's quite unpleasant getting flashed every time opening a file. Wish it can be fixed soon.

AkazaRenn avatar Apr 15 '25 01:04 AkazaRenn

This can be a big problem for people with epilepsy. Please take a look at this issue.

https://github.com/user-attachments/assets/524b5369-6755-4380-bae7-7e004444de89

dualjack avatar May 07 '25 16:05 dualjack

Hi @dualjack. Thanks for your feedback, and I'm sorry this is taking some time to resolve. It was waiting behind some other work on Peek which would make the improvement easier to apply for all previewers, not just the image previewer.

However, I have thought for a while that it might just be best to submit the improvements which affect the image previewer first and leave the generic fix for a later date. This will help fix what I suspect is the most problematic instance of the flashing - where someone is quickly previewing files in an image folder.

There are a couple of other changes which I'm working on at the moment, but I'll get to this as soon as I can.

Thanks again.

daverayment avatar May 08 '25 15:05 daverayment

@daverayment there is already a progress ring in the FilePreview.xaml. I am wondering if this is not happening way to quickly for the previewer to correctly show a loading state. One idea is probably to pad everything with smooth composition animations so that transitions are not as jarring to the eyes. I'd be willing to take a look at this as well!

SamChaps avatar Oct 14 '25 15:10 SamChaps