fix(ratewise): E8 wave-B 審查殘項修復——overlay 計時清除、趨勢請求去重、settle 守門(#669) - #695
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
- handleExpressionChange 於運算式進行中一律重排同一 settle 計時,settle 後單按運算子的 overlay 自動清除 - shareInFlight util 收斂併發去重:銀行與換錢所歷史服務同套,冷快取雙 hook 掛載各僅發一次 - shareInFlight finally 加 identity check:clear 後新註冊的同鍵請求不被舊 finally 誤刪 - flushHistorySettle 註解如實化:aria-live 對相同文字不重播,不再宣稱同值重播 - 來源切換排定 announce-only settle:新來源重算值重播 SR status、不寫歷史,與 B2 cancel 語意協調 - timer settle 落在運算式未完成時只播報不寫入歷史(PM 裁決 (a) 格) - deferred dirty 延至切列、unmount 或 visibilitychange hidden 邊界寫入最終值,封閉關 app 遺失窗口 - 新增 002 記錄 reward-rw-669-e8-wave-b-residuals(+1 → 累計 +204)與 patch changeset 測試:vitest 全套綠、相關測試檔 177 綠(新增 15 條,兩輪紅燈驗證 8+4 紅)、converter-v2 e2e 28 綠 Co-authored-by: Cursor <cursoragent@cursor.com>
s123104
force-pushed
the
fix/669-e8-residuals
branch
from
July 8, 2026 18:14
a52fee2 to
02318dc
Compare
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
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.
Closes #669
摘要
修復 PR #668 審查三項 Should-fix 殘項+QA-J J-2/J-4 兩項補充,共五項;另依 PM 裁決補強四項(見下)。全數走既有 settle 單計時器機制(無平行計時器)、B1/B2 守門語意不破,#667/#668 既有守門測試零回歸。
PM 裁決記錄((a) 格取捨)
visibilitychange → hiddenflush(採 repo 既有慣例,v1 SingleConverter 同款)——頁面轉入背景即走既有flushHistorySettle非 timer 路徑寫入最終值,關 app 前必經 hidden,窗口封閉。五項對照
1. 運算式 overlay 殘留(issue 第 1 項)
settleDirtyRef為 false → 舊版handleExpressionChange只在inProgress && dirty時排計時 → overlay 顯示後無計時器清除,常駐至下次輸入handleExpressionChange於inProgress一律(重)排同一 settle 計時——有 pending settle 時為展延(原語意不變);無 pending 時作為 overlay 隱藏計時,flush 落在非 dirty 非 announce 路徑只清 overlay、不寫不播第 1 項:settle 後單按運算子(值未變),overlay 沿 settle 計時自動清除且不寫歷史2. 趨勢雙 hook 重複抓取(issue 第 2 項)
src/utils/shareInFlight.ts收斂演算法,exchangeRateHistoryService(fetchHistoricalRatesRange鍵含天數、fetchLatestRates)與moneyboxRateService(fetchExchangeShopHistoricalRatesRange鍵含幣別+天數)同套;完成後自清(不變成永久快取),clearCache同步清空useConverterTrend同參數同 commit 掛載,銀行與換錢所兩模式冷快取各僅 1 次請求)3. SR 同值重播註解不符(issue 第 3 項)
flushHistorySettle註解不再宣稱「同值重輸入 SR 回饋不消失」,改為如實描述——aria-live 對完全相同文字不重播(瀏覽器行為),播報置於去重守門之前的目的為「同鍵不同結果(匯率更新)時播報不因歷史去重而消失」4. QA-J J-2:換錢所切換後 SR status 停留舊播報
handleToggleRateSource與換錢所啟用中的 chip tap(回銀行)在既有 B2 cancel 之後排定 announce-only settle(共用同一計時器);新來源重算值 settle 時自然重播 SR status,不寫歷史(與 feat(ratewise): v2 等值雙列功能補全第二波(E8 wave-B) #668 B2 cancel 語意協調);尚無任何播報時不排定(無 stale status 可修)5. QA-J J-4:運算式中間 settle 值寫入歷史噪音
expressionInProgressRef由 keypad 表達式回報同步);dirty 保留,待切列/unmount/visibilitychange hidden(PM 裁決封窗)邊界(運算式作廢、列值即最終值)才寫入;語意變更(swap/幣別/基準)仍走 B2 cancel 不寫1000+5停頓 2s 不寫入(SR 照播)→ 切列寫入最終值一筆;deferred dirty 不跨 swap 存活;背景切換 flush(見補強 1)PM 裁決四項補強
document.hidden時 flush deferred dirty(非 timer 路徑);listener 有 cleanup(unmount 移除,測試鎖定);effect 掛在 SingleConverterV2 內部(掛載後才註冊),與 fix(ratewise): 修復 persisted v2 冷載觸發 React #418 hydration mismatch #664 hydration gate(外層 wrapper two-pass)無交互fetchExchangeShopHistoricalRatesRange套同一shareInFlight(鍵moneybox:<currency>:<days>,TTL cache miss 時共享);hook 層測試斷言換錢所模式雙 hook 冷快取 aggregate ×1inFlight.get(key) === request才 delete,防clearCache後新註冊的同鍵請求被舊 finally 誤刪驗收證據
pnpm --filter @app/ratewise exec vitest run SingleConverterV2 exchangeRateHistoryService moneyboxRateService useConverterTrend:6 檔 177 passed(新增 15 條;兩輪紅燈驗證:第一波還原 8 紅、補強波還原 4 紅,復原後全綠)pnpm --filter @app/ratewise exec vitest run全套:passed(feat(ratewise): E8 wave-A — v2 等值雙列功能補全第一波(快速金額/歷史寫入/方向翻轉/長按複製) #667/feat(ratewise): v2 等值雙列功能補全第二波(E8 wave-B) #668 既有守門零回歸)reward-rw-669-e8-wave-b-residuals(+1 → 累計 +204,base 未動)Made with Cursor