Repository navigation
Conversation
…sfer (v1.16.26) A ZELLE transfer set to Expense (drawer or bulk Set type) stayed on the Transfers screen and out of Spending's categories, kept the category Transfer out, and after a reload dropped out of Spending's total too. Three causes: - The totals went by category: sumIncome(), sumExpense(), sumTransfers(), byCategory(), byMonth(), detectRecurring(), transferPairs(), starterBudgetList() and the Income, Spending and Bills screens counted the categories Transfer / Transfer in / Transfer out as a transfer whatever the type. The built-in rules give ZELLE, TRANSFER, ACH, VENMO, PAYPAL and COINBASE the category Transfer. - The drawer and bulk Set type left Transfer out / in on the row; a reload replaced it, finlens-state.json kept it. - A type change didn't run detection, so the retyped leg's partner (the card's payment for CREDIT CARD AUTOPAY) stayed a transfer until the next import, keyword change or reload. master has the same category checks, stores Transfer out in the edit of a row set to Expense, and doesn't run detection on a type change. The type now decides. The aggregation helpers and the three screens test t.type only; the category Transfer is a label. A row that isn't a transfer never shows Transfer out / in: ownCategories() (core.js) gives its own category (the user's, Re-categorize all's saved one where State.ruleCategories exists, the current ones, the CSV's, the row's, autoCategory()). The drawer and bulk Set type take the direction off the row and its edit and run redetectTransfers() after a type change; undoTransferDetection(), mkTx() and reconstituteTx() use ownCategories() for a non-transfer whose categories hold a direction. Changing a row to Transfer works as before. Without edits nothing changes: every number, screen and the AI summary on the samples match d98069a, and the eval sandbox summary is byte-identical. Version bumped to v1.16.26 (CHANGELOG, footer, README, Settings, CLAUDE.md); CLAUDE.md §4.1, §8, §11, §11.1, §13 and README Transfers updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Draft
5 tasks
…) into fix-retyped-transfer-still-counted Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBUZo6LRYpLthSp2PRi # Conflicts: # js/views-settings.js
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.
Summary
A transaction you change from Transfer to Expense or Income now counts as spending or income straight away, everywhere. Before, a ZELLE transfer set to Expense stayed on the Transfers screen and out of Spending's categories. It kept the category Transfer out, and after a reload it dropped out of Spending's total too.
The type now decides whether a row is a transfer, not its category. A row changed away from Transfer gets its own category instead of Transfer out / Transfer in. Detection runs again at once, so the leg it was paired with updates too.
Cause
Three parts:
sumIncome(),sumExpense(),sumTransfers(),byCategory(),byMonth(),detectRecurring(),transferPairs(),starterBudgetList()and the Income, Spending and Bills screens treated the categories Transfer, Transfer in and Transfer out as a transfer, whatever the type. Some helpers checked all three, some only Transfer. The built-in rules give ZELLE, TRANSFER, ACH, VENMO, PAYPAL and COINBASE the category Transfer.master has the bug. I probed
origin/master(v1.10.5) in a temporary worktree. In master's drawer I set the Sep 23 ZELLE row and the Oct 6 autopay to Expense:{ type: 'debit', categories: ['Transfer out'], … }.sumExpense()rose by $861.91, but the category breakdown didn't move.What changed
Totals by type (
aggregation.js,views-main.js). The eight helpers above and the Income, Spending and Bills screens testt.type === 'transfer'only. The Overview, Trends, Budget and the AI summary get this through the helpers.The category Transfer is now a label. On a row that isn't a transfer, it counts as spending or income like any other category. My reasons:
A row's own category:
ownCategories()(core.js). It takes the first of these, each without Transfer out / Transfer in:State.ruleCategories; skipped when that key doesn't exist).autoCategory(), else Other.For the ZELLE and ONLINE TRANSFER rows, that's Transfer.
Drawer and bulk Set type. Changing the type away from Transfer:
redetectTransfers(), which is the pass a keyword change already ran (reapplyTransferKeywords()now calls it).Changing a row to Transfer works as before.
Transfer out / in show only on transfers.
undoTransferDetection(),mkTx()andreconstituteTx()useownCategories()for a non-transfer whose categories hold a direction. That covers:The edit keeps the direction, so detection puts it back if the row becomes a transfer again.
Behavior change from v1.16.24. A ZELLE transfer you gave Transfer out + Housing shows Housing once "zelle" is removed. v1.16.24 showed both. Under the type rule, Transfer out would have become a spending category holding half the amount.
Version: v1.16.26 in CHANGELOG, footer, README, Settings and CLAUDE.md §1.
Docs: CLAUDE.md §4.1, §8, §11, §11.1, §13 and "Last updated"; README Transfers.
AI Eval
AIEval.loadSamples()→dataset.summaryis byte-identical to d98069a's: 941 characters, sha256df5557eab27fcfeb…on both. Checked intest-retype-transfer.js(section N).f2d6875b8675ae3d…).test-insights.jspasses: each quick analysis and your own question send the same body, headers and URL as the baseline.mkTx()now callsownCategories(), which can readState.ruleCategories, but only when an edit holds a direction. The sandbox has no edits. Once v1.16.25 is chained, its sandbox hasruleCategories: {}too.Not verified
State.ruleCategoriesby hand (section X). Not run with 1710fdd's code.redetectTransfers()now runs after every type change. It's the same pass a keyword change runs; I didn't time it on a large dataset.Automated checks: earlier run, not re-run · 3c9add8
Moved unchanged from this PR's "Test results" comment on 2026-11-04; not re-run, so not in the new table format. Originally a description section titled "How it was tested".
Light checks, by Luis's call to save usage: on this branch's final commit
3c9add8(chained on #48) onlyboot.js,race.jsand this PR's own tests ran. Headless Chromium at 1280×900 againstsamples/, with the pinned CDN libraries served from npm; each script ran asNODE_PATH=$(npm root -g) node <script> <repo> <outdir>.3c9add8boot.jsrace.jstest-retype-transfer.js(new in this PR)test-finances.js(edited again in this PR)test-clear-edits.js(edited again in this PR)test-untransfer-category.js(#47's, edited in this PR)test-recategorize.js(from #48)Full set, once, on the top of the stack (#23,
819e809: every PR below it merged in): every base suite and every fix test from #24 to #50, plus #10's and #23's, each in its final variant. All pass:test-clarity.js55/55,test-insights.js137/137,test-finances.js126/126,test-plan.js127/127,boot.js257 transactions and 0 errors,race.js0 errors; #24–#38's tests (clear-edits 48/48, rebuild-folder 57/57, partial-import 47/47, json-import 28/28, new-browser-copy 10/10, json-export 31/31, plan-links 60/60, rule-flags 67/67, drawer-flags 36/36, start-balance 193/193, ai-summary-period 78/78, account-names 40/40, account-order 32/32, drawer-focus 167/167, cleanup 21/21); #39–#50's tests (drawer-fields 45/45, read-as 52/52, json-import-edits 29/29, overlapping-exports 46/46, override-balance 160/160, card-override 277/277, ai-summary-trend 91/91, transfer-user-type 39/39, untransfer-category 27/27, recategorize 55/55, retype-transfer 135/135, minor-fixes 34/34);test-dbtab.js73/73,test-save-status.js64/64,test-master-port.js16/16. Three scripts needed a test-only change on that run, listed in #23 and in the PRs they belong to; the app code wasn't changed.test-retype-transfer.jsalso runs on the parent commit (v1.16.25: Fix "Re-categorize all" changes being lost after a reload #48): 67/67[bug]checks fail there, as expected.Composition with v1.16.25: Fix "Re-categorize all" changes being lost after a reload #48 (
State.ruleCategories): bothtest-recategorize.js(55/55) andtest-retype-transfer.js(135/135) pass on this commit.undoTransferDetection()goes throughownCategories(), which readsState.ruleCategoriesright after the categories you set, so a transfer that stops being one gets Re-categorize all's saved category (v1.16.24: Fix a transaction that stops being a transfer getting Other or Income #47's note).Chain edit to
test-untransfer-category.js(check E): the first run gave 26/27. With v1.16.25: Fix "Re-categorize all" changes being lost after a reload #48,recategorizeAll()is async and a detected transfer keeps Transfer out / in while the rule's category is saved for it. The check now awaits it and expects Transfer out plus the saved Health. Its second half ("liberty" removed: Health) is unchanged and passes. Rerun: 27/27.No phone checks (desktop only).
Measured before the chain
The numbers below are the PR author's, on the commit before it was chained (built on the old #38 tip
ecfcab2, v1.16.15, or on the fix below it there; version numbers renumbered to the chain's).Headless Chromium against
samples/, desktop viewport, one suite at a time. Before = d98069a; after = this commit (f7b83c8).run-tip.sh 15ran every suite from test-clarity to test-cleanup. Theraceerrors are the known Import Logs race (#18 isn't merged into this chain); none of them come from this change.New:
test-retype-transfer.js. It runs on this branch, then on a temporary worktree of d98069a (removed afterwards). Checks marked [bug] must fail there.N (no edits):
Each is the same as on d98069a after an import, a keyword change, a reload and a boot from finlens-state.json.
A, B, C:
Checked in memory, after a reload, and after a file boot from a file saved before and after the reload:
D: all four set back to Transfer. Every number returns to the base.
P: the autopay set to Expense. The card payment is its CSV Payment at once, still a card payment, not income. Same after a reload and both file boots.
K: Transfer out + Housing, then "zelle" removed. The row shows Housing; the other ZELLE rows count in Spending. "zelle" re-added gives Transfer out + Housing back.
G: an edit as master's drawer saved it, and a finlens-state.json record left with Transfer out. Both show the row's own category.
H: the category Transfer on an UBER TRIP charge. It counts in Spending under Transfer and stays off the Transfers screen.
X (branch only): with
State.ruleCategoriesset by hand, a retyped ZELLE row and a keyword-removed one get the saved category.Result: 135/135 on this branch. On d98069a 59/126 pass: all 67 [bug] checks fail (the bug) and no other check fails.
Suites I edited (my copies), because a check legitimately changes:
The unedited copies are kept next to them as
*.v1623.js.How to reproduce the bug
Run this on the base branch,
fix-recategorize-all-not-saved. Master has the bug too.fix-recategorize-all-not-savedinstead offix-retyped-transfer-still-counted. Write down Total spent (Spending pill) and the Transfers tile and Sent outside FinLens (Transfers pill).ZELLEand open the Sep 23 ZELLE TO M TORRES row (−$25.00).What goes wrong:
Manual QA steps
Setup
git checkout fix-retyped-transfer-still-counted.samples/into a new scratch folder (e.g.C:\temp\finlens-49). This PR changes saved edits, so never use your real folder.index.htmlin Edge. Settings (gear) → Import → Pick a folder, choose the scratch folder, allow read and write access.Rows used below (checking account): ZELLE TO M TORRES on Sep 23 (−$25.00, a one-sided transfer by the "zelle" keyword) and CREDIT CARD AUTOPAY on Oct 6 (−$836.91, paired with the card's Payment Thank You-Mobile of +$836.91).
1. A ZELLE transfer set to Expense counts as spending at once
ZELLEin Search description or notes.Expected:
Before this fix: the row kept Transfer out, stayed on the Transfers screen, and was missing from By category (and after a reload from Spending's total too).
2. Retyping one leg of a pair updates the other leg right away
CREDIT CARD AUTOPAY. Open the Oct 6 row (−$836.91).Payment Thank You.Expected:
Before this fix: the card payment stayed a transfer (Transfer in) until the next import, keyword change or reload.
3. Survives a reload, and a boot from finlens-state.json
index.html, Settings → Import → Pick a folder, choose the same scratch folder.Expected:
finlens_db→app_state→txOverrides: the two edits holdtype: "debit"and no"Transfer out".4. Bulk Set type does the same
ZELLE.Expected:
5. Setting a row back to Transfer
Payment Thank Youand check the Oct 6 card row.Expected:
6. Edge case: a transfer with an extra category, retyped
Expected:
7. Regression: no edits, same numbers as the base
Expected:
8. Regression: removing a transfer keyword still works
ZELLEon Transactions.zelleback with Add keyword → Add.Expected:
Please check before merging
mkTx()andreconstituteTx(): keep 1710fdd's category order, then this commit's direction check. InreconstituteTx(), pass itsruleCatson:ownCategories(tx, ov, undefined, ruleCats).undoTransferDetection(): this commit's version. 1710fdd doesn't touch it, andownCategories()already takesState.ruleCategoriesafter your own categories, which matches 1710fdd's order.https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Generated by Claude Code