gitui
gitui copied to clipboard
Add a visual cue to indicate that stashing is in progress
Is your feature request related to a problem? Please describe. When stashing it can take several seconds before the stash completes and the popup closes, but there is no visual cue that it is happening. I have on occasion wondered whether I actually pressed Enter and have pressed it again; fortunately, this seems to cause no harm.
Describe the solution you'd like In the Stash popup, overwrite the "type name (optional)" message or the name (if typed) with a message like "Stashing..." as soon as Enter is pressed. This will inform the user that something is actually happening.
good point. would like a PR for it. there is plenty of examples how to make a blocking libgit2 operation async in the code base. happy to coach a contributor
I'll take a look over the weekend. Never looked at rust code before. But I'm not even sure async is needed, should be enough to display the message before making the blocking call. Anyway I'll give it a go. Also never made a PR on Github before, but there's a first time for everything. 😰
@extrawurst , what is the strategy behind turning sync::stash_save() in a async operation?
Should I wrap sync::stash_save()
with the AsyncSingleJob , and then when the enter key is pressed thus the confirmation to stash changes is made, I launch the async single job instead the current sync::stash_save and I just change the message of the stash confirmation box while the async job is running.
I've tried to do it the sync way, but I keep getting errors from the borrow checker.
I'm glad to see that someone is taking a stab at this. I did take a look at the code but with my history of Visual Basic 6 in pre-,NET days and C# since I quickly realised that I would need to take a deeper dive into learning Rust than I'd hoped before I'd be able to try fixing this myself.
@strandloper , I am also a newbie in Rust, but I think the best way to learn a new technology is to get your hands dirty as you intend to do here.
This project looks well structured, and I like the components and the submodules (eg: async/
folder) pattern here. And me too I want to get my hands dirty here and take this project as a source of inspiration, but now that I've seen the code it will also be difficult to me. Maybe we can work together by throwing some ideas on a draft PR?
I used ripgrep to help me navigate this source code. If you want to take a look at a simpler project, you can see my rg_explorer project, a wrapper that uses the same library it's being used here to draw the TUI. Maybe we can work together there, and when we are strong enough with Rust come back here.
Best.
once this is moved into an async job we can also utilise StashApplyProgress
to feedback at what step we are in doing the stashing, just like we do for pushing (e.g)