From ecfcab2e2f6d1bd8fc8827c746edb6542c89c2cc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 11:52:50 +0000 Subject: [PATCH] Cleanup: remove views-database.js, read the changelog from CHANGELOG.md, fix stale wording (v1.16.15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete js/views-database.js: an old "Database" section that index.html never loaded and nothing referenced. - The developer Changelog view showed a copy embedded in views-db.js that stopped at v1.4.1. It now fetches CHANGELOG.md when it opens (loadChangelog()); from file://, or when the request fails, it shows a note pointing to CHANGELOG.md. The file's own H1 is left out so the shell's title stays the page's only H1. - Overview: "No credit limit set · Add one" opens Settings → Credit cards, where the limit is now set (it opened Settings → Accounts). - README and CLAUDE.md §3, §4.3, §6, §18, §19 no longer point to the Data tab, Settings for transfer keywords, or a Theme tab. - CLAUDE.md §1 records Luis's desktop-only decision (2026-11-02). Version bumped in CHANGELOG, index.html, README, views-settings.js and CLAUDE.md §1. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft --- CHANGELOG.md | 27 ++++ CLAUDE.md | 15 +- README.md | 10 +- index.html | 2 +- js/views-database.js | 66 --------- js/views-db.js | 323 ++++++++----------------------------------- js/views-main.js | 2 +- js/views-settings.js | 2 +- 8 files changed, 103 insertions(+), 344 deletions(-) delete mode 100644 js/views-database.js diff --git a/CHANGELOG.md b/CHANGELOG.md index c6aa5d1..5d8b9b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,33 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). --- +## [1.16.15] — 2026-11-02 + +Housekeeping: dead code, the in-app changelog, and wording that pointed to screens that no longer exist. + +### Changelog view (developer) +- **It shows the real changelog now.** The Changelog view (`showView('changelog')`, in `views-db.js`) showed a copy of the changelog embedded in the code, which stopped at v1.4.1: nobody updated it after that. It now reads `CHANGELOG.md` each time it opens (`loadChangelog()`), so it can't fall behind. CRLF line endings are still handled. The file's own "FinLens Changelog" heading is left out, so the shell's title stays the page's one H1. +- **When the file can't be read,** the view says the version history is in `CHANGELOG.md`, next to `index.html`. That's always the case when FinLens is opened as a file (`file://`): browsers don't let such a page read other files, so the view doesn't try. It also happens if the request fails or returns an error. +- **Why not keep a copy as a fallback:** it's what drifted. Keeping one in step would need a build step or a manual update on every release. + +### Removed +- **`js/views-database.js`.** It registered an old "Database" section (a `database` view with sub-tabs). `index.html` never loaded it, and nothing referenced it. + +### Fixed +- **"No credit limit set · Add one"** on an Overview credit card opened Settings → Accounts, which has had no credit limit field since v1.16.0. It opens Settings → Credit cards now. + +### Docs +- **Desktop only** (Luis, 2026-11-02), in CLAUDE.md §1: FinLens targets desktop browsers; no work goes into phone layouts. A separate mobile app is planned. The existing responsive CSS stays. +- **Wording that pointed to screens that no longer exist:** + - README: the "Data tab" for an Other CSV's starting balance (now Settings → Accounts); picking the folder "in the Data tab" (now the Welcome or Settings → Import); "Save Now" (the button is **Save now**, in Settings → Import). + - CLAUDE.md: + - §3: no `views-database.js`; + - §6: the theme control is in Settings → General; + - §18: a card's balance comes from Settings → Accounts or Credit cards, not the Data tab; + - §19: transfer keywords are edited on the Transfers screen, not in Settings. + +--- + ## [1.16.14] — 2026-11-02 ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md index 5bb6a3c..6292ee2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -59,10 +59,12 @@ Until then, this section is the rule. FinLens is a **single-origin, zero-build, vanilla JavaScript personal finance dashboard** that runs entirely in the browser. There is no server, no npm, no bundler, no framework, and no TypeScript. The entry point is `index.html`; everything else is a plain `.js` file in the `js/` folder. -**Current version:** v1.16.14 (updated in `index.html` footer, `README.md`, and `CHANGELOG.md` on every release). +**Current version:** v1.16.15 (updated in `index.html` footer, `README.md`, and `CHANGELOG.md` on every release). **What it does:** Imports CSV exports from a bank (checking + savings) and credit cards, parses and normalizes them into a unified transaction model, and renders a multi-tab financial dashboard with budgeting, debt tracking, savings forecasting, investment planning, and Claude-powered AI analysis. +**Desktop only** (Luis, 2026-11-02): FinLens targets desktop browsers; don't spend work on phone layouts. A separate mobile app is planned. The existing responsive CSS stays. + --- ## 2. Tech Stack @@ -122,9 +124,8 @@ FinLens/ ├── views-data.js ← Settings tabs Import, Accounts, Credit cards, Categories; folder + sync badge; sample data; Import Logs ├── views-settings.js ← Settings shell (tab bar) + General tab (display, Anthropic API key) ├── views-cleanup.js ← Settings → Data & reset: what's stored, clean up, JSON export/import, start over (§20) - ├── views-db.js ← DB Schema diagram, DB Inspector, Changelog views (developer only) + ├── views-db.js ← DB Schema diagram, DB Inspector, Changelog views (developer only; Changelog reads CHANGELOG.md) ├── views-eval.js ← AI Eval: grounding eval for AI Analysis (developer only, §21) - ├── views-database.js ← Unused — not loaded by index.html; retained for reference └── init.js ← App boot IIFE — event wiring, DB.open(), DB.loadAll(), first render ``` @@ -409,7 +410,7 @@ Dark mode is applied by setting `data-theme="dark"` on `` (`applyTheme()`, .tbl — styled table (thead uppercase, hover row highlight) .insight — tinted callout box; .insight.warn, .insight.bad .tabs — underlined tab bar (Settings); buttons carry role="tab" + aria-selected -.seg — segmented control (Settings → Theme); buttons carry role="radio" + aria-checked +.seg — segmented control (Settings → General → Theme); buttons carry role="radio" + aria-checked .input .select .textarea — form fields .progress — progress bar; .progress.warn, .progress.bad .chart-wrap — Chart.js container (must have explicit height!) @@ -1028,7 +1029,7 @@ Also update **Current version** in §1 of this file. Never close out a change wi |---|---|---| | `bank_checking` | Bank Checking | Computed from transactions + manually entered starting balance (the export has no running balance) | | `bank_savings` | Bank Savings | Computed from transactions + manually entered starting balance (the export has no running balance) | -| `credit_card` | Bank Credit Card(s) | Manual override in Data tab | +| `credit_card` | Bank Credit Card(s) | The balance owed entered in Settings → Accounts or Settings → Credit cards; without one, the sum of the card's transactions | | `unknown` | Any other CSV | Computed from transactions + initial balance | **One balance rule** for `currentBalances()`, `periodEndBalance()` and `balanceAt()`, in every date range, All time included (v1.16.10): @@ -1045,7 +1046,7 @@ Multiple credit card files can be loaded simultaneously. Each gets a unique `acc --- -*Last updated: v1.16.14 — 2026-11-02 (§9 the drawer is a modal dialog: inert page, Tab wraps, first field focused, focus returns after a re-render; v1.16.13: account order: §4.1 `accountOrder` keeps ids not loaded; §8 `orderedAccounts()`; §18 display order; v1.16.12: account names: §4.1 `accountLabels`; §4.3 an account's `name` is its default; §8 `defaultAccountName()`; §9 `acctName()`; §13 the summary lists accounts by `acctName()`; §18 names you type, and clearing them; v1.16.11: AI summary balances at the end of the selected period: §13 `summaryBalanceEnd()` and the date notes; §21 the parser reads the balance lines by how they start; v1.16.10: starting balance counted in every range: §8 `startingBalance()`, `currentBalances()`; §13 summary balances; §18 one balance rule; v1.16.9: the transaction drawer stores only the flags you change: §4.2 flags, §12 state mutations; v1.16.8: flags from transaction rules are worked out on load, never read from storage: §4.2 flags, §8 `txRuleFlag()` / `txFlags()` / `applyTxRulesToAll()`, §19 flags in the transactions store; v1.16.7: transaction links to budgets, buckets and debts by id: §1 version; §3 migrate.js role; §4.1 the `id` fields, TxOverride and its `link` shape; §8 `PLAN_LINK_TYPES`, `newPlanId()`; §9 `planItem()`, `linkedTransactions()`, `unlinkPlanItems()`, `ensurePlanIds()`; §20 clearing budgets, buckets or debts removes their links; §22 the plan-link migration; v1.16.6: JSON export carries account names and order, Read as, flag rules, transfer keywords and theme: §9 `JSON_EXPORT_KEYS`; §12 adding a persisted field; §20 what the export holds; v1.16.5: a new database copies every saved setting: §4.5 the keys that go through `storageKey()`; §12 adding a persisted field; §19 `DB.APP_STATE_KEYS`; v1.16.4: JSON import saves under the storage keys: §4.5 `STORAGE_KEYS` / `storageKey()`; §8 `storageKey()`; §12 adding a persisted field uses the State name; v1.16.3: An import keeps the loaded transactions it doesn't replace: §4.5 an import never drops loaded transactions; §8 `mergeImported()`, `undoTransferDetection()`; §10 memory follows the same re-upload rules; §11 kept transfers are detected again; v1.16.2: Imports read every file before changing anything: §8 `loadFiles()` options and result, `parseCsvFile()` reads only, `importParsedCsv()`, `importProblemText()`, `reloadFromDirHandle()`; §20 Rebuild from your folder reads before it clears, read before clearing; v1.16.1: Clear transaction edits works from memory: §4.2 `_originalCategories`, `_originalType` and what a transaction keeps of its row; §4.5 IndexedDB may not hold the loaded transactions; §10 a stored row holds the CSV's values; §20 Clear transaction edits; v1.16.0: Trends, AI Analysis, Settings and the Welcome rebuilt: §3 file roles; §4.1 `cardDetails`, `sampleData`, AI history `model`; §6 tile tokens and Insights/Settings/Welcome components; §7 rule 7 covers Trends; §8 `loadFiles()` sample option; §9 `shellHero()`, `NO_RANGE_VIEWS`, ☰ → ×, JSON export/import buttons; §12 Settings tabs renamed, the Welcome, range label hidden on Trends and Settings; §13 quick analyses, tab state, history; §20 new fields, Use my own files, Export/Import JSON; §21 quick analyses send `AI_PROMPTS`; v1.15.0: Plan screens rebuilt: §3 file roles; §4.1 `debtPlan` and the Budget / Bucket / Debt / Scenario shapes; §6 `--teal-text` and Plan components; §7 rule 7 covers the Plan charts; §8 plan helpers (`payoffPlan()`, `growthByYear()` …); §9 plan form helpers, `simulatePayoff()` kept unused; §12 Plan titles, Forecast tabs, range label hidden on Plan screens; §13 debt balances in the summary; §20 Clear forecast scenarios / investment mix, Clear debts resets `debtPlan`; v1.14.0: Finances screens rebuilt: §4.1 Bill shape and `recurringConfirmed`; §6 new tokens and Finances components; §7 rule 7 inline SVG charts; §8 new aggregation helpers; §9 drawer, `TX_VIEWS`, SVG/heatmap/format helpers, bill helpers, removed renderers; §11 keywords re-run detection, `transferPairs()`, card payments; §12 page actions and Transactions pills; §20 Clear bills also clears spotted-charge choices; v1.13.0: Clarity redesign — §6 tokens and components; §9 theme, chart colors and app bar helpers; §12 app bar navigation replaces the sidebar and the emoji rule; §17 footer; §20 Data & Reset; v1.12.0: bank-neutral account codes, names, samples and docs; §22 `migrate.js` added; §3, §4, §5, §10, §18, §21 updated; v1.10.2: §13 summary states its dates; §21 per-month derivations; v1.10.1: §13 `AI_MAX_TOKENS`, thinking and cut-off answers; v1.10.0: §21 AI Eval added; §13 `callClaude()` raw mode; v1.9.6: §14 folder access lasts until the last tab closes, not one page load; v1.9.5: §7 chart guard; v1.9.4: views-db.js changelog reads CRLF checkouts; v1.9.3: §14 folder permission: re-request on click, Reconnect banner, browser copy wins; v1.9.2: §0 branch, PR and approval workflow added; v1.9.1: §4.5 rehydrate transactions loaded from JSON; v1.9.0: §20 Data & Reset added; v1.8.1: §10 re-upload dedup rewritten for the occurrence-suffix fix; v1.8.0: AI Analysis restored with API-key and output hardening; `renderMarkdown()` added; `samples/` added; §1–3, §13, §14, §17 corrected to match the code)* +*Last updated: v1.16.15 — 2026-11-02 (§1 desktop only; §3 `views-database.js` removed, the Changelog view reads CHANGELOG.md; §6, §18, §19 point to the current screens; v1.16.14: §9 the drawer is a modal dialog: inert page, Tab wraps, first field focused, focus returns after a re-render; v1.16.13: account order: §4.1 `accountOrder` keeps ids not loaded; §8 `orderedAccounts()`; §18 display order; v1.16.12: account names: §4.1 `accountLabels`; §4.3 an account's `name` is its default; §8 `defaultAccountName()`; §9 `acctName()`; §13 the summary lists accounts by `acctName()`; §18 names you type, and clearing them; v1.16.11: AI summary balances at the end of the selected period: §13 `summaryBalanceEnd()` and the date notes; §21 the parser reads the balance lines by how they start; v1.16.10: starting balance counted in every range: §8 `startingBalance()`, `currentBalances()`; §13 summary balances; §18 one balance rule; v1.16.9: the transaction drawer stores only the flags you change: §4.2 flags, §12 state mutations; v1.16.8: flags from transaction rules are worked out on load, never read from storage: §4.2 flags, §8 `txRuleFlag()` / `txFlags()` / `applyTxRulesToAll()`, §19 flags in the transactions store; v1.16.7: transaction links to budgets, buckets and debts by id: §1 version; §3 migrate.js role; §4.1 the `id` fields, TxOverride and its `link` shape; §8 `PLAN_LINK_TYPES`, `newPlanId()`; §9 `planItem()`, `linkedTransactions()`, `unlinkPlanItems()`, `ensurePlanIds()`; §20 clearing budgets, buckets or debts removes their links; §22 the plan-link migration; v1.16.6: JSON export carries account names and order, Read as, flag rules, transfer keywords and theme: §9 `JSON_EXPORT_KEYS`; §12 adding a persisted field; §20 what the export holds; v1.16.5: a new database copies every saved setting: §4.5 the keys that go through `storageKey()`; §12 adding a persisted field; §19 `DB.APP_STATE_KEYS`; v1.16.4: JSON import saves under the storage keys: §4.5 `STORAGE_KEYS` / `storageKey()`; §8 `storageKey()`; §12 adding a persisted field uses the State name; v1.16.3: An import keeps the loaded transactions it doesn't replace: §4.5 an import never drops loaded transactions; §8 `mergeImported()`, `undoTransferDetection()`; §10 memory follows the same re-upload rules; §11 kept transfers are detected again; v1.16.2: Imports read every file before changing anything: §8 `loadFiles()` options and result, `parseCsvFile()` reads only, `importParsedCsv()`, `importProblemText()`, `reloadFromDirHandle()`; §20 Rebuild from your folder reads before it clears, read before clearing; v1.16.1: Clear transaction edits works from memory: §4.2 `_originalCategories`, `_originalType` and what a transaction keeps of its row; §4.5 IndexedDB may not hold the loaded transactions; §10 a stored row holds the CSV's values; §20 Clear transaction edits; v1.16.0: Trends, AI Analysis, Settings and the Welcome rebuilt: §3 file roles; §4.1 `cardDetails`, `sampleData`, AI history `model`; §6 tile tokens and Insights/Settings/Welcome components; §7 rule 7 covers Trends; §8 `loadFiles()` sample option; §9 `shellHero()`, `NO_RANGE_VIEWS`, ☰ → ×, JSON export/import buttons; §12 Settings tabs renamed, the Welcome, range label hidden on Trends and Settings; §13 quick analyses, tab state, history; §20 new fields, Use my own files, Export/Import JSON; §21 quick analyses send `AI_PROMPTS`; v1.15.0: Plan screens rebuilt: §3 file roles; §4.1 `debtPlan` and the Budget / Bucket / Debt / Scenario shapes; §6 `--teal-text` and Plan components; §7 rule 7 covers the Plan charts; §8 plan helpers (`payoffPlan()`, `growthByYear()` …); §9 plan form helpers, `simulatePayoff()` kept unused; §12 Plan titles, Forecast tabs, range label hidden on Plan screens; §13 debt balances in the summary; §20 Clear forecast scenarios / investment mix, Clear debts resets `debtPlan`; v1.14.0: Finances screens rebuilt: §4.1 Bill shape and `recurringConfirmed`; §6 new tokens and Finances components; §7 rule 7 inline SVG charts; §8 new aggregation helpers; §9 drawer, `TX_VIEWS`, SVG/heatmap/format helpers, bill helpers, removed renderers; §11 keywords re-run detection, `transferPairs()`, card payments; §12 page actions and Transactions pills; §20 Clear bills also clears spotted-charge choices; v1.13.0: Clarity redesign — §6 tokens and components; §9 theme, chart colors and app bar helpers; §12 app bar navigation replaces the sidebar and the emoji rule; §17 footer; §20 Data & Reset; v1.12.0: bank-neutral account codes, names, samples and docs; §22 `migrate.js` added; §3, §4, §5, §10, §18, §21 updated; v1.10.2: §13 summary states its dates; §21 per-month derivations; v1.10.1: §13 `AI_MAX_TOKENS`, thinking and cut-off answers; v1.10.0: §21 AI Eval added; §13 `callClaude()` raw mode; v1.9.6: §14 folder access lasts until the last tab closes, not one page load; v1.9.5: §7 chart guard; v1.9.4: views-db.js changelog reads CRLF checkouts; v1.9.3: §14 folder permission: re-request on click, Reconnect banner, browser copy wins; v1.9.2: §0 branch, PR and approval workflow added; v1.9.1: §4.5 rehydrate transactions loaded from JSON; v1.9.0: §20 Data & Reset added; v1.8.1: §10 re-upload dedup rewritten for the occurrence-suffix fix; v1.8.0: AI Analysis restored with API-key and output hardening; `renderMarkdown()` added; `samples/` added; §1–3, §13, §14, §17 corrected to match the code)* --- @@ -1060,7 +1061,7 @@ The full IndexedDB implementation is live. See **`docs/archive/INDEXEDDB_PLAN.md - **`lsSet(k, v)`** — now also calls `DB.setState(k, v)` fire-and-forget when DB is ready. All existing `lsSet` call sites work unchanged. - **`State.transactions`** remains the in-memory working array. All views use `filteredTx()` unchanged. - **Bank Schema Registry** — `BANK_SCHEMAS` (global in `core.js`) drives CSV parsing. `detectSchema()` + `normalizeRow()` replace the old hardcoded normalizers. -- **Transfer Keywords** — `State.transferKeywords` is user-editable from Settings. `detectTransfers()` builds its regex from this list. +- **Transfer Keywords** — `State.transferKeywords` is edited on the Transfers screen (§11). `detectTransfers()` builds its regex from this list. - **Flags in the `transactions` store (v1.16.8)** — `DB.importTransactions()` still writes `isRecurring`, `isBill` and `isSubscription` into each new row, as they are at import, but FinLens never reads them back (only the developer DB Inspector shows them). Rows already stored are skipped on re-import, so they are never updated. `reconstituteTx()` works the flags out from `txOverrides` and the current rules (§4.2). ### Adding a new bank diff --git a/README.md b/README.md index 1ebbb0d..60c1ca6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > A zero-install, browser-native finance dashboard. Drop in your bank CSVs, get instant clarity on your money. -**Version:** v1.16.14  ·  **Stack:** Vanilla JS, HTML, CSS  ·  **Install:** None +**Version:** v1.16.15  ·  **Stack:** Vanilla JS, HTML, CSS  ·  **Install:** None --- @@ -64,7 +64,7 @@ Use the top bar to move between views: Overview, Transactions, **Plan** (a menu | Bank Checking | `bank_checking` | Balance computed from transactions + manually entered starting balance | | Bank Savings | `bank_savings` | Balance computed from transactions + manually entered starting balance | | Bank Credit Card | `credit_card` | Multiple card files supported simultaneously | -| Other CSV | `unknown` | Any CSV with Date, Description, Amount columns — set initial balance manually in Data tab | +| Other CSV | `unknown` | Any CSV with Date, Description, Amount columns — set its starting balance in **Settings → Accounts** | --- @@ -87,8 +87,8 @@ Use the top bar to move between views: Overview, Transactions, **Plan** (a menu FinLens stores all your data — budgets, bills, transaction edits, settings, AI history, forecasts — **directly on your computer**, never on a server. **How it works:** -1. When you pick a CSV folder in the **Data** tab, FinLens begins auto-saving your complete state to `finlens-state.json` in that same folder. -2. Every 5 seconds (when you make changes), your dashboard state is written to this file. You can also click **Save Now** to force an immediate sync. +1. When you pick a CSV folder (on the Welcome screen or in **Settings → Import**), FinLens begins auto-saving your complete state to `finlens-state.json` in that same folder. +2. Every 5 seconds (when you make changes), your dashboard state is written to this file. You can also click **Save now** in **Settings → Import** to force an immediate sync. 3. On every page load, FinLens checks for `finlens-state.json` first — if it exists, your entire state (budgets, categories, overrides, settings, AI history) is restored instantly. If the file doesn't exist, it falls back to the browser's IndexedDB or localStorage. 4. Because the file lives on your computer (not in the browser), **it survives browser cache clearing**. Even if you clear all browser data, your `finlens-state.json` remains on your disk and will be restored on the next load. @@ -263,4 +263,4 @@ See [CHANGELOG.md](CHANGELOG.md) for the full release history. --- -*FinLens v1.16.14 — Built for one person's finances, designed to be useful for anyone's.* +*FinLens v1.16.15 — Built for one person's finances, designed to be useful for anyone's.* diff --git a/index.html b/index.html index dcd2bef..2834914 100644 --- a/index.html +++ b/index.html @@ -1202,7 +1202,7 @@
-
v1.16.14 · FinLens
+
v1.16.15 · FinLens
diff --git a/js/views-database.js b/js/views-database.js deleted file mode 100644 index efb296e..0000000 --- a/js/views-database.js +++ /dev/null @@ -1,66 +0,0 @@ -/* ================================================================ - FINLENS — views-database.js - Database section sub-views: Import, Accounts, Categories, Logs, Inspector - Loaded after views-ai.js, before views-data.js -================================================================ */ - -// Sub-views registry for Database section -const dbSubviews = { - 'db-import': 'Import', - 'db-accounts': 'Accounts', - 'db-categories': 'Categories', - 'db-logs': 'Import Logs', - 'db-inspector': 'Database', -}; - -// Register the Database section routing -registerView('database', 'Database', (root) => { - const currentSubview = State.currentDbView || 'db-import'; - - // Sub-nav buttons - const subnav = document.createElement('div'); - subnav.className = 'card'; - subnav.style.display = 'grid'; - subnav.style.gridTemplateColumns = 'repeat(5, 1fr)'; - subnav.style.gap = '6px'; - subnav.style.padding = '10px'; - - for (const [viewId, label] of Object.entries(dbSubviews)) { - const btn = document.createElement('button'); - btn.className = `btn sm ${viewId === currentSubview ? '' : 'ghost'}`; - btn.textContent = label; - btn.style.borderRadius = '6px'; - btn.onclick = () => { - State.currentDbView = viewId; - lsSet('currentDbView', viewId); - showView(viewId); - }; - subnav.appendChild(btn); - } - - root.appendChild(subnav); - - // Determine which subtab to load - let subtabView = null; - if (currentSubview === 'db-import') { - subtabView = 'data'; // maps to existing data view - } else if (currentSubview === 'db-accounts') { - subtabView = 'db-accounts'; - } else if (currentSubview === 'db-categories') { - subtabView = 'db-categories'; - } else if (currentSubview === 'db-logs') { - subtabView = 'db-logs'; - } else if (currentSubview === 'db-inspector') { - subtabView = 'db-inspector'; - } - - // Render the selected subtab (delegate to individual view handlers) - if (subtabView && window['render' + subtabView.charAt(0).toUpperCase() + subtabView.slice(1)]) { - window['render' + subtabView.charAt(0).toUpperCase() + subtabView.slice(1)](root); - } -}); - -// Initialize currentDbView in State -if (!State.currentDbView) { - State.currentDbView = lsGet('currentDbView', 'db-import'); -} diff --git a/js/views-db.js b/js/views-db.js index 1402d29..89a0a99 100644 --- a/js/views-db.js +++ b/js/views-db.js @@ -515,276 +515,73 @@ registerView('db-inspector', 'DB Inspector', (root) => { /* ══════════════════════════════════════════════════════════════ 3. CHANGELOG - Content embedded directly — no fetch() needed, works on file:// - UPDATE THIS BLOCK whenever CHANGELOG.md changes. + Reads CHANGELOG.md (next to index.html) each time the view opens, so it always + matches the file (v1.16.15). Before, it showed a copy embedded here, which nobody + updated after v1.4.1. A page opened as a file (file://) can't read other files, so + there it says where the changelog is instead. ══════════════════════════════════════════════════════════════ */ -// Block-comment trick: content lives inside /* ... */ so no character -// escaping is needed (backticks, dollar signs, etc. are all fine). -// Only restriction: the string must not contain the sequence */ -// Line endings are normalized first: Git for Windows (core.autocrlf) checks files out -// with CRLF, and Function.toString() returns the source as written. -const CHANGELOG_MD = (function(){/* -# FinLens Changelog - -All notable changes to the FinLens personal finance dashboard are documented here. -Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - ---- - -## [1.4.1] — 2026-04-27 - -### Navigation & Date Ranges -- **Date range selector replaced** — Removed pill-style buttons; replaced with a `` return strings; converted to proper `Date` objects in `setRange()`. -- **Bills tab blank** — changed from `filteredTx()` to `State.transactions` (all-time) so bills always show regardless of the period selector. -- **Spending drill-down** — replaced inline `onclick` strings with `data-sp-cat-idx` attributes to avoid escaping issues. - ---- - -## [1.3.0] — 2026-04-25 - -### General -- **Favicon** — added SVG bookmark icon (teal square with "FL"). -- **Chart overflow fix** — sparkline canvases now wrapped in `.spark-wrap` div with explicit 64px height. - -### Transactions -- **Transfer in / Transfer out** — transfers labeled by direction. Outgoing: `Transfer out`; incoming: `Transfer in`. - -### Income -- **Returns / Refunds KPI** — positive-amount transactions from Chase Shopping/Merchandise category auto-classified as Returns. -- **Interest Earned KPI** — separate KPI card for interest payments. - -### Bills -- **No longer blank** — broad keyword match in addition to category tags. - -### Transfers -- **FROM / TO filters** — dropdown filters above the Transfer History table. - ---- - -## [1.2.0] — 2026-04-25 - -### New Features -- **Local File Storage (File System Access API)** — FinLens could save settings, budgets, and preferences to a `finlens-data.json` file. *(Removed in v1.4.1 — IndexedDB is now the sole persistence layer.)* - ---- - -## [1.1.0] — 2026-04-25 - -### Architecture -- Split monolithic `index.html` into a multi-file structure: `core.js`, `ui.js`, and six view modules (`views-main.js`, `views-plan.js`, `views-invest.js`, `views-forecast.js`, `views-ai.js`, `views-data.js`), plus `views-settings.js` and `init.js`. - -### New Features -- **Forecast Investments tab** — project portfolio growth with starting amount, monthly contributions, horizon slider, return presets, and year-by-year breakdown table. -- **Data tab** — dedicated file management screen with manual file-to-account assignment UI, grouped account balance inputs, initial balance fields, and credit limit inputs. -- **Settings tab** — retains Categories, API Key, Backup & Restore, and Display settings. - ---- - -## [1.0.0] — 2026-04-01 - -### Initial Release -- Single-file `index.html` dashboard with embedded CSS and JavaScript. -- Tabs: Overview, Transactions, Income, Bills & Subs, Spending, Transfers, Budgeting, Savings Buckets, Debt Tracker, Trends & Insights, Investing Ideas, Forecast, AI Analysis, Settings & Data. -- CSV import for Ally Checking, Ally Savings, and Chase credit card files. -- AI Analysis powered by Claude (Anthropic API key required). -- LocalStorage persistence for budgets, buckets, debts, bills, categories, AI history, manual balances, and settings. -- Light/dark theme toggle. -- Savings forecast simulator with scenario save/load. -- Debt payoff simulator (avalanche vs. snowball). -- Recurring transaction detection. -*/}).toString().replace(/\r\n?/g, '\n').match(/\/\*\n([\s\S]*)\n\*\//)?.[1] ?? '_The changelog text could not be read._'; - registerView('changelog', 'Changelog', (root) => { - const card = document.createElement('div'); card.className = 'card'; card.innerHTML = `

Changelog

-

Version history for FinLens.

-
-
`; +

Version history for FinLens, from CHANGELOG.md.

+ +

Reading CHANGELOG.md…

`; root.appendChild(card); + loadChangelog($('#changelogBody', card), $('#changelogOutline', card)); +}); - setTimeout(() => { - const body = document.getElementById('changelogBody'); - const outline = document.getElementById('changelogOutline'); - if (!body) return; - if (typeof marked !== 'undefined') { - body.innerHTML = `
${renderMarkdown(CHANGELOG_MD)}
`; - - // Extract h2 headers for outline - const h2s = body.querySelectorAll('h2'); - if (h2s.length > 0) { - const outlineLinks = Array.from(h2s).map((h, i) => { - const text = h.textContent.trim(); - const id = `v-${i}`; - h.id = id; // Add id to header for anchor linking - return `${escapeHtml(text)}`; - }).join(''); - outline.innerHTML = outlineLinks; - } +// Fetch CHANGELOG.md and render it into the Changelog view. Browsers don't let a page +// opened from file:// fetch files (Chrome, Edge and Firefox refuse and log an error), so +// it isn't tried there. Any failure shows a note pointing to the file. +async function loadChangelog(body, outline) { + let md = ''; + if (location.protocol !== 'file:') { + try { + const r = await fetch('CHANGELOG.md', { cache: 'no-cache' }); + if (r.ok) md = (await r.text()).replace(/\r\n?/g, '\n'); // CRLF checkouts (Git for Windows) + } catch (e) { /* offline or blocked: the note below */ } + } + if (!body.isConnected) return; // the view was left before the file arrived + if (!md.trim()) { + body.innerHTML = `
The version history is in CHANGELOG.md, in the FinLens folder next to index.html. Open that file to read it.${location.protocol === 'file:' ? ' FinLens is opened as a file here, and browsers don\'t let a page opened that way read other files.' : ' FinLens couldn\'t load it from this address.'}
`; + return; + } + if (typeof marked === 'undefined') { + body.innerHTML = `
${escapeHtml(md)}
`; + return; + } + // The file's own "# FinLens Changelog" is left out: the shell's title is the page's one H1. + body.innerHTML = `
${renderMarkdown(md.replace(/^# [^\n]*\n+/, ''))}
`; + + // An outline of the versions (one link per h2) + const h2s = $$('h2', body); + if (h2s.length) { + outline.innerHTML = h2s.map((h, i) => { + h.id = `v-${i}`; + return `${escapeHtml(h.textContent.trim())}`; + }).join(''); + outline.hidden = false; + } - body.querySelectorAll('h2').forEach(h => { - h.style.cssText = 'margin-top:28px;margin-bottom:6px;padding-bottom:6px;border-bottom:1px solid var(--border);font-size:15px;color:var(--text)'; - }); - body.querySelectorAll('h3').forEach(h => { - h.style.cssText = 'margin-top:16px;margin-bottom:4px;font-size:13px;color:var(--text-2);font-weight:600'; - }); - body.querySelectorAll('ul').forEach(ul => { - ul.style.cssText = 'padding-left:18px;margin:6px 0'; - }); - body.querySelectorAll('li').forEach(li => { - li.style.cssText = 'margin:4px 0;font-size:13px;color:var(--text-2)'; - }); - body.querySelectorAll('code').forEach(c => { - c.style.cssText = 'background:var(--surface-2);border:1px solid var(--border);padding:1px 5px;border-radius:4px;font-size:11.5px;font-family:var(--font-mono,monospace)'; - }); - body.querySelectorAll('strong').forEach(s => { - s.style.cssText = 'color:var(--text);font-weight:600'; - }); - } else { - body.innerHTML = `
${escapeHtml(CHANGELOG_MD)}
`; - } - }, 0); -}); + $$('h2', body).forEach(h => { + h.style.cssText = 'margin-top:28px;margin-bottom:6px;padding-bottom:6px;border-bottom:1px solid var(--border);font-size:15px;color:var(--text)'; + }); + $$('h3', body).forEach(h => { + h.style.cssText = 'margin-top:16px;margin-bottom:4px;font-size:13px;color:var(--text-2);font-weight:600'; + }); + $$('ul', body).forEach(ul => { + ul.style.cssText = 'padding-left:18px;margin:6px 0'; + }); + $$('li', body).forEach(li => { + li.style.cssText = 'margin:4px 0;font-size:13px;color:var(--text-2)'; + }); + $$('code', body).forEach(c => { + c.style.cssText = 'background:var(--surface-2);border:1px solid var(--border);padding:1px 5px;border-radius:4px;font-size:11.5px;font-family:var(--font-mono,monospace)'; + }); + $$('strong', body).forEach(s => { + s.style.cssText = 'color:var(--text);font-weight:600'; + }); +} diff --git a/js/views-main.js b/js/views-main.js index 6f395f8..57582db 100644 --- a/js/views-main.js +++ b/js/views-main.js @@ -349,7 +349,7 @@ function accountCardHtml(a, bal, seriesEnd, pairsAll) { middle=limit ?`
${pctStr(owed/limit)} of ${fmt0(limit)} limit${payNote}
` - :`
No credit limit set · Add one${payNote}
`; + :`
No credit limit set · Add one${payNote}
`; foot=manual?'Balance entered in Settings → Accounts':'Computed from imported transactions'; return accountCardShell(a,name,sub,tile,balHtml,middle,foot); } diff --git a/js/views-settings.js b/js/views-settings.js index bc10d7c..5330204 100644 --- a/js/views-settings.js +++ b/js/views-settings.js @@ -67,7 +67,7 @@ function _renderGeneralSettings(root) { ``).join('')} -
VersionFinLens v1.16.14
+
VersionFinLens v1.16.15
`); const opts=$$('[data-theme-opt]',root); opts.forEach((b,i)=>{