Skip to content

v1.12.0: Remove bank names from the app; neutral account codes with a data migration - #16

Open
gitluis wants to merge 2 commits into
masterfrom
bank-neutral-names
Open

gitluis wants to merge 2 commits into
masterfrom
bank-neutral-names

Conversation

@gitluis

@gitluis gitluis commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Version: v1.12.0, numbered after the open PRs (#14 v1.10.3, #15 v1.10.4, #10 v1.11.0). If this merges in a different order, it gets renumbered.

Summary

FinLens no longer names a bank anywhere in the app. Labels, hints, default account names, sample data and current docs say "bank" or "credit card" instead. The internal codes are renamed too, and a one-time migration rewrites your saved data so nothing is lost:

What Before Now
Kinds / schema ids bank-named bank_checking, bank_savings, credit_card
Account ids bank-named bank_checking, bank_savings, card_<file>
Default names bank-named Bank Checking, Bank Savings, Bank Credit Card (file name)

Per your choice, history is unchanged: earlier CHANGELOG entries, the published eval results (docs/EVAL.md, docs/eval-runs/), docs/archive/, and the changelog text embedded in views-db.js. Git history still has the old names too.

What changed

On screen

  • The Overview footnotes, empty state, Accounts and Credit Cards tabs, Import account-type choices, Investing Ideas and Budget footnotes now use generic terms.
  • Placeholder text: "e.g. Work 401(k)".

Codes — every kind check in the views, ui.js colors, the AI summary's cash and debt totals, CSV detection and the eval's dataset build use the new codes.

  • Detection: a card file is still detected by card or credit in its file name. Otherwise its Transaction Date + Post Date headers identify it, so files named after the bank still import as cards.

js/migrate.js (new, IdMigration) — rewrites data saved by older versions:

  • Accounts: ids, kinds, old default names. Names you typed are kept.
  • Keyed data: balances, limits, starting balances, labels, account order and file assignments.
  • Transaction ids and your edits. The id hashes the account id, so it changes with it. Stored rows don't keep the bank time or post date, so the id can't simply be recomputed. Instead _rekey() uses the fact that hash() is linear to swap the account part of the existing id. The results are exactly the ids a fresh import gives, so re-importing your CSVs still adds nothing.
  • Where it runs:
    • At boot: State, every IndexedDB store (in one transaction) and localStorage.
    • When finlens-state.json is loaded: the loaded copy is rewritten, then the file is saved back.
    • On JSON import: the export is rewritten before it's applied.
  • Edits that can't be moved at boot (for example, kept while transactions were cleared) move on the next CSV import.
  • Idempotent: once nothing old is left, later boots change nothing. The transactions store is only read while an old account id exists.
  • The old codes appear only in this file. It needs them to read older data, backups and exports.

AI Eval

  • Samples: renamed to checking_sample.csv, savings_sample.csv and credit_card_sample.csv. The checking sample's autopay line is now CREDIT CARD AUTOPAY.
  • Published results still load: results files are now matched by hash, and the checking sample's earlier hash is kept. Re-scoring the v1.10.0, v1.10.1 and v1.10.2 runs gives identical numbers.
  • Matcher: the bank-name synonym entry is removed. It changed no figure in any published run.
  • The next run's summary will say Bank Checking / Bank Savings / Bank Credit Card.

Docs

  • README: supported files are described by their columns.
  • CLAUDE.md: §3, §4, §5, §10 (plus a rule against naming banks), §18 and §21 updated; §22 Migrations added.
  • samples/README updated; CHANGELOG has a new entry.

Not verified

  • Your real data, and a real folder through the File System Access API (the folder was simulated).
  • Safari and Firefox.
  • A new eval run: it needs your API key.
Automated checks: earlier run, not re-run · commit not recorded

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 Chrome against samples/, with this branch and master served on the same origin, so the branch opened data that master had saved. Results: 45/45 checks passed.

Migration from master's data (IndexedDB boot), 23 checks

  • Master imported the samples and made 10 edits (including on a _2 duplicate row), plus balances, limits, starting balances, a custom label, a label equal to the old default, reordered accounts and file assignments.
  • On the branch, every transaction id equals what a fresh import gives, in memory and in IndexedDB. All 10 edits sit on the right transactions.
  • Accounts are renamed: the custom label is kept, and the default-name label is renamed. Balances, order and assignments are re-keyed. The import log is updated.
  • Balances are unchanged, and the AI summary is identical apart from account names.
  • No old code is left in IndexedDB or localStorage.
  • Re-importing the same CSVs inserted 0 rows and removed 0, and every edit is kept. A second boot changes nothing.
  • Importing a JSON export from master re-keys its edits and balances.
  • All 17 views render with no page errors.

Migration from an old finlens-state.json (file boot, empty browser, simulated folder), 6 checks

  • The file gives the same ids and edits as the IndexedDB path.
  • After the debounced save, the rewritten file has no old codes.

Fresh import of the new samples, 4 checks

  • The new samples are detected as the right kinds. The summary and per-account totals match master's apart from names.

AI Eval, 12 checks

  • The new samples pass the hash check, and the eval's sandbox summary equals a normal import.
  • The published docs/eval-results.json still loads.
  • Re-scoring and the chance-match check are identical to master for all three published runs.

Id math, run separately

  • 20,000 random transactions with time, post-date and no-extra-column keys, _2 suffixes and Unicode descriptions all re-keyed exactly, with no ambiguous ids, and back again.
  • Migrating 20,000 transactions takes about 1.7 s once.

Not tested

  • Your real data, and a real folder through the File System Access API (the folder was simulated).
  • Safari and Firefox.
  • A new eval run: it needs your API key.
Manual QA steps

Setup

This PR rewrites saved data in place, so never test it on your real data or in your normal Edge profile. Pages opened from disk share one browser storage, so your real FinLens data in that profile would be migrated too.

  1. In Edge, click your profile picture (top left) → Other profiles → Add profile → Continue, and name it FinLens test. Do all tests in that window.
  2. Run git checkout master.
  3. Make a scratch folder, e.g. Desktop\finlens-old, and copy master's three samples into it: ally_checking_sample.csv, ally_savings_sample.csv, chase_card_sample.csv.
  4. Make a second scratch folder, Desktop\finlens-new. Leave it empty for now.

1. Create old data on master (starting state for tests 2–5)

  1. Open index.html from disk in the FinLens test window.
  2. Click ⚙️ Settings → 📥 Import → 📁 Pick a Folder, choose finlens-old, and allow edit access.
  3. In the top bar, set the range to All Time.
  4. Click 💳 Transactions. Type NETFLIX in the search box, click the Oct 4 row, type edit A in Notes, and click Save Changes.
  5. Clear the search, type PARKING. Two identical Aug 14 rows ($2.00) appear. Click the second one, type edit B (duplicate) in Notes, and click Save Changes.
  6. Clear the search, type RENT. Click the Oct 1 row, change Description to Rent Palm Court, and click Save Changes.
  7. Click 🏠 Overview. Double-click the Ally Checking card title, type My Checking, and press Enter. Leave the other two names as they are.
  8. Click ⚙️ Settings → 🏦 Accounts. Under Account Balances, enter 1000 as Current Balance for checking, 500 for the Chase card and 5000 as its Credit Limit. Click 💾 Save, then OK.
  9. Click 📥 Import. Under Loaded Files, click ▲ on the Chase card row until it is first.
  10. On the 📦 Auto-Backup to Disk card, click 💾 Save Now.
  11. Click 🏠 Overview and write down: Total Cash, Total Debt, Net Worth, and each account card's name and amount.
  12. Copy finlens-old\finlens-state.json to Desktop\finlens-state-master.json. You need it in test 6.

Expected:

  • The footer says v1.10.5. Overview shows the account cards in the order Chase, My Checking, Ally Savings.
  • The Chase card footnote says Limit $5,000.

2. The migration runs once on upgrade

  1. Leave the tab open. Run git checkout bank-neutral-names.
  2. Press F12 and open the Console tab.
  3. Press F5 in the page.
  4. Read the Console.
  5. Press F5 again and read the Console.

Expected:

  • After step 3: a line [FinLens] Renamed old account codes; N transaction ids updated, with N about the number of transactions you loaded (257 with the samples; any N above 0 means it ran).
  • The line does not end with "… kept their old id (couldn't be traced)".
  • After step 5 (second boot): no "Renamed old account codes" line.
  • No red errors.
  • The footer says v1.12.0.

3. Names, balances, order and edits survived

  1. Set the range to All Time if needed. Click 🏠 Overview.
  2. Compare with your notes from test 1.
  3. Click 💳 Transactions and search NETFLIX, then PARKING, then Rent Palm. Click each edited row.
  4. Click ⚙️ Settings → 🏦 Accounts, then 💳 Credit Cards.

Expected:

  • Total Cash, Total Debt, Net Worth and every card amount match your notes.
  • Card names: My Checking (kept), Bank Savings (was Ally Savings), Bank Credit Card (chase_card_sample) (was Chase (chase_card_sample)).
  • Order is still card, My Checking, Bank Savings.
  • Footnotes read Bank Checking + Savings and Credit card balances.
  • The card still shows Limit $5,000. Accounts shows checking balance $1,000.00.
  • Oct 4 Netflix has note edit A. Only the parking row you edited has edit B (duplicate); its twin has no note.
  • The rent row shows Rent Palm Court.
  • Bank Accounts lists My Checking and Bank Savings; Credit Cards lists the card.

4. Nothing old is left in storage or in the state file

  1. In DevTools open Application → IndexedDB → finlens_db → accounts.
  2. Click transactions and look at the account column of a few rows.
  3. Open Application → Local Storage → file:// and click finlens_manualBalances, then finlens_accountOrder.
  4. Wait 10 seconds. Open finlens-old\finlens-state.json in Notepad.
  5. Press Ctrl+F and search, one at a time, for "ally_checking", "ally_savings", chase_chase and "chase" (with the quotes where shown).

Expected:

  • Accounts keys are bank_checking, bank_savings, card_chase_card_sample.
  • Transactions use only those three account ids.
  • manualBalances has bank_checking, card_chase_card_sample and card_chase_card_sample_limit. accountOrder starts with card_chase_card_sample.
  • All four searches in the state file find nothing. (File names like ally_checking_sample.csv and the description CHASE CREDIT CRD AUTOPAY are expected and fine.)

5. Re-importing the same CSVs adds nothing

  1. Click ⚙️ Settings → 📥 Import.
  2. On the Data Source card, click ↻ Reload.
  3. Read the import results card.
  4. Click 📄 Add individual CSV files and select the three files in finlens-old.
  5. Look at the dropdown next to each file in Assign Files to Accounts, then click ✕ Cancel.
  6. Recheck the three edited transactions from test 3.

Expected:

  • Each file shows 0 new transactions imported and only duplicates skipped. No "leftover duplicate copies removed".
  • The Data Source card still says ✓ 257 transactions loaded.
  • The dropdowns are preselected Bank Checking, Bank Savings, Bank Credit Card (old file assignments were migrated).
  • All three edits are still there.

Before this fix: n/a on master. On this branch without the migration, Reload would add 257 new rows and edits would be lost.

6. An old JSON backup is migrated when loaded (folder restore path)

This checks that a pre-v1.12.0 finlens-state.json is rewritten when it is the only copy.

  1. Open ⚙️ Settings → 🧹 Data & Reset. Under Start over, leave "Keep a copy" selected, type RESET, and click Start over. Click OK on the message; the page reloads empty.
  2. Make a folder Desktop\finlens-restore. Copy the three finlens-old CSVs into it, plus Desktop\finlens-state-master.json renamed to finlens-state.json.
  3. Open the Console tab. Click ⚙️ Settings → 📥 Import → 📁 Pick a Folder, choose finlens-restore, and allow edit access.
  4. Repeat the checks in test 3.
  5. Wait 10 seconds, then repeat the Notepad searches from test 4 on finlens-restore\finlens-state.json.

Expected:

  • The Console shows Browser had no data; restored 257 transactions from finlens-state.json.
  • Names, balances, order and all three edits match test 3.
  • The rewritten state file has no old codes.

7. Fresh import of the new samples, and generic labels

  1. Open ⚙️ Settings → 🧹 Data & Reset, type RESET, click Start over, and click OK.
  2. Click 🏠 Overview and read the empty-state text.
  3. Copy the branch's samples/checking_sample.csv, savings_sample.csv and credit_card_sample.csv into finlens-new.
  4. ⚙️ Settings → 📥 Import → 📁 Pick a Folder → finlens-new. Set the range to All Time.
  5. Click 🏠 Overview, 🪣 Buckets and 📈 Investments.
  6. Click 📥 Import and scroll to Add Manual Account. Open the Account Type dropdown.
  7. Click 💳 Transactions, search AUTOPAY.

Expected:

  • Empty state: "Load the CSV exports from your bank to see your dashboard come alive." and "bank checking, bank savings, bank credit card".
  • 257 transactions load. Cards: Bank Checking, Bank Savings, Bank Credit Card (credit_card_sample).
  • Buckets footnote: Bank Savings balance. Investments table row: Bank Savings / HYSA.
  • Account Name placeholder: e.g. Work 401(k). Types: Bank Checking, Bank Savings, Bank Credit Card, Investment, Other.
  • The checking autopay rows read CREDIT CARD AUTOPAY.
  • No "Ally" or "Chase" anywhere on screen (the SCHD fund name on Investments is left as is).

8. A card file without "card" in its name is still a card

  1. In finlens-new, copy credit_card_sample.csv and name the copy statement_2026.csv.
  2. Click ⚙️ Settings → 📥 Import → ↻ Reload.
  3. Click 💳 Credit Cards.

Expected:

  • A new card account Bank Credit Card (statement_2026) is listed, with 165 transactions.
  • It is not listed under 🏦 Accounts → Bank Accounts.

9. (Optional) AI Eval still accepts samples and published results

  1. In the Console, type showView('ai-eval') and press Enter.
  2. Under "Pick checking_sample.csv, savings_sample.csv, credit_card_sample.csv from samples/", choose the three files in the repo's samples/.
  3. Click 📂 Load results JSON and choose docs/eval-results.json.

Expected:

  • Sample data reads 257 transactions · May 1 – Oct 20, 2026, with no hash error.
  • Expanding Financial summary sent to the model shows Bank Checking / Bank Savings / Bank Credit Card.
  • After step 3: "Loaded results from eval-results.json", not "was not produced from the committed samples/".

When done, remove the FinLens test profile (profile picture → Manage profile settings → … → Remove).

Please check before merging

  • Back up first. Before opening this version on your real data, copy finlens-state.json somewhere safe. The migration is one-way: v1.10.x can't read the new codes, so going back means restoring that copy.
  • Open it on your data and check the console for Renamed old account codes; N transaction ids updated. It should not say any "kept their old id".
  • Check balances and edits. Overview balances should match before/after, and a few edited transactions should still show your changes.
  • Re-import your CSVs once (Settings → Import → Reload). It should report 0 new transactions.
  • Card names still show the file name, e.g. "Bank Credit Card (your file name)". If that name contains the bank, double-click the card title to relabel it. Don't rename the CSV file: a new file name creates a new account (and duplicates) on the next import.
  • Left as is: the SCHD fund's official name ("Schwab US Dividend Equity") in Investing Ideas. Say if you want it changed too.
  • Manual QA passed in Edge/Chrome with a real folder

Generated by Claude Code


Generated by Claude Code

…ration (v1.12.0)

- UI text, default account names, samples and current docs say "bank" / "credit card"
- Kinds and schema ids: bank_checking, bank_savings, credit_card; card accounts: card_<file>
- js/migrate.js rewrites data saved by older versions (State, IndexedDB, localStorage,
  finlens-state.json, JSON exports), including transaction ids, so edits and re-import
  dedup carry over
- AI Eval: renamed samples; published results still load and re-score unchanged
- History (earlier CHANGELOG entries, published eval results, docs/archive) unchanged
This was referenced Nov 2, 2026
gitluis pushed a commit that referenced this pull request Nov 2, 2026
…ty redesign (#16-#21)

Brings the Clarity redesign (#16 -> #17 -> #19 -> #20 -> #21, v1.12.0 to
v1.16.0) into #10 so the Settings -> Database tab can be rebuilt on it.

Conflicts in CHANGELOG.md, CLAUDE.md, README.md, index.html and
js/views-settings.js were resolved by taking the redesign's version of
each file. #10's changes to them (the 1.11.0 entry and version strings,
the Database tab in SETTINGS_TABS, the unregistered-tab guard, README
tips, CLAUDE.md notes) are rebuilt on the new design in the next commit.

js/views-db.js merged cleanly: the redesign's file plus #10's db-tools
view and DB Inspector re-read fix. Both are restyled next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Picks up the Import Logs race fix (#18, v1.10.5) and, with it, the two
earlier master merges this branch didn't have yet: declined answers
(#14, v1.10.3) and literal single "~" (#15, v1.10.4).

Conflicts were the version strings and the CHANGELOG only:
- CHANGELOG: every entry kept, 1.12.0 above 1.10.5, 1.10.4, 1.10.3.
- Version strings stay 1.12.0 (index.html, README, views-settings.js,
  CLAUDE.md §1). CLAUDE.md's "Last updated" line keeps 1.12.0 and adds
  the v1.10.3-v1.10.5 history.
- renderImportLog() keeps #18's guards (merged cleanly).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft

gitluis commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Merged master into this branch (9994657) to pick up #18 (v1.10.5). That fixes the conflict, which was only the version strings and the CHANGELOG. The versions stay 1.12.0, and the CHANGELOG keeps every entry, in order: 1.12.0, 1.10.5, 1.10.4, 1.10.3 and so on. #18's guard in renderImportLog() came in cleanly.

master also had #14 (v1.10.3, declined answers) and #15 (v1.10.4, a single ~ stays literal), which this stack didn't have yet, so they came in with it. They merged cleanly here. In #21, the AI tab had been rebuilt, so #14's refusal message was ported to the new tab state (aiPhase 'declined'). The #21 merge commit has the details.

The merge was carried up through the whole stack, one merge commit per branch: #17 → #19 → #20 → #21 → #24 … #38 → #10. Nothing was rebased or force-pushed. The headless tests pass on every tip. The one exception is on #17–#20, where two checks in the current test-clarity look for v1.16.0's Welcome and Settings tab names. They failed the same way before this merge, and the v1.15.0 variant of that suite passes. The view-switching stress test now shows 0 errors on every tip.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft


Generated by Claude Code

gitluis pushed a commit that referenced this pull request Nov 2, 2026
…e-status-indicator

Brings the Clarity redesign and fix stack (#16-#21, #24-#38, #10) into #23,
so its backup status can be rebuilt on the app bar.

All seven files #23 touched conflicted (CHANGELOG.md, CLAUDE.md, README.md,
index.html, js/core.js, js/views-data.js, js/views-settings.js). Each was
resolved by taking the redesign's version: the sidebar #23 built on is gone.
The tree now equals settings-database-tab at 477f357. The next commit
rebuilds #23's changes on the app bar's sync badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
@gitluis gitluis added the enhancement New feature or request label Nov 3, 2026 — with Claude
@gitluis gitluis added this to the Clarity stack (v1.12.0 → v1.18.1) milestone Nov 3, 2026 — with Claude
@gitluis gitluis changed the title v1.12.0: remove bank names from the app; neutral account codes with a data migration v1.12.0: Remove bank names from the app; neutral account codes with a data migration Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants