Repository navigation
Conversation
Platform: all New(zh-Hant): 觀測排行可以選擇資料時間,溫度分頁也能切換當下與當日極值 New(en-US): rankings can pick their data time, and the temperature tab switches between the reading and the day's extremes
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 做了什麼
觀測排行原本永遠只排「最新」那一刻的資料:資料時間是唯讀的,也沒有任何入口能回到過去,溫度極值則另外佔一個分頁。這個 PR 讓排行可以指定快照時間,並把溫度與溫度極值收進同一個分頁。
/api/v5/meteor/{weather,rain}/list回傳的快照時間(weather 每小時、約三天;rain 十分鐘),選了就改抓/{sec}歷史快照重新排名。選「最新」時仍走latest(),下拉刷新維持即時;抓過的歷史快照依秒數快取,來回切換不再打網路。?tab=tempExtremes|high|low|range的舊深連結仍然可用(開在溫度分頁並預選對應 chip),資料頁的「溫度極值」磚塊也留著,只是改開同一個分頁。hi/lo/hit/lot(陣風有gt發生時間),其餘欄位沒有極值;用每小時快照自行推算會低報(陣風尤其嚴重,整點取樣看不到 :30 的峰值),所以這部分需要後端先提供,不在這個 PR 裡用推算的數字充數。改到的檔案:
lib/features/weather/presentation/pages/weather_ranking_page.dart(選時間、載入歷史、溫度分頁)、新增lib/features/weather/presentation/widgets/ranking_time_sheet.dart(時間選擇器)、lib/features/weather/domain/weather_ranking.dart(TempRankMetric與rankTemperature)、lib/app/router/app_router.dart(?metric=與舊?tab=值)、12 個lib/l10n/app_*.arb與生成檔(新增weatherRankingCurrent/Latest/PickTime,移除不再使用的weatherRankingHighest/Lowest)。test/features/weather/presentation/pages/weather_ranking_page_test.dart(假 repo 補上history()/at(),新增四則:選歷史時間、回到最新、雨量落在自己的快照、沒有歷史時不顯示選擇器)、test/features/weather/domain/weather_ranking_test.dart(rankTemperature的四個 metric)。相關 issue
怎麼驗
tool/check.sh全過(format/analyze、codegen 一致、每一道 shell gate、flutter test3637 passed / 6 skipped)。at()、列表換成歷史數值、AppBar 不再寫「最新」、回到最新後不會再打at()。檢查清單
tool/check/commits.sh origin/main..HEAD通過flutter analyze與flutter test通過AppLocalizations,沒有寫死gh pr checks:build、Android、iOS、changes、code-review 全 pass)