-
Notifications
You must be signed in to change notification settings - Fork 413
Add auto-refresh for WebViewController after 5+ minutes in background with user setting #4269
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
Conversation
…round Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
…add documentation Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
|
@copilot Add setting under Companion app settings > General > "Refresh after 5 inactive", defaults to ON |
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
…romise comment Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
Added setting in General settings under the Page section: "Refresh After 5 Min Inactive" (defaults to ON). The setting controls whether WebViewController auto-refreshes after 5+ minutes of inactivity. Implemented in commits 011530a and 6c5f946. Setting location: Settings → General → Page section |
|
@copilot fix lint issues based on report below
|
…redundant internal Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
Fixed all SwiftFormat lint issues in commit 4c811f3:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds an opt-out setting that automatically refreshes the app’s WebViewController when returning to the foreground after being in the background for 5+ minutes.
Changes:
- Track a background timestamp in
WebViewSceneDelegateand refresh the WebView on reactivation when elapsed time ≥ 5 minutes (and setting enabled). - Add a new
SettingsStore.refreshWebViewAfterInactivepreference (default ON) and expose it via a new toggle in General Settings. - Add unit tests intended to validate timestamp tracking, threshold behavior, and setting enable/disable behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/App/Scenes/WebViewSceneDelegate.test.swift | Adds tests for background timestamp + refresh behavior and setting gating. |
| Sources/Shared/Settings/SettingsStore.swift | Introduces refreshWebViewAfterInactive boolean setting (default ON). |
| Sources/Shared/Resources/Swiftgen/Strings.swift | Adds Swiftgen accessor for the new localized settings title. |
| Sources/App/Settings/General/GeneralSettingsView.swift | Adds a toggle UI under General → Page for the new setting. |
| Sources/App/Scenes/WebViewSceneDelegate.swift | Implements timestamp tracking + conditional refresh on foreground. |
| Sources/App/Resources/en.lproj/Localizable.strings | Adds English localization for the new setting label. |
Relocated the RefreshAfterInactive string enum in Swiftgen/Strings.swift for better organization. Removed the WebViewSceneDelegate test file, possibly as part of test cleanup or refactoring.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4269 +/- ##
=======================================
Coverage ? 43.15%
=======================================
Files ? 261
Lines ? 15079
Branches ? 0
=======================================
Hits ? 6508
Misses ? 8571
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Plan: Auto-refresh WebViewController after 5+ minutes in background
sceneDidEnterBackgroundto track timestampsceneDidBecomeActiveto check and refreshrefreshWebViewAfterInactivesetting to SettingsStore (defaults to ON)self.in test expectationsinternalkeywordSummary
Successfully implemented auto-refresh functionality with user-configurable setting:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.