fix(split-meow): 混幣行程停止跨幣別錯誤加總與結算 - #451
Merged
Merged
Conversation
- 混幣行程的總額、各人餘額與結算改為短路不計算,避免裸加不同幣別 - 隱藏混幣情境的「各人結算」區塊,僅保留警告,杜絕誤導金額 - 抽出 resolveExpenseCurrency 等純函式至 currencies SSOT 並補單元測試 - 編輯既有費用改用該筆 currency 快照顯示符號,不再依賴全域幣別 測試:split-meow typecheck 通過、vitest 3 檔 71 測試全過
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47353cc4db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
摘要
混幣行程(同一行程混用多種幣別)先前在「各人結算」仍把不同幣別的裸數字相加,顯示誤導金額。本 PR 收斂為:混幣時短路不計算總額/餘額/結算,僅保留警告並隱藏結算區塊。
背景 / 證據
isMixedCurrency原本只擋總額與結算區塊,但balances仍裸加 TWD+KRW。變更
currencies.ts:抽出純函式resolveExpenseCurrency/resolveTripCurrency/isMixedCurrencyTrip/computeMemberBalances作為領域 SSOT,並補單元測試。HistoryTab.tsx:混幣時totalSpent=0、balances={}、settlements=[],隱藏「各人結算」;useShallow窄 selector 訂閱;EditExpenseSheet改用該筆expense.currency快照顯示符號。影響範圍
僅
apps/split-meow;單幣別行程行為完全不變。驗收
pnpm --filter @app/split-meow typecheck✅useStore/currencies/HomeAndHistorySmoke共 71 測試通過(全套 181 通過)✅🤖 Generated with Claude Code