Skip to content

feat: add configurable throttling and manual repository refresh - #2838

Closed
tib8 wants to merge 3 commits into
sourcegit-scm:developfrom
tib8:refresh-throttling
Closed

tib8 wants to merge 3 commits into
sourcegit-scm:developfrom
tib8:refresh-throttling

Conversation

@tib8

@tib8 tib8 commented Oct 29, 2026 •

Copy link
Copy Markdown

Continuous filesystem activity during a build can repeatedly trigger repository refreshes and interrupt the UI with a busy indicator. Wait until filesystem events have been quiet for a configurable interval before running any pending automatic refreshes; each relevant event restarts the shared waiting period.

Add a Refresh throttling slider below History Commits in Preferences → GENERAL, ranging from 0 to 5000 ms in 100 ms steps, with a default of 1000 ms. Zero disables the additional delay.

Add a Manual refresh checkbox beside the slider. When enabled, it disables the slider and filesystem event watchers in all open repositories, suppresses pending filesystem-driven refreshes, and shows a Refresh icon immediately left of Fetch. The icon uses the same full refresh as the existing F5 shortcut and tab context menu, bypassing the throttling delay. Repositories opened in manual mode keep their watchers disabled. Switching back to automatic mode re-enables watchers and schedules a full refresh to catch up with missed changes. Both preferences are persisted.

Validation:

  • dotnet build src/SourceGit.csproj --no-restore — passed with no warnings or errors.
  • dotnet format --verify-no-changes --no-restore src/SourceGit.csproj --include src/Models/Watcher.cs src/ViewModels/Preferences.cs — passed.
  • dotnet run --project tests/WatcherChecks/WatcherChecks.csproj --no-restore — passed; covers event bursts, ignored paths, zero and maximum delays, setting changes, watcher locks, overflow recovery, disabling hooks in existing and newly opened repositories, suppression of queued events, and recovery when returning to automatic mode.

Manual mode disables only filesystem-driven refreshes from external changes. Application-initiated Git operations (including fetch, pull, interactive rebase and its continue/skip/abort actions, and auto-fetch) still refresh when their operation scope finishes, bypassing throttling. Nested scopes refresh once on completion; cancelled or failed operations also refresh any partial changes. Tests cover these completion paths while verifying that filesystem hooks remain disabled.

@tib8 tib8 changed the title feat: add configurable repository refresh throttling feat: add configurable throttling and manual repository refresh Oct 30, 2026
@tib8 tib8 closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant