[Bug] `win32` platform, UI flickering when removing `node_module` directory/ies
Describe the bug
Deleting the node_modules directory on the win32 platform causes flickering on the UI.
Originally discovered by @KonradNojman in https://github.com/voidcosmos/npkill/issues/87#issuecomment-792323515
It might be related to the delete method in win32 being synchronous since #88:
UI will 'freeze' while performing the delete job. Then, when the process finishes, it updates the status to "deleting..." and a few ms later, it changes to "deleted".
as described by @zaldih.
For more info, please refer to https://github.com/voidcosmos/npkill/issues/87 and #88 threads.
To Reproduce
Steps to reproduce the behavior (must be on win32 platform!):
- Go to the directory that contains
node_modulesdirectory somewhere in the child chain, - Run
npx npkillor alternatively installnpkillglobally (npm i -g npkill) and spawnnpkill, - Wait for the search to be completed
- Press space bar on one of the results
- Once deleted a flicker on the UI will be present.
* (@KonradNojman please do fill in the gaps if I miss some of the steps)
Expected behavior
No flickers should occur when removing node_modules directory/ies.
The status of deleting... and DELETED should be updated accordingly (asynchronously).
Screenshots Here's the visual representation of this issue: https://user-images.githubusercontent.com/60238331/110249637-4fb48b00-7f77-11eb-8cac-9d6259788f97.png (courtesy of @KonradNojman)
- OS:
Windows - Version
v0.7.4
Additional context cc @zaldih @NyaGarcia for visibility (and prioritization).
Hi @ognjenjevremovic ! Thanks for filling out the bug ticket ๐ Was gonna do it soon, but you were faster ๐
โ ๏ธ There is an important update for this ticket:
Looks like this flickering behavior only occurs on the local build of the npkill.
When I used the newest version 0.7.4 (npx npkill) that was deployed to NPM the problem doesn't occur ๐คท The flickering problem wasn't visible when I used npx npkill with v0.7.2 as well.
I don't have any clue why is that, but doesn't seem that urgent in this case :) For anyone that want's to reproduce this issue, please follow the steps outlined by @ognjenjevremovic here https://github.com/voidcosmos/npkill/issues/87#issuecomment-787104510 (using appropriate commit from the main npkill repository) To be precise the problem was spotted when working with the local build using this branch https://github.com/voidcosmos/npkill/pull/88 ,commit: https://github.com/voidcosmos/npkill/pull/88/commits/a25244380d578e73fb1df1dd2524732a47617d9f . cc @zaldih @NyaGarcia
Thanks for the feedback @KonradNojman. I was a little late posting my reply, apologize, but I am able to confirm that this is indeed the case as you wrote (UI flickers not being present when installing a package from a registry).
I'd like to point out that I got access to a win32 platform and was able to test it myself, however take this with a grain of salt, as I'm using VM with win32 so that might not be 100% accurate representation of what might happen on the actual Windows machine.
Let's keep this open for a little while and see if there's any other feedback regarding this issue.
We might close soon enough if the issue gets stale (like a month without any activity) ๐ .
Hey! I have been able to do some more testing (on a win10 virtual machine) and in my case, I have noticed that in the CMD everything works as it should, but instead the interface seems to do weird things with vscode's Integrated Terminal (blinks, incomplete refreshments...).
@KonradNojman have you been able to check if this problem also happens for example in CMD?
cc @KonradNojman I assume the tag accidentally went to a wrong user, due to autocomplete ๐ .
I didn't test this tbh on the VM; since I don't use win32, the only terminal I checked was powershell (as it comes packed with win10). I didn't notice the blinking.
cc @zaldih
Hey!
It's been a long time.
I just released version v0.11.1 which optimizes rendering. In principle this problem should be more than solved.
Regards.