jsdelivr / globalping-cli

A simple CLI tool to run networking commands remotely from hundreds of globally distributed servers
Mozilla Public License 2.0
144 stars 13 forks source link

Output jumps #40

Closed jimaek closed 1 year ago

jimaek commented 1 year ago

When running a test the output for a moment triples in size and then goes back to normal. This looks bad and also pushes the console down. Here is a video https://dl.dropboxusercontent.com/s/l4g8xgnjzu06ujn/WindowsTerminal_2023-04-08_15-05-41.mp4

didil commented 1 year ago

@jimaek I've had a look at the current implementation of the "live view" and I think we need to redefine the specs to make sure we're clear on what should happen precisely in each case (while the updates are in progress, and when all probes are finished). For example at the moment if I decrease the terminal height enough that the output from 5 probes does not fit, while the probes are in progress I can only see partial results from a couple of probes, and there is no way to see the other results as they don't fit into the screen. After all probes have finished running then the full output gets printed to the screen, and that causes the jumping.

Here is a screencast.

https://user-images.githubusercontent.com/1284255/230873546-00d35c69-fc01-4b4a-89d8-cde740211835.mov

jimaek commented 1 year ago

Indeed your example is also something we need to fix. But I think my original issue was not present in 0.3.0 and started happening only in 0.4.0, so I assume it should be easy to fix.

Regarding your video what are your suggestions? I am not sure if there is a standard practice for such cases

didil commented 1 year ago

@jimaek I think the issue your presented was present in 0.3.0 but was not visible because the live issues were not enabled. There haven't been any other changes which could impact the live view.

I'm not sure what's the correct UI/UX for what you're trying to implement is. I don't think I have ever seen a similar feature. The closest that comes to mind would be "multitail" which is a more complex approach that divides up the screen https://www.tecmint.com/wp-content/uploads/2014/03/Install-MultiTail.jpeg.

jimaek commented 1 year ago

The idea is to emulate how a normal ping would look like if you run it locally. So if we take aside the issue with multiple probes and just try to test it with just 1 probe you will see it doesn't behave properly. It jumps in size for some reason and pushes the output down. It doesnt make sense to me as it should just continue adding new lines until its done. What is it even flashing for that moment?

Maybe lets try to make 1 probe look normal and then see what we can do for multi-probe tests cause they sound like different problems?

didil commented 1 year ago

Just opened a PR https://github.com/jsdelivr/globalping-cli/pull/45 that should fix the jump issue

jimaek commented 1 year ago

Is that fix for the original issue with 1 probe or it also covers your multi-probe finding?

didil commented 1 year ago

this only fixes the issues from your video

didil commented 1 year ago

When doing multi-probes, about the flashing at the end, it's because of the way this is implemented at the moment: