ljharb / repo-report

CLI to list all repos a user has access to, and report on their configuration in aggregate.
MIT License
24 stars 11 forks source link

Loading/progress bar #80

Closed khattakdev closed 2 years ago

khattakdev commented 2 years ago

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.

ljharb commented 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!

khattakdev commented 2 years ago

How about this:

Loading...
Loading completed!
ljharb commented 2 years ago

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().

abdumamdouh commented 2 years ago

@ljharb could you assign this to me and @KhatiaIvanova

KhatiaIvanova commented 2 years ago

@ljharb could you assign this to me and @KhatiaIvanova

@ljharb assign to me

khattakdev commented 2 years ago

@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}
abdumamdouh commented 2 years ago

@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

ljharb commented 2 years ago

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.

abdumamdouh commented 2 years ago

@ljharb so what do you recommend?

ljharb commented 2 years ago

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?