dlvhdr / gh-dash

A beautiful CLI dashboard for GitHub 🚀
https://dlvhdr.github.io/gh-dash
MIT License
6.77k stars 191 forks source link

feat: showing a loading message #364

Closed kyu08 closed 1 month ago

kyu08 commented 1 month ago

Resolves #363

This is my first PR to gh-dash. So if I'm doing something wrong. Please let me know that. 😅

Summary

Show Loading... when gh-dash fetching PRs(not issues because the Tip is showed when issues are being fetched currently)

How did you test this change?

Verify Loading... is showed when:

Images/Videos

Before

https://github.com/dlvhdr/gh-dash/assets/49891479/24584df0-9a6b-4444-a325-f0bec1550456

After

https://github.com/dlvhdr/gh-dash/assets/49891479/e2896a10-0440-4f1e-b156-fd64b4072433

I considered to showing Loading... on sidebar too. But the message currently showed is suitable too. So I did not change it.

dlvhdr commented 1 month ago

Thanks for working on this @kyu08, looks great! Just a couple of comments:

  1. When I scroll to the end of a list, the behavior currently, is to fetch the next page of PRs/Issues. Right now it looks odd that the whole screen replaces with a loading message. I believe you can check whether we are fetching the first page or whether it's a pagination action. To see this, just have a query return more than 20 PRs and scroll to the bottom with G
  2. The color of the loading indicator should use the colors from the user's theme. I think ctx.Theme.SecondaryText could work well. WDYT?
Omnikron13 commented 1 month ago

I don't actually recall what it does atm with a long list... It paginates?

Wouldn't be it beter to behave like, say, vim and not actually highlight the bottom couple until it's actually the bottom couple? That's how most people configure their text editor, and I believe this behaviour is supported by native components isn't it?

dlvhdr commented 1 month ago

wdym @Omnikron13? Like vim's scrolloff?

Omnikron13 commented 1 month ago

Yeah. At the resolution I'm normally at it takes a hell of a large list to actually see what happens with a full screen+ of items. Bumping up my font size to comical levels it seems that is the current behaviour? Is that configurable? I haven't dug too much into config options honestly

On 31 May 2024 21:40:17 BST, Dolev Hadar @.***> wrote:

wdym @Omnikron13? Like vim's scrolloff?

-- Reply to this email directly or view it on GitHub: https://github.com/dlvhdr/gh-dash/pull/364#issuecomment-2142949030 You are receiving this because you were mentioned.

Message ID: @.***>

Omnikron13 commented 1 month ago

My lax attitude to issues and PRs is rather why good tooling that doesn't make me leave the terminal to pleasantly interact with... well, practically every part of GitHub tbh. Spent literal a couple years using a daily driver that didn't even have X installed out a general preferences, and by god have things god notably more pleasant since then as well.

kyu08 commented 1 month ago

@dlvhdr The color issue has been fixed in 58e9fca9d7dd. The pagination issue has been fixed in b6d5806ed6a7.

Could you review these changes please?

dlvhdr commented 1 month ago

Thanks for fixing my comments :) I think there's another small bug, let me know if you want to fix it or land as is. When refreshing every view with R (capital R) the spinner doesn't spin.

kyu08 commented 1 month ago

@dlvhdr Thanks for reviewing too!

I think there's another small bug, let me know if you want to fix it or land as is. When refreshing every view with R (capital R) the spinner doesn't spin.

In my environment, I could not confirm reproduction. Can you show me reproduction procedure please?

dlvhdr commented 1 month ago

Not near a computer right now but when you press R you can see the spinner properly working but then when you switch to the next section with l it stops.

kyu08 commented 1 month ago

@dlvhdr

Thank you for letting me know how to repro. Now I can repro on my environment too.

I took a look around the codes, but I couldn't identify the cause.

For now, how about we merge this PR and discuss this issue separately as you suggested?

dlvhdr commented 1 month ago

Opened https://github.com/dlvhdr/gh-dash/issues/386

kyu08 commented 1 month ago

Thanks! When I have enough time, I'll take a look at it.