Conversation
The banded (CWA) legend had two independent failures, either of which made the 雨量 legend useless: - the swatch cells are plain ColoredBoxes (no intrinsic width), so under the Column's default cross axis they collapsed to zero and the whole band strip vanished — the boundary numbers kept rendering with no colour beside them; - the boundary-label column is a Stack inside a Row, and a Stack refuses unbounded width, so expanding the legend inside the collapsed chip (AnimatedSize) threw a layout assertion every frame and, in debug, the legend never appeared at all. The column now measures the widest label and carries its own width (text scaling included). Fix(zh-Hant): 雨量圖例的色階色帶恢復顯示,每個數字左側的顏色不再消失 Fix(en-US): the rainfall legend's colour bands paint again — every boundary number has its colour back on the left
資料 > 地震報告 的詳情地圖與重播地圖,右上角現在都有跟強震監視器 一樣的圖層選單:詳細街道圖(OSM)、地形立體感、鄉鎮名稱,全部經 SettingsStore 寫入 sqlite 的 settings 表,與地圖頁共用同一組 key, 重開 app 維持原樣。詳情頁的右上角在 sheet 完全展開時與左上角返回鍵 一起隱藏,重播頁沒有 sheet 則常駐。 為此把 MapScaffold 的基底圖層同步迴圈(terrain / OSM 的 add-remove 與互斥)抽成共用的 BasemapOverlaySync,三個 surface 用同一份實作, 並用 RecordingMapController 補上 8 個測試。 New(zh-Hant): 地震報告與重播地圖右上角新增圖層選單——詳細街道圖、地形立體感、鄉鎮名稱都可切換,設定會記住 New(en-US): the earthquake-report and replay maps gain a layer menu — street detail, terrain relief and township names — in their top-right corner, remembered between sessions
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.
摘要
修復雨量圖例的兩個渲染問題(色帶整條消失、展開即拋 layout assertion),並為地震報告詳情頁與重播頁的地圖加上跟強震監視器一樣的右上角圖層選單——詳細街道圖(OSM)、地形立體感、鄉鎮名稱,設定全部存進 sqlite、與地圖頁共用。
變更內容
🐛 雨量圖例修復
兩個互相獨立的壞因,任一個都會讓雨量圖例變得不可用:
ColoredBox沒有 intrinsic width,在Column預設 cross axis 下被 loose constraints 縮成零寬——邊界數字照常渲染,但數字左邊完全沒有顏色。改為CrossAxisAlignment.stretch讓每個色塊填滿 swatch 寬度。Row裡的一個Stack,而 Stack 拒絕無界寬度——圖例放在收合 chip(AnimatedSize)裡,展開瞬間每幀拋 assertion,debug 下圖例根本長不出來。改為以TextPainter量測最寬標籤、讓標籤欄自帶寬度(含文字縮放)。新增回歸測試:在 chip 內展開、semantics 開啟(對齊 VoiceOver 場景),斷言無例外且 17 個 CWA 色塊各 8px 寬。
🗺️ 地震報告/重播地圖的圖層選單
MapBasemapMenu:詳細街道圖(OSM)、地形立體感、鄉鎮名稱三個 toggle;指南針移到選單下方,與其他頁一致SettingsStore寫入 sqlite 的settings表,與地圖頁共用同一組 key——任何一頁切換,其他頁跟著變,重開 app 也維持_sheetExpanded模式);重播頁沒有 sheet,控制項常駐♻️ 共用基礎
MapScaffold的基底圖層同步迴圈(terrain / OSM 的 add-remove 與互斥、style reload 重置)抽成共用的BasemapOverlaySync——地圖頁、詳情頁、重播頁三個 surface 用同一份實作RecordingMapController補上 8 個測試:terrain 掛載/移除、GSI 掛載/拆除/群組可見性批次更新、style reload 後的狀態重置、controller 換手中止同步測試
tool/check.sh全綠(format / analyze / l10n / layering / storage / codegen / 1724 tests)basemap_overlay_sync_test.dart(8 tests)與rain_legend_test.dart(1 test,先驗證過對未修復程式碼會失敗)怎麼驗
備註
MapBasemapMenu及其列),無新增 ARB