Closed khattakdev closed 2 years ago
Displaying something is a good idea. I’m not sure how we’d do a progress bar since we have no idea how long the query is expected to take - also, i wouldn’t want to clear the console after the request comes back, because that’s disruptive, but i also wouldn’t want to leave the progress indicator visible above the table.
Open to ideas!
How about this:
Loading...
Loading completed!
That's fine for initial output, but it'd be nice to find a way to remove that output once the table is ready without console.clear()
.
@ljharb could you assign this to me and @KhatiaIvanova
@ljharb could you assign this to me and @KhatiaIvanova
@ljharb assign to me
@ljharb One of the solution which I suggested to @abdumamdouh yesterday is to save the user's command and show the loading screen.
Once the loading is complete, clear the console. print the user's command and print the data.
npx report-report
Loading...
Once the loading is complete
npx repo-report
{Repositories details}
@khattakdev @ljharb @KhatiaIvanova
1-take input, ex: repo-report --version 2-store it in var 3-display "Loading..." while fetching 4-done fetching 5-display "Loading completed!" or skip this step 6-then clear console 7-then display input 8-then display results
It would be ideal to avoid ever clearing the console - i like seeing my previous commands' output, and it's pretty disruptive for a program to clear that.
@ljharb so what do you recommend?
That's what I'm not sure about :-)
I'm wondering if there's something to be done with printf
so that we print progress on a single line, and then overwrite just that one line to print the table?
When you execute the script (
bin/run
), it takes some time to display the result due, depending on the number of repositories. I think it's a good idea to add a progress bar otherwise, it looks like the terminal is stuck.