Skip to content
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

Show background fetch status in bottom line #4215

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

stefanhaller
Copy link
Collaborator

@stefanhaller stefanhaller commented Jan 26, 2025

  • PR Description

This shows a status as if the user had typed 'f' manually in the files panel.

I want this particularly for the first fetch after startup. There are often
situations where I need to wait for this first background fetch to be done
before I can do what I want (e.g. rebase my branch onto its base branch, or
check out a branch that my coworker has told me they just pushed), but currently
it's hard to tell when that is.

For every subsequent background fetch after the first one it is less important,
but it hopefully doesn't hurt, and it might be nice to have some visual
indication that background activity is happening.

@stefanhaller stefanhaller added the enhancement New feature or request label Jan 26, 2025
Copy link

codacy-production bot commented Jan 26, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 55236801 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5523680) Report Missing Report Missing Report Missing
Head commit (5424785) 52074 45032 86.48%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4215) 3 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@jesseduffield
Copy link
Owner

I quite like the idea of just showing it every time, because often it causes a slight delay in some action I want to perform and it would be good to actually see the reason why.

As for location, I'm fine with it at the bottom. It may be a little bit annoying for users who are hiding their bottom line (because it shows up again and slightly squashes the other panels when something is loading). We've got a separate issue for that here: #4189

@stefanhaller
Copy link
Collaborator Author

Ok cool. Does that mean we can merge this as is (after rewording the commit message a bit)?

Did you see the change in the first commit? I'm not entirely sure about it, see commit message for details.

@jesseduffield
Copy link
Owner

Yep, I think that's fine. LGTM

As far as I can tell, this is not needed. The call to Refresh at the end of
backgroundFetch takes care of redrawing after refreshing.

The call was added in 2fc1498, that's a long time ago, and we had multiple
big refactorings since then. Maybe it was needed back then but no longer is
today.
This shows a status as if the user had typed 'f' manually in the files panel.

I want this particularly for the first fetch after startup. There are often
situations where I need to wait for this first background fetch to be done
before I can do what I want (e.g. rebase my branch onto its base branch, or
check out a branch that my coworker has told me they just pushed), but currently
it's hard to tell when that is.

For every subsequent background fetch after the first one it is less important,
but it hopefully doesn't hurt, and it might be nice to have some visual
indication that background activity is happening.
@stefanhaller stefanhaller force-pushed the show-background-fetch-status-in-bottom-line branch from abfea47 to 5424785 Compare January 27, 2025 12:59
@stefanhaller stefanhaller changed the title RFC: Show background fetch status in bottom line Show background fetch status in bottom line Jan 27, 2025
@stefanhaller stefanhaller marked this pull request as ready for review January 27, 2025 13:00
@stefanhaller stefanhaller merged commit 3722824 into master Jan 27, 2025
14 checks passed
@stefanhaller stefanhaller deleted the show-background-fetch-status-in-bottom-line branch January 27, 2025 13:01
stefanhaller added a commit that referenced this pull request Jan 30, 2025
- **PR Description**

Fix occasional ugly flicker when showing the background fetch status
(recently introduced with #4215).

- **Please check if the PR fulfills these requirements**

* [x] Cheatsheets are up-to-date (run `go generate ./...`)
* [x] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig))
* [ ] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants