Skip to content

fix(ui): eliminate 5s collection rebuild churn and pause polling when hidden to tray - #103

Merged
spelech merged 1 commit into
mainfrom
fix/ui-polling-churn-and-tray-lifecycle
Nov 1, 2026
Merged

spelech merged 1 commit into
mainfrom
fix/ui-polling-churn-and-tray-lifecycle

Conversation

@spelech

@spelech spelech commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add IsWindowVisible and ReleaseTransientBuffers() on MainViewModel to pause 5-second background polling and release large image byte arrays when the window is hidden to the system tray.
  • Throttle Ollama.LoadInstalledModelsAsync during background polling so it only runs when InstalledModels is empty or every 12th tick (~60s), while preserving immediate model loading on explicit RefreshStatusAsync() calls.
  • Skip clearing and rebuilding InstalledModels in OllamaLibraryViewModel.LoadInstalledModelsAsync when the returned models match existing items, and suppress per-item ApplyFilter() invocations during batch updates.
  • Return early in UpdateHardwareTelemetry across OllamaLibraryViewModel, HuggingFaceSearchViewModel, and CivitaiSearchViewModel when VRAM and RAM values are unchanged.
  • Dispose transient HttpHelper.CreateClient(ApiBase) instances with using var client across Ollama, HuggingFace, and Civitai ViewModels.
  • Update MainWindow.OnClosing and App.ShowMainWindow to manage IsWindowVisible, release transient image buffers on hide, and trigger a status refresh on restore.
  • Add unit tests in OllamaLibraryViewModelTests and MainViewModelTests.

@spelech
spelech force-pushed the fix/ui-polling-churn-and-tray-lifecycle branch from ac33dc5 to 6cc9963 Compare November 1, 2026 21:32
@spelech
spelech merged commit 0c821ce into main Nov 1, 2026
3 checks passed
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