Repository navigation
fix(weather): handle expired widget forecasts - #607
Open
YinCheng0106 wants to merge 1 commit into
Open
YinCheng0106 wants to merge 1 commit into
YinCheng0106 wants to merge 1 commit into
Conversation
Platform: ios Fix(zh-Hant): 修正 iOS 天氣小工具預報過期後的更新時機,並在無有效預報時顯示暫無資料 Fix(en-US): improve iOS weather widget refresh timing around forecast expiry and show an unavailable state when no valid forecast remains
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). |
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
YinCheng0106
marked this pull request as ready for review
October 12, 2026 03:08
Member
PiscesXD
approved these changes
Oct 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

這個 PR 做了什麼
iOS 天氣小工具的逐時預報在有效期限後不再持續顯示舊資料,並在沒有可用預報時提供本地化的「暫無資料」狀態。此改動接續已合併的 Gallery Preview PR #604,保留 Gallery 預覽整合。
ForecastWidgetExpiry.swift統一計算預報期限與可用性;期限取發布時間後 30 分鐘與接收後下一個台北整點的較早者,並納入校準時鐘偏移。DPIPWidgetProviderSupport.swift在到期前最多 2 分鐘提出較早 reload 請求,同時保留到期 timeline entry;Release 最短刷新間隔仍為 5 分鐘。WidgetKit 的 reload 執行時間不保證,因此到期 entry 仍負責在資料期限到達時呈現正確狀態。ForecastWidgetSnapshotStore.swift拒絕相同發布時間的重複快取寫入,避免重複回應重設接收時間、讓已過期預報復活。DPIPWidgets.swift在 Medium/Large 小工具無有效逐時預報時顯示 unavailable 狀態,現況天氣仍保留;Small 版維持原樣。緊湊版面避免 unavailable 文字擠壓預報區。Localizable.xcstrings加入所有支援語系的 unavailable 文案;字串由原生 Widget localization table 提供。Runner.xcodeproj/project.pbxproj登錄 expiry helper。ForecastWidgetTests.swift涵蓋期限邊界、早期 reload/到期 entries、相同發布快取保護、無預報與恢復呈現、Dynamic Type 與多語系版面。此分支也包含已合併至 main 的 Gallery Preview 基礎。相關 issue
沒有對應的 issue。接續已合併的 Gallery Preview PR #604。
怎麼驗
自動化驗證
tool/check.sh:3,136 passed、10 skipped;本次tool/commit.sh --push所有 CI gates 均通過,未變更的 gates 使用內容雜湊快取。tool/check/commits.sh origin/main..HEAD:1 commit 通過。實際 Simulator Home Screen WidgetKit 觀察
WidgetCenterreload。/Users/yincheng/.codex/qa-evidence/dpip-forecast-final-20261012-071923/REPORT.md。01-valid.png、02-unavailable.png、03-restored.png。目前無法將本機圖片附加到 GitHub PR,因此PR 未附截圖;審查者無法透過上述本機路徑存取圖片。檢查清單
tool/check/commits.sh origin/main..HEAD通過;單一 commit 標題符合 repository 規範tool/commit.sh --push的 CI gates 通過;最新 Dart 測試 3,136 passed、10 skipped;Full iOS tests 363 passed、0 failed