Skip to content

feat: support refresh rate presets (power saving / balanced / real-time) for issue #47#53

Merged
ShadyUnderLight merged 3 commits intomainfrom
feat/issue47-refresh-rate-presets
Apr 29, 2026
Merged

feat: support refresh rate presets (power saving / balanced / real-time) for issue #47#53
ShadyUnderLight merged 3 commits intomainfrom
feat/issue47-refresh-rate-presets

Conversation

@ShadyUnderLight
Copy link
Copy Markdown
Owner

Summary

  • Add RefreshRatePreset enum with three cases: powerSaving (10s), balanced (2s), realTime (0.5s)
  • Settings: SettingsView adds a refresh rate picker; MonitorViewModel persists selection to UserDefaults
  • Intervals: summary and process refresh intervals are now driven by the selected preset
  • Changes take effect immediately without restarting the app

Files changed

  • SystemModels.swift: Added RefreshRatePreset enum
  • MonitorViewModel.swift: Added refreshRatePreset property, replaced hardcoded intervals
  • SettingsView.swift: Added refresh rate picker
  • Localizable.strings (en/zh-Hans): Added localization for presets
  • MonitorViewModelTests.swift: Added tests for default value, modern and legacy string migration

Testing

  • All 110 tests pass
  • Build succeeds

LMZ added 3 commits April 21, 2026 19:15
Fixes documentation drift from current implementation:

EN README.md:
- Notes on CPU temperature: replaces 'falls back to `--`' with Apple Silicon
  HID priority + actionable hint behavior (no silent `--`)
- Roadmap: removes 'Sparklines / history' (already implemented) and plain
  'Per-process actions'; keeps only 'Per-process actions (e.g. kill, priority adjustment)'

ZH README.zh-CN.md:
- 关于 CPU 温度: replaces '回退显示为 `--`' with Apple Silicon HID priority
  + actionable hint behavior
- Roadmap 想法: removes '趋势图 / 历史曲线' and plain '针对进程的操作按钮';
  keeps only the clarified wording with examples

All outdated lines removed; all new lines added. No code changes.
…for issue #47

- Add RefreshRatePreset enum with powerSaving, balanced, realTime cases
- Add refreshRatePreset published property to MonitorViewModel with didSet
- Replace hardcoded summaryRefreshInterval and processRefreshInterval with configurable ones
- Add refresh rate picker to SettingsView
- Add localization strings for all three presets (en/zh-Hans)
- Add unit tests for default value and migration scenarios
…val takes effect immediately

Before: changing preset while sleeping would only take effect on next sleep cycle.
After: cancel existing refresh task and create a new one with the updated interval.

Also extracted createRefreshTask() helper to avoid duplication.
@ShadyUnderLight ShadyUnderLight merged commit 1db1c50 into main Apr 29, 2026
2 checks passed
@ShadyUnderLight ShadyUnderLight deleted the feat/issue47-refresh-rate-presets branch April 29, 2026 09:27
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