Skip to content

fix(earthquake): localize and align report day headers - #575

Merged
PiscesXD merged 3 commits into
mainfrom
fix/earthquake-report-header
Sep 20, 2026
Merged

PiscesXD merged 3 commits into
mainfrom
fix/earthquake-report-header

Conversation

@PiscesXD

@PiscesXD PiscesXD commented Sep 14, 2026

Copy link
Copy Markdown
Member

這個 PR 做了什麼

  • 地震報告日期標題顯示完整日期、星期,以及「今天/昨天」相對標籤。
  • 日期標題禁止換行;中間分隔線會填滿剩餘寬度,當日筆數固定靠右對齊,避免不同手機寬度造成跑版。
  • 強震監視器與報告回放改用同一份圖層堆疊(lib/shared/map/monitor_map_stack.dart),鄉鎮名稱不再蓋住測站讀數。

地圖圖層顯示順序

這個堆疊的順序本身就是契約。所有圖層一律用 append(不帶 belowLayerId),插入順序即決定疊放,後加的在上。由下而上:

估計震度底色 → 鄉鎮名稱 → 測站圓點 → 測站讀數標籤 → 離散震度圓標 → 偵測框線 → P/S 波前 → 震央十字

  • 估計震度底色不在這裡掛載,它就是底圖的 town fill 原地改色,所以同樣留在名稱底下。鄉鎮名稱因此落在整張圖的倒數第二層:在底色之上、所有讀數之下。
  • 唯一錨定的例外是 EEW S 波圓盤 rts-eew-s-fill,錨在 landLayerId 之下,讓水波只鋪在外海,不蓋住台灣本島。
  • MapLibre 的 symbol 由上往下擺放。標籤在鄉鎮名稱之上,碰撞時贏的是測站讀數 —— 這正是目的:不該為了保留一個地名而丟掉一筆即時讀數。圓標與十字設 iconIgnorePlacement,不參與碰撞,也就不會反過來壓掉地名。
  • 震央十字必須留在最後一個加入:它是唯一絕不可被蓋住的標記。

怎麼驗

  • tool/dev/test.sh test/features/earthquake/report_day_group_test.dart
  • tool/dev/test.sh test/features/map/presentation/layers/rts_layer_demo_test.dart(9 passed)
    • every monitor layer is appended above the township names, except the S-wave disc anchored below the land —— 逐一斷言七個圖層的 belowLayerId 為 null(代表 append 到 style 最上層,落在底圖 town-label 之上),並斷言 rts-eew-s-fill 確實錨在 landLayerId
    • the epicentre cross stacks above the box grid, which stacks above the station dots — matching the legacy monitor —— 釘住由下而上的相對順序。
    • the grey island stays opaque under the shaking wash, so the S-wave disc cannot bleed through a township reading —— 確認 S 波圓盤不會透到陸地上的鄉鎮讀數。
  • tool/dev/analyze.sh
  • tool/commit.sh(完整測試 1835 passed)
  • tool/check/commits.sh origin/main..HEAD
  • 確認使用 AppLocalizationsintl locale,沒有新增硬編碼語系文字

檢查清單

  • 一個 commit 一件事
  • 新的使用者可見文字支援 i18n
  • 使用既有 AppSpacing / AppRadius,並處理窄螢幕與寬螢幕排版
  • 圖層順序以測試釘住,不靠人工目視

@PiscesXD PiscesXD changed the title fix(earthquake): align report day headers fix(earthquake): localize and align report day headers Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ Successfully posted inline: 1 comment(s)

Comment thread lib/features/earthquake/presentation/pages/report_list_page.dart Outdated
Comment thread lib/features/earthquake/presentation/pages/report_list_page.dart Outdated
Comment thread lib/features/earthquake/presentation/pages/report_list_page.dart Outdated
Comment thread lib/features/earthquake/presentation/pages/report_list_page.dart Outdated
@lowrt lowrt added this to the v26.3 milestone Sep 15, 2026
lowrt
lowrt previously approved these changes Sep 17, 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

Comment thread lib/features/earthquake/presentation/pages/report_list_page.dart
@codecov

codecov Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.75000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.16%. Comparing base (802078d) to head (d26e4b0).

Files with missing lines Patch % Lines
...thquake/presentation/pages/report_replay_page.dart 0.00% 10 Missing ⚠️
...ib/features/map/presentation/layers/rts_layer.dart 80.95% 4 Missing ⚠️
...arthquake/presentation/pages/report_list_page.dart 94.87% 2 Missing ⚠️
lib/shared/map/monitor_map_stack.dart 97.77% 2 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.

@PiscesXD

PiscesXD commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

這個 PR 也修復了 ET-2026-0164 DPIP防災 26.3 EEW時圖層問題

@PiscesXD
PiscesXD requested review from lowrt and whes1015 September 19, 2026 19:35
Fix(zh-Hant): 地震報告日期與筆數固定對齊
Fix(en-US): align earthquake report dates and counts consistently
Fix(zh-Hant): 地震報告列表的日期標題不再在日期後面留一段空白
Fix(en-US): the report list's day heading no longer leaves a gap after the date
Fix(zh-Hant): 強震監視器與報告回放地圖的鄉鎮名稱不再蓋住測站讀數
Fix(en-US): township names no longer cover the station readings on the monitor and replay maps
@PiscesXD
PiscesXD force-pushed the fix/earthquake-report-header branch from 2401677 to d26e4b0 Compare September 19, 2026 19:46

@YinCheng0106 YinCheng0106 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@PiscesXD
PiscesXD merged commit 7766ff5 into main Sep 20, 2026
8 checks passed
@PiscesXD
PiscesXD deleted the fix/earthquake-report-header branch September 20, 2026 15:16
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.

3 participants