npkill icon indicating copy to clipboard operation
npkill copied to clipboard

[Bug] `win32` platform, UI flickering when removing `node_module` directory/ies

Open ognjenjevremovic opened this issue 4 years ago โ€ข 4 comments

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!):

  1. Go to the directory that contains node_modules directory somewhere in the child chain,
  2. Run npx npkill or alternatively install npkill globally (npm i -g npkill) and spawn npkill,
  3. Wait for the search to be completed
  4. Press space bar on one of the results
  5. 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).

ognjenjevremovic avatar Mar 12 '21 16:03 ognjenjevremovic

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

KonradNojman avatar Mar 13 '21 22:03 KonradNojman

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) ๐Ÿ™‚ .

ognjenjevremovic avatar Mar 18 '21 16:03 ognjenjevremovic

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?

zaldih avatar Apr 08 '21 12:04 zaldih

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

ognjenjevremovic avatar Apr 08 '21 13:04 ognjenjevremovic

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.

zaldih avatar Mar 24 '23 08:03 zaldih