Skip to content

Page-wide sweep for invisible render work, with three correctness fixes - #569

Open
whes1015 wants to merge 4 commits into
mainfrom
fix/highlights-name-the-cycle
Open

Page-wide sweep for invisible render work, with three correctness fixes#569
whes1015 wants to merge 4 commits into
mainfrom
fix/highlights-name-the-cycle

Conversation

@whes1015

@whes1015 whes1015 commented Sep 7, 2026

Copy link
Copy Markdown
Member

地毯式檢查所有頁面,找出「畫了但沒有人看得見」以及「每次 build 重算但結果不可能變」的開銷並修掉,同時修正過程中確認的三個行為缺陷。

三個行為修正

  • 強震監視器的 EEW 倒數切到其他分頁後從來沒停過,等於每秒喚醒一次手機。根因不是判斷式寫錯,而是沒有東西去觸發重新評估:VisibleTabScope 整個生命週期都遞同一個實例,updateShouldNotify 永遠不會觸發,consumer 必須自己訂閱。判斷式刻意只測分頁而不用 isOnScreen,否則 showDialog 會讓一個在半透明 barrier 周圍仍然看得見的 S 波倒數凍住,把過期的安全數字當成當下的值呈現。
  • 首頁面板上滑時那層模糊沒有作用在地圖上。原本用 ImageFiltered,它模糊的是自己那塊均勻的 ColoredBox child,除了外緣羽化以外什麼都沒動。改成 BackdropFilter
  • 重點整理頁在 26.2 的 build 上仍然寫著 26.1。同一個週期的重點內容是一樣的,所以改成標示週期:26.1 和 26.2 都顯示 26.x。需要真實版號的地方(更多頁的版本卡、Apple marketing version)沒有動。

效能整理

15 個檔案,全部是等價替換,沒有任何一項改變畫面上的結果。

  • 每次 build 重建但結果不可能變的:縣市清單與鄉鎮掃描(build 在搜尋框每打一個字就走過全部 368 個鄉鎮)、DateFormatRegExpCustomPainter 迴圈裡的 Paint、行星頁重複解的 Kepler。
  • 看不見卻仍在跑或仍在畫的:一個沒有任何 listener、邊框從來沒動過一次的無限 AnimationController;每次 layout 都重跑的 IntrinsicHeight;收合後仍留在樹上的 ExpansionTile 子樹;ruler tick 的 repaint boundary 與 keep-alive。
  • 多餘的層、過大的 rebuild 範圍watchselect、整頁 rebuild 收斂成 Consumer、每列一個透明 Material 收斂成整卡一個、Material(color: transparent)MaterialType.transparency
  • 解碼:bug tracker 的頭像來源常常是 1024 見方的 CDN 圖,實際畫出來最寬 30 邏輯 px,一張就是 4 MB RGBA 被 image cache 留一整個 session。改成走框架的 decode 給 target size,長邊上限 256。上限只能放在解碼不能放在 URL,因為那個字串同時是 ETag 的身分。

Review 時值得注意

  • highlight_card 兩處 ExpansionTile 拿掉了 maintainState: true,這是行為改變。PageStorageKey 保留,展開與收合的狀態一樣會記住。
  • 同一個檔案 270 行的 diff 幾乎都是反縮排造成的,實際改動是移除一層無效的 Theme(dividerColor: transparent) wrapper。
  • region_city_page 補了 didUpdateWidget:go_router 用路由 pattern(:city)當 key 而不是解析後的城市,所以 go() 或 deep link 到另一個城市會沿用同一個 State。

驗證

tool/check.sh 全數通過,測試 1796 passed、5 skipped,codegen 重跑後產物零差異,commit gate 4/4。

gate 是在 Darwin 上跑的,CI 跑 Linux,會 shell out 的測試在那邊仍然可能不同。

Fix(zh-Hant): 修正重點整理頁在 26.2 上仍寫著 26.1,整個 26 週期現在都顯示 26.x
Fix(en-US): fix the highlights page reading 26.1 on a 26.2 build; it now names the whole cycle
Fix(zh-Hant): 強震監視器的 EEW 倒數卡切到其他分頁後不再每秒喚醒手機
Fix(en-US): the monitor's EEW countdown no longer wakes the phone once a second from another tab
Optimization(zh-Hant): 多個頁面不再重複計算或繪製看不見的內容,搜尋輸入、清單捲動與分頁切換都更省電
Optimization(en-US): several pages no longer recompute or repaint what nothing on screen shows, so typing, scrolling and tab switches cost less battery
Fix(zh-Hant): 首頁面板上滑時地圖真的會糊化了,之前那層模糊沒有作用在地圖上
Fix(en-US): raising the home sheet now actually blurs the map behind it
@whes1015 whes1015 changed the title Fix/highlights name the cycle Page-wide sweep for invisible render work, with three correctness fixes Sep 7, 2026
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.

1 participant