Skip to content

feat: add tsunami map layer and official social links - #588

Merged
whes1015 merged 14 commits into
mainfrom
feat/tsunami-map-layer
Oct 11, 2026
Merged

whes1015 merged 14 commits into
mainfrom
feat/tsunami-map-layer

Conversation

@PiscesXD

@PiscesXD PiscesXD commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

這個 PR 做了什麼

地圖新增 CWA 海嘯警報圖層(預估浪高、抵達時間、沿岸觀測),可設為開啟地圖時的預設圖層,海嘯通知也改為開啟地圖。同一個分支另外補上更多頁面的官方社群連結,並修正幾處地圖浮動按鈕與選單的細節。

正式程式碼

  • 海嘯(lib/features/tsunami/):API、repository 與 TsunamiReport 領域模型(freezed);tsunami_layer.dart 是地圖圖層,含沿岸警戒線,線寬會隨地圖放大加寬;tsunami_panel.dart 是面板;notification_routes.dart 讓海嘯通知改開地圖;api.md 補上端點。
  • 共用元件:從颱風面板抽出 SelectablePill(typhoon_panel.dart −57、selectable_pill.dart +68)。
  • 設定:預設圖層清單多一個「海嘯警報」(default_map_layer.dart、default_map_layer_ui.dart、map_layer_category.dart)。
  • 地圖 UI:各圖層選單展開改為動畫(*_overlay_menu.dart、map_chip_button.dart、map_town_labels.dart);地震回放頁的返回與圖例按鈕對齊地圖 chip(report_replay_page.dart、collapsible_map_legend.dart)。
  • 更多頁面:新增官方 Threads、Instagram、Facebook 連結(more_page.dart),Facebook 使用 exptech.com.tw/dpip_tw_FB。
  • 在地化:新字串加進 12 個 ARB 與其產生檔;另有一則修正,讓地震圖層的標題在各語言都有翻譯。

測試

  • 新增 tsunami_report_test.dart(+326)。
  • 更新 notification_routes_test.dart、default_map_layer_test.dart、map_layer_category_test.dart、map_page_test.dart、more_page_test.dart,以及地震報告詳情與回放頁的測試。

規模:61 個檔案,+4900/−196。其中 tsunami_report.freezed.dart(約 1,459 行)、10 個 l10n 產生檔與 12 個 ARB 屬於產生或翻譯內容,審查時可以略過,重點在上面列出的檔案。

相關 issue

未指定相關 issue。

怎麼驗

已跑過的檢查

  • 對 c6fe0401 在本機(Darwin)跑 DPIP_NO_CACHE=1 tool/commit.sh,不使用快取:format、analyze、codegen 一致性與完整測試全部通過,測試 3136 個通過、10 個跳過、0 個失敗。CI 跑在 Linux,會呼叫 shell 的測試仍可能有差異。
  • CI:changes、build、Android、codecov/patch、codecov/project 已成功;撰寫時 iOS 與 code-review 還沒有結果。

尚未有紀錄的部分:這份描述沒有記錄實機測試或前後截圖,請審查者在 iOS 與 Android 各確認一次:

  1. 開啟海嘯圖層:公告切換、預估浪高、抵達時間與沿岸觀測是否正常顯示。
  2. 放大地圖,沿岸警戒線是否跟著變寬。
  3. 從海嘯通知點進去,是否開啟地圖並停在海嘯圖層。
  4. 在設定把「海嘯警報」設為預設圖層,重開 app 是否生效。
  5. 更多頁面的三個社群連結是否能開啟。

安全關鍵部分(海嘯警報):海嘯資料在圖層載入時抓取,沒有走 RealtimeChannel,因此沒有 stale/offline 狀態。載入失敗時,圖層會清空公告並顯示錯誤,不會留著舊資料(見 tsunami_layer.dart 約 150–155 行)。這是讀程式碼得到的結論,沒有實測過斷網或伺服器錯誤的情況,審查時請特別看這一段。

檢查清單

  • tool/check/commits.sh origin/main..HEAD 通過
    —— commit 訊息就是更新日誌,格式見 commit.md
  • 一個 commit 一件事(這條 gate 驗不了,靠自己和 review)
  • mise exec -- flutter analyze 與 mise exec -- flutter test 通過
  • 新的使用者可見字串都走 AppLocalizations,沒有寫死
  • 有 UI 變更的話:用的是 AppSpacing / AppRadius / AppMotion,
    深色模式看過,文字對比度可接受

@PiscesXD PiscesXD changed the title Feat/tsunami map layer feat(tsunami): overlay the CWA tsunami bulletins on the map Oct 5, 2026
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.97812% with 320 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.41%. Comparing base (1271afb) to head (b84a075).

Files with missing lines Patch % Lines
...atures/map/presentation/widgets/tsunami_panel.dart 0.60% 165 Missing ⚠️
...eatures/map/presentation/layers/tsunami_layer.dart 21.05% 135 Missing ⚠️
...features/tsunami/data/tsunami_repository_impl.dart 0.00% 7 Missing ⚠️
lib/features/tsunami/data/tsunami_api.dart 0.00% 5 Missing ⚠️
...thquake/presentation/pages/report_replay_page.dart 69.23% 4 Missing ⚠️
lib/features/tsunami/tsunami_providers.dart 0.00% 3 Missing ⚠️
lib/bootstrap.dart 0.00% 1 Missing ⚠️

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lowrt lowrt added this to the v26.4 milestone Oct 5, 2026
Comment thread lib/l10n/gen/app_localizations_ja.dart Outdated
Comment thread lib/l10n/gen/app_localizations_ja.dart
@PiscesXD
PiscesXD force-pushed the feat/tsunami-map-layer branch from c3da814 to 1dd987b Compare October 8, 2026 07:20
@lowrt
lowrt force-pushed the feat/tsunami-map-layer branch 3 times, most recently from 1691363 to 9b2ba21 Compare October 11, 2026 03:47
@PiscesXD
PiscesXD force-pushed the feat/tsunami-map-layer branch from 9b2ba21 to c8d89f1 Compare October 11, 2026 05:34
PiscesXD and others added 12 commits October 11, 2026 21:46
Platform: all

New(zh-Hant): 地圖可以疊上海嘯警報圖層,看預估浪高、抵達時間與沿岸觀測
New(en-US): the map can overlay tsunami warnings with expected heights, arrival times and coastal readings
Platform: all

New(zh-Hant): 地圖預設圖層可以選海嘯警報
New(en-US): the default map layer can be the tsunami overlay
Platform: all

Fix(zh-Hant): 修正其他語言的圖層分類標題被換成英文
Fix(en-US): the earthquake layer header no longer falls back to English in other languages
Platform: all

Fix(zh-Hant): 修正地圖上的篩選選單展開時沒有動畫、直接出現在畫面上
Fix(en-US): the map's filter menus now expand with an animation instead of just appearing
Platform: all

Fix(zh-Hant): 修正地震回放頁的返回與圖例按鈕和地圖上的按鈕高度不一致
Fix(en-US): the replay page's back and legend buttons now match the height of the other map buttons
Platform: all

Fix(zh-Hant): 調整海嘯沿岸警戒線圖層順序
Fix(en-US): adjust tsunami coastline layer order
Platform: all

New(zh-Hant): 更多頁面新增 DPIP 官方 Threads、Instagram 與 Facebook 連結
New(en-US): the More page links to the official DPIP Threads, Instagram and Facebook accounts
Platform: all

Fix(zh-Hant): 海嘯預報海岸線放大地圖後會變粗,不再細到看不清楚
Fix(en-US): the tsunami forecast coastline now thickens as you zoom in instead of staying a hairline
@PiscesXD
PiscesXD force-pushed the feat/tsunami-map-layer branch from 71ad0b0 to c6fe040 Compare October 11, 2026 13:49
@PiscesXD PiscesXD changed the title feat(tsunami): overlay the CWA tsunami bulletins on the map feat: add tsunami map layer and official social links Oct 11, 2026

@lowrt lowrt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@whes1015
whes1015 merged commit a89ec77 into main Oct 11, 2026
5 of 6 checks passed
@whes1015
whes1015 deleted the feat/tsunami-map-layer branch October 11, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants