Skip to content

feat(ios-widget): open configured location - #608

Merged
YinCheng0106 merged 3 commits into
mainfrom
feat/ios-widget-open-configured-location
Oct 13, 2026
Merged

YinCheng0106 merged 3 commits into
mainfrom
feat/ios-widget-open-configured-location

Conversation

@YinCheng0106

@YinCheng0106 YinCheng0106 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

這個 PR 做了什麼

iOS 天氣 Widget 點擊後會開啟 DPIP,並依該個 Widget 已設定的地點切換首頁選取區域,讓不同地點的 Widget 各自導向正確的預報。冷啟動與暖啟動都沿用同一個 deep link;目前位置 Widget 導向「所在地」,已儲存地區 Widget 導向其保存的地區。

  • 正式程式碼:Widget timeline entry 依每個 Widget 設定保留 navigation target,透過 widgetURL 傳入 dpip:///home?widgetLocation=...;Gallery Preview 的西屯區樣本只供預覽,不會取代使用者設定的導向目標。
  • 正式程式碼:Flutter router 在首頁消費待處理的 Widget 地點並更新區域選取;冷啟動與暖啟動共用路由入口。尚未完成 onboarding 時仍先依既有流程完成 onboarding,再處理地點。無效或已不存在的地點不套用錯誤選取。
  • 相容性:過期預報仍維持原設定地點的 deep link;Gallery Preview 樣本不改寫導向目標,Forecast Expiry 與 Gallery Preview 功能均保留。
  • 測試:新增 WidgetLocationIntentTests.swift、app_router_test.dart、widget_location_routes_test.dart 回歸案例,涵蓋預報到期、Gallery 樣本、連續 Widget 事件、通知 Home fallback 與 EEW map 路由相容性。
  • 提交:911c4bad(功能)與 32b939be(回歸測試)。

相關 issue

沒有找到對應 issue。

怎麼驗

自動化驗證

  • DPIP_NO_CACHE=1 tool/commit.sh:所有 CI gates 通過;Dart 3145 passed、10 skipped;format/analyze、靜態 gates 與 codegen 通過(codegen 寫入 0 outputs)。提交後再次執行 tool/commit.sh,同樣通過。
  • Full Swift:tool/dev/test_ios.sh,368 passed、0 failed。
  • Focused Dart:43 passed。
  • Widget Extension build:PASS;Intent Extension build:PASS。
  • git diff --check 通過;PR 含兩筆 feature commits,沒有 merge commit。

實際 Simulator Home Screen QA

  • iPhone 18 Pro/iOS 27.0 Simulator 上實際操作 Home Screen Widget:西屯區 Widget、沙鹿區 Widget、Current Location Widget;暖啟動、連續點擊與已確認 Runner 終止後的冷啟動均導向預期地點。
  • 以 Simulator App Group 的預報快取控制到期狀態,確認過期/不可用預報 Widget 顯示 unavailable 後,點擊仍導向其設定地點。這不是自然等待到期或 API outage 測試。
  • QA 截圖與記錄未附為公開證據;PR 不引用本機路徑。

尚未驗證

  • 未做實體 iPhone QA。
  • Simulator 沒有 GPS fix;Current Location 驗證的是導向「所在地」選取項目,不代表實際定位成功。
  • 真實通知與 Widget 同時抵達尚未端到端測試。
  • 此次整合 QA 未驗證自然長時間閒置到期,也未驗證 API outage/恢復。上述情境不可視為通過。

檢查清單

  • tool/check/commits.sh origin/main..HEAD 通過
  • 一個 commit 一件事
  • tool/commit.sh 所有 gates 通過;Dart 3145 passed、10 skipped;Swift 368 passed、0 failed
  • 本 PR 未新增使用者可見字串
  • 實體裝置 QA:未執行
  • 自然長時間到期與 API outage QA:未執行

Platform: ios

New(zh-Hant): 點擊 iOS 天氣小工具可開啟其設定地點的首頁天氣
New(en-US): Open the configured location weather when tapping an iOS widget
@YinCheng0106 YinCheng0106 added the ios Issues or pull requests related to the iOS platform. label Oct 12, 2026
@YinCheng0106 YinCheng0106 added this to the v26.4 milestone Oct 12, 2026
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.43%. Comparing base (a4d918b) to head (4dd11c4).

☔ 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.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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

  • ✅ Successfully posted inline: 5 comment(s)

Comment thread ios/DPIPWidgets/WidgetLocationTarget.swift
Comment thread ios/DPIPWidgets/WidgetLocationTarget.swift Outdated
Comment thread lib/features/home/presentation/pages/home_page.dart
Comment thread lib/features/home/presentation/pages/home_page.dart
Comment thread lib/shared/navigation/widget_location_link.dart
Platform: ios

Fix(zh-Hant): 修正 iOS 小工具地點路由與重複天氣更新
Fix(en-US): fix iOS widget location routing and repeated weather refreshes
@YinCheng0106 YinCheng0106 self-assigned this Oct 13, 2026
@YinCheng0106
YinCheng0106 marked this pull request as ready for review October 13, 2026 00:27
Copilot AI balanced review requested due to automatic review settings October 13, 2026 00:27

This comment was marked as low quality.

@YinCheng0106
YinCheng0106 merged commit 9645d7b into main Oct 13, 2026
8 checks passed
@YinCheng0106
YinCheng0106 deleted the feat/ios-widget-open-configured-location branch October 13, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ios Issues or pull requests related to the iOS platform. size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants