Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!--
Title: "vX.Y.Z: Short title", version first, then a capital letter (sentence case), e.g. "v1.11.0: Budget alerts", "v1.11.1: Fix card balances in credit showing as owed".
Sections are ##, subsections ###. No --- separators and no collapsed <details> blocks.
Merge order, the stacked note, Root cause and How to reproduce the bug appear only when they apply. Delete them otherwise.
Rules: CLAUDE.md §0.
-->

<!-- Only when this PR must merge before or after other PRs (same section touched, consecutive versions) -->
**Merge order:** #NN → **#MM (this PR)** → #KK

<!-- Only for a stack @gitluis approved -->
> **Stacked on #NN** — approved by @gitluis on <date>: <why it can't wait>

## Summary
What the PR does, in a few lines.
<!-- Add "Closes #N" when the PR resolves an issue -->

**Suggested version:** vX.Y.Z

## Root cause
<!-- Bug fixes only -->

## What changed

### Files
Files touched and what changed in each.

### Behavior
What the user sees or what the app does differently.
<!-- UI PRs: before/after screenshots -->
<!-- Storage changes: what happens to data already saved (IndexedDB, finlens-state.json, localStorage): kept, migrated or cleared -->

### Trade-offs
Choices made and what they cost.

### Found, not fixed
Related problems noticed but left for a later PR, or "None".

## Testing

### Automated checks
**Environment:** <runner> · **Commit:** `<short SHA>` · **Passed:** <passed>/<total>

| Check | Result | Notes |
|---|---|---|
| Version matches CHANGELOG, index.html, README, views-settings.js and CLAUDE.md, and is next after master | ✅ Pass | |
| ... | | |

<!-- ✅ Pass · ❌ Fail · ⏭️ Skipped. Replace this line and table in place when a new commit is tested. -->

### Not verified
What the tests couldn't cover (real Edge/Chrome with a real data folder, real bank exports, the Claude API, screen readers).

### How to reproduce the bug
<!-- Bug fixes only -->
1. One action per step, from a known state on master (or the affected PR/version)
2. ...

**What goes wrong:** ...
**What should happen:** ...

### Manual QA steps
**Setup:** check out `<branch>`, run `python3 -m http.server 8000` in the repo folder, open http://localhost:8000 in a private window, load `<sample from samples/>`.

1. Click **<label>** → you should see ...
2. ...
<!-- Main change first, then persistence (reload, Clear everything), then regressions.
Bug fixes: repeat the reproduction steps and show the result is now correct.
Docs-only: list what to read and what to check. -->

## Check before merging
- [ ] Decisions only @gitluis can make
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

---

## [1.10.11] — 2026-11-05

### Technical
- **Pull request template.** New `.github/pull_request_template.md`, which GitHub pre-fills in every new PR description, drafts included. Order: Summary (ends with the suggested version) → Root cause (bug fixes only) → What changed (Files, Behavior, Trade-offs, Found, not fixed) → Testing (Automated checks, Not verified, How to reproduce the bug, Manual QA steps) → Check before merging, always last. Optional merge-order and stacked lines sit at the top only when they apply. Sections are `##` and `###`, with no `---` separators and no collapsed `<details>` blocks. Test results stay in the description and are replaced in place on each tested commit.

### Docs
- **CLAUDE.md §0** — "What every PR includes" points to the template and summarizes its layout. PR titles are `vX.Y.Z: Short title`, with a capital letter after the version (sentence case).
- **CLAUDE.md** — the owner is named as @gitluis instead of "Luis" (§0 and §14).

---

## [1.10.5] — 2026-11-02

### Fixed
Expand Down
19 changes: 12 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## 0. Workflow — Branches, Pull Requests and Approvals (read first)

Nothing reaches `master` except through a reviewed pull request. This is the owner's (Luis's) standing rule.
Nothing reaches `master` except through a reviewed pull request. This is the owner's (@gitluis's) standing rule.

### One branch and one PR per change

Expand All @@ -19,8 +19,13 @@ Nothing reaches `master` except through a reviewed pull request. This is the own
### What every PR includes

- **CHANGELOG and version** bumped per §17.
- **A description** with a summary, the cause (for bugs), what changed, how it was tested, and a "please check before merging" list.
- **Tests run** before opening the PR (headless browser checks against `samples/`). Report results honestly, including anything not verified.
- **A description that follows `.github/pull_request_template.md`.** GitHub pre-fills it on every new PR, drafts included:
- **Title:** `vX.Y.Z: Short title`, version first, then a capital letter (sentence case), e.g. `v1.11.1: Fix card balances in credit showing as owed`.
- **Layout:** Summary (ends with the suggested version) → Root cause (bug fixes only) → What changed (Files, Behavior, Trade-offs, Found, not fixed) → Testing (Automated checks, Not verified, How to reproduce the bug for bug fixes, Manual QA steps) → Check before merging, always last.
- **Formatting:** `##` sections and `###` subsections; no `---` separators and no collapsed `<details>` blocks.
- **Optional top lines:** a merge-order line when PRs must merge in a set order, and a stacked note only for a stack @gitluis approved.
- **Manual QA steps:** a Setup line, then one action per step plus what you should see — main change first, then persistence, then regressions.
- **Tests run** before opening the PR (headless browser checks against `samples/`). Results go in the description's Automated checks table, replaced in place when a new commit is tested. Report results honestly, including anything not verified.

### Stacked PRs

Expand All @@ -30,7 +35,7 @@ Nothing reaches `master` except through a reviewed pull request. This is the own

### Approval before merging

A PR is merged only after Luis approves it, in one of two ways:
A PR is merged only after @gitluis approves it, in one of two ways:

1. **On GitHub** — he merges the PR himself, or leaves a comment approving it. (PRs are opened under his own account, and GitHub doesn't let an author formally approve their own PR, so a comment or merge is the GitHub form of approval.)
2. **In chat** — he tells Claude it's approved. **Before merging, Claude posts a comment on the PR recording that approval** as evidence:
Expand Down Expand Up @@ -59,7 +64,7 @@ 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.10.5 (updated in `index.html` footer, `README.md`, and `CHANGELOG.md` on every release).
**Current version:** v1.10.11 (updated in `index.html` footer, `README.md`, and `CHANGELOG.md` on every release).

**What it does:** Imports CSV exports from Ally Bank (Checking + Savings) and Chase 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.

Expand Down Expand Up @@ -695,7 +700,7 @@ The handle lives in a separate `finlens_fs` database (distinct from `finlens_db`
- **Check before touching files.** `loadStateFromFile()` and `saveStateToFile()` call `folderPermission(dir, mode)` (wraps `queryPermission`, never prompts) and skip quietly instead of throwing `NotAllowedError`. When access is missing they set `State._folderNeedsAccess`, which shows the **Reconnect folder** banner (`#folderBanner`, `updateFolderBanner()` in `views-data.js`). A successful save clears it.
- **Always ask for `readwrite`**, not `read`: the folder picker, Reload and Reconnect all do, because the same folder holds `finlens-state.json`.
- **Prompting code runs only in click handlers:** `saveNowClick()`, `reconnectFolderClick()`, `reloadDataFiles()`, and the Data & Reset actions via `folderWithWriteAccess()` / `saveStateNow()`.
- **After reconnecting, the browser copy wins** (Luis's decision, 2026-10-24): `reconnectDataFolder()` writes the browser's state to the file and does not load the file over it. **Exception:** a browser with no transactions (new browser, cleared site data) restores from the file instead (`_restoreStateIfBrowserEmpty()`), so an empty state never overwrites the only backup. Picking a folder follows the same rule.
- **After reconnecting, the browser copy wins** (@gitluis's decision, 2026-10-24): `reconnectDataFolder()` writes the browser's state to the file and does not load the file over it. **Exception:** a browser with no transactions (new browser, cleared site data) restores from the file instead (`_restoreStateIfBrowserEmpty()`), so an empty state never overwrites the only backup. Picking a folder follows the same rule.

---

Expand Down Expand Up @@ -798,7 +803,7 @@ Multiple Chase card files can be loaded simultaneously. Each gets a unique `acco

---

*Last updated: v1.10.5 — 2026-11-02 (no section changes: Import Logs race fix; v1.10.4: §8, §13 single `~` is literal; §21 excerpts escape `~`; v1.10.3: §13 refusals; §21 declined runs; 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.10.11 — 2026-11-05 (§0 PR description follows `.github/pull_request_template.md`; titles are sentence case after the version; owner named as @gitluis; v1.10.5: no section changes, Import Logs race fix; v1.10.4: §8, §13 single `~` is literal; §21 excerpts escape `~`; v1.10.3: §13 refusals; §21 declined runs; 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)*

---

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> A zero-install, browser-native finance dashboard. Drop in your bank CSVs, get instant clarity on your money.

**Version:** v1.10.5 &nbsp;·&nbsp; **Stack:** Vanilla JS, HTML, CSS &nbsp;·&nbsp; **Install:** None
**Version:** v1.10.11 &nbsp;·&nbsp; **Stack:** Vanilla JS, HTML, CSS &nbsp;·&nbsp; **Install:** None

---

Expand Down Expand Up @@ -260,4 +260,4 @@ See [CHANGELOG.md](CHANGELOG.md) for the full release history.

---

*FinLens v1.10.5 — Built for one person's finances, designed to be useful for anyone's.*
*FinLens v1.10.11 — Built for one person's finances, designed to be useful for anyone's.*
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
<div style="margin-top:auto">
<a class="nav" data-view="settings">⚙️ Settings</a>
<div class="footer">
<div style="color:var(--text-3);font-size:11px">v1.10.5 · FinLens</div>
<div style="color:var(--text-3);font-size:11px">v1.10.11 · FinLens</div>
</div>
</div>
</aside>
Expand Down
2 changes: 1 addition & 1 deletion js/views-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function _renderGeneralSettings(root) {
</select>
</div>
</div>
<div class="muted" style="font-size:11.5px;margin-top:14px">FinLens v1.10.5 ·${State.transactions.length} transactions loaded${State.lastRefresh?' · Refreshed '+dayjs(State.lastRefresh).format('MMM D, YYYY h:mm A'):''}</div>`;
<div class="muted" style="font-size:11.5px;margin-top:14px">FinLens v1.10.11 ·${State.transactions.length} transactions loaded${State.lastRefresh?' · Refreshed '+dayjs(State.lastRefresh).format('MMM D, YYYY h:mm A'):''}</div>`;
root.appendChild(displayCard);

/* ---- Anthropic API Key ---- */
Expand Down