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

Fix flicker when showing backround fetch status #4223

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

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

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@stefanhaller stefanhaller added the ignore-for-release This will exclude the PR from release notes label Jan 29, 2025
Copy link

codacy-production bot commented Jan 29, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for d2723ff1 71.43%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d2723ff) Report Missing Report Missing Report Missing
Head commit (638c9c5) 52278 45240 86.54%

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 (#4223) 7 5 71.43%

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.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…of it

This is the same as WithWaitingStatus but without the implicit OnWorker, for
those who are on a background thread already.
This was recently introduced, but it was done the wrong way.
WithWaitingStatusSync should only be called from the main thread, and it is
meant to be used for updating the bottom line while the UI is blocked. It is a
bad idea to call this from a background thread, and it results in ugly flicker
(occasionally).

Use the newly extracted WithWaitingStatusImpl instead, this is the same as
WithWaitingStatus (which is exactly what we need) but without the implicit
OnWorker, which we don't want because we are on a background thread already.
@stefanhaller stefanhaller force-pushed the fix-backround-fetch-status branch from c9e06a7 to 638c9c5 Compare January 30, 2025 07:50
@stefanhaller stefanhaller merged commit c0e3922 into master Jan 30, 2025
15 checks passed
@stefanhaller stefanhaller deleted the fix-backround-fetch-status branch January 30, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release This will exclude the PR from release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants