Repository navigation
Conversation
…ge its category (v1.16.9) Saving the transaction drawer (showTxDrawer() in views-main.js) wrote all three flag checkboxes (Bill, Recurring, Subscription) into txOverrides, whatever the user had touched. An edit there wins over the transaction rules (txFlags()), so a row saved only for its category kept the flags it had then: a removed rule didn't unflag it and a new rule didn't reach it. The bug is also on master. The drawer now remembers what its boxes showed when it opened, and Save stores a flag only if its box was changed from that, ticked or unticked. An untouched box stores nothing, so it keeps following the rules or keeps an edit already stored. The row's flags are then set from txFlags(), as a reload does. Bulk Mark as bill / subscription already stored only their own flag and are unchanged. Flags stored by earlier versions are not removed: they can't be told apart from flags set on purpose. Clear transaction edits removes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
This was referenced Nov 2, 2026
…drawer-flag-overrides Carries master's v1.10.3-v1.10.5 up the stack: declined answers (#14), literal single "~" (#15) and the Import Logs race fix (#18), with clarity-insights' port of #14 to the rebuilt AI tab. One conflict: CLAUDE.md's "Last updated" line. Kept this branch's line and added the v1.10.3-v1.10.5 history. The CHANGELOG merged cleanly. Versions stay 1.16.9. renderImportLog() keeps #18's guards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
31 tasks
… into fix-drawer-flag-overrides 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
Saving the transaction drawer stored all three flags (Bill, Recurring, Subscription) as the checkboxes showed them, even when you only changed the category. That transaction then ignored later rule changes. Now the drawer stores a flag only when you change its box. A flag you leave alone keeps following the transaction rules, or keeps the edit already stored for it.
Cause
showTxDrawer()(js/views-main.js) seto.isBill,o.isRecurringando.isSubscriptionfrom the three checkboxes on every save.txOverrideswins over the rules (txFlags()incore.js, from v1.16.8). So a row saved for its category kept the flags it had at that moment.origin/master(js/views-main.js, lines 596–598) writes all three flags the same way. There,applyTxRulesToAll()also skips any flag key present in the override.txOverrides. Deleting a category, the transfer drawer andmigrate.jsdon't touch flags.What changed
showTxDrawer()(js/views-main.js):shown). The checkboxes render from that object.shown, ticked or unticked. An untouched box adds nothing and leaves any stored edit as it is.txFlags(), the same function a reload uses. Memory and the next reload agree.txOverridesin localStorage, IndexedDB andfinlens-state.json, the storage handling other PRs are changing.CHANGELOG.md,index.htmlfooter,README.md(badge and footer),js/views-settings.js, CLAUDE.md §1 and "Last updated".Not verified
exportAllData()/importJsonFile(),DataCleanup.clearEdits(),loadFiles()). This change doesn't touch them; their suites pass on this branch's commit (above), which is as far as that was checked. The one conflict, inshowTxDrawer(), is with v1.16.7: Fix transaction links to budgets, buckets and debts pointing at the wrong item after a delete #30's plan links: the chained commit keeps v1.16.7: Fix transaction links to budgets, buckets and debts pointing at the wrong item after a delete #30's link code (items by id,planItem()) and adds this PR'sflagBoxes/shownlines after it.Automated checks: earlier run, not re-run · 09d2125
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".
Headless Chromium (Playwright) at 1280×900 against
samples/(257 transactions), with the pinned CDN libraries served from npm, on this branch's final commit09d2125, chained on #31. Each script ran asNODE_PATH=$(npm root -g) node <script> <repo> <outdir>, from one harness shared by every branch in the stack: the base suites, plus every test added by this PR or by a PR below it (cumulative regression).09d2125test-clarity.jstest-insights.jstest-finances.jstest-plan.jsboot.jsrace.jsrenderImportLog(the race #18 fixes on master; not in this stack)test-clear-edits.js(from #24)test-rebuild-folder.js(from #25)test-partial-import.js(from #26)test-json-import.js(from #27)test-new-browser-copy.js(from #28)test-json-export.js(from #29)test-plan-links.js(from #30)test-rule-flags.js(updated in this PR)test-drawer-flags.js(new in this PR)test-insights.js's "General: version line" check reads the version from theindex.htmlfooter, andtest-plan.js's "Budget: Save adds it" accepts a new budget with or without anid, requiring thebud_+ 10 base-36 format once it has one (v1.16.7: Fix transaction links to budgets, buckets and debts pointing at the wrong item after a delete #30 adds ids). Nothing else in the base suites changed.Measured before the chain
By the agent that wrote the fix, on
0af0ff6(built on650ec68, the rule-flags fix before the chain, then v1.16.6). Its "Before" column is650ec68.Headless Chromium (Playwright) against
samples/, desktop viewport 1280×900. The scripts live in the test harness, not the repo.test-clarity.jstest-finances.jstest-plan.jstest-insights.jstest-rule-flags.js(one check updated, see below)test-drawer-flags.js(new)boot.jsrace.jsrenderImportLogrenderImportLograce.js: every error is therenderImportLog/innerHTMLnull that PR v1.10.5: fix Import Logs throwing when the view is left before it loads #18 fixes. None comes from this change. The count varies per run.test-rule-flags.js: the check that documented the old behaviour ("Unchanged: a row saved in the drawer (category only) stores its flags…") now checks the new one: no flag keys are stored, and the row stops being a bill when the rule goes. The name of the following Clear transaction edits check was reworded; its logic is unchanged. The header comment was updated.test-drawer-flags.js(new):finlens-state.jsonin a new browser: the edited rows come back the same, and the category-only row follows the file's rules.How to reproduce the bug
Run this on the base branch,
fix-rule-flags-lost-on-reload.masterhas the same bug.fix-rule-flags-lost-on-reloadinstead offix-drawer-flag-overrides. Use the scratch folder with the three sample CSVs, never your real folder. Setup ends with theLIBERTY INTERNET→ Bill rule at 6 matches.LIBERTY. All 6 rows show Bill.file://entry →finlens_txOverrides, and find that row's entry.LIBERTY INTERNETrow.LIBERTYagain.What goes wrong:
isBill,isRecurringandisSubscriptionkeys, though only the category changed.LIBERTY INTERNET→ Subscription rule added afterwards reaches only 5 rows, not 6.Manual QA steps
Setup
samples/into a new scratch folder (for exampleFinLens-test-32). Do not use your real folder.git checkout fix-drawer-flag-overrides, then openindex.htmlin Edge.RESETand click Erase and start over.LIBERTY INTERNETin When description contains, leave Flag as on Bill, and click Add rule. The row should say 6 matches.To see what a save stored: F12 → Application → Local storage → the
file://entry →finlens_txOverrides. Find the transaction's entry and look forisBill,isRecurring,isSubscriptionkeys.1. Category-only save no longer pins the flags (the main fix)
LIBERTYin Search description or notes. All 6 rows show Bill.finlens_txOverrides.LIBERTY INTERNETrow.LIBERTYagain.Expected:
categoriesbut noisBill,isRecurringorisSubscriptionkey.Before this fix: the saved row kept its Bill chip after the rule was removed (5 rows unflagged, 1 still a bill).
2. A rule added later reaches the saved row
LIBERTY INTERNET→ Subscription.LIBERTY.Expected:
Before this fix: only 5 rows got Sub.
3. Unticking a rule flag is stored as a manual "off"
LIBERTY INTERNET→ Bill again.finlens_txOverridesentry.LIBERTY.LIBERTY INTERNET→ Bill again. SearchLIBERTY.Expected:
"isBill":falseand noisRecurring/isSubscriptionkey.4. Ticking a flag stores only that flag
NETFLIX. Open one NETFLIX.COM row.finlens_txOverridesentry.NETFLIX→ Subscription. SearchNETFLIX.NETFLIXrule.Expected:
"isRecurring":trueand noisBill/isSubscriptionkey.5. Ticking and unticking the same box stores nothing
finlens_txOverridesentry.Expected:
6. An existing stored flag is kept on a later category-only save
isRecurring:true).Expected:
"isRecurring":trueis still there. Recurring still shows in the Flags column.7. Bulk Mark as bill / Mark as subscription (should not change)
T-MOBILE. Tick the checkboxes on two rows.finlens_txOverridesentries.T-MOBILE→ Recurring.Expected:
"isBill":trueonly.8. Survives closing the browser (boot from finlens-state.json)
index.htmlagain in a new tab.LIBERTY, thenNETFLIX, thenT-MOBILE.Expected:
Please check before merging
type, soreapplyTransferKeywords()skips that row when a transfer keyword is removed. That is a separate bug for its own PR.https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Generated by Claude Code