-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: showing a loading message #364
Conversation
@@ -119,6 +119,7 @@ func (m Model) Update(msg tea.Msg) (section.Section, tea.Cmd) { | |||
currIssue.Assignees.Nodes = removeAssignees(currIssue.Assignees.Nodes, msg.RemovedAssignees.Nodes) | |||
} | |||
m.Issues[i] = currIssue | |||
m.Table.SetIsLoading(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If L122
and L136
is not added, issues can not be shown because Loading...
is showed always.
ui/components/table/table.go
Outdated
if m.isLoading { | ||
return bodyStyle.Render(m.loadingMessage) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're up for it, let's make a bit more fancy.
You can add a padding of 1 to the left (I think) and it should center it better.
Also, you can add a spinner to it's left with "github.com/charmbracelet/bubbles/spinner". You can see an example in https://github.com/charmbracelet/bubbletea/tree/master/examples/spinner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking time for this PR!
Wow, this spinner is great! I'll try to do it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried in c2f2405.
But the spinner does not work.
I will try to fix later.
If you have an idea please let me know.
@dlvhdr
This problem has been fixed.
I added loadingSpinner, loadingSpinnerCmd := m.Table.LoadingSpinner.Update(msg)
only to issuesection.go
.
I have to add it to prsection.go
as well. 😅
After I will been done with TODOs and review the code sanity, I will ask you to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dlvhdr
I'm done with fixing.
Could you review this PR please?
Thanks for working on this @kyu08, looks great!
|
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? |
wdym @Omnikron13? Like vim's |
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:
#364 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
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. |
Thanks for fixing my comments :) |
@dlvhdr
In my environment, I could not confirm reproduction. |
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. |
Thank you for letting me know how to repro. 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? |
Opened #386 |
Thanks! |
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:r
key is pushedR
key is pushedImages/Videos
Before
before.mov
After
after.mov
I considered to showing
Loading...
on sidebar too. But the message currently showed is suitable too. So I did not change it.