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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

---

## [1.16.27] — 2026-11-02

Minor fixes, grouped in one release (CLAUDE.md §0).

### Settings → Data & reset
- **After Rebuild from your folder, the button read "Rebuild", not "Rebuilt".** The import (`loadFiles()`, then `reloadFromDirHandle()`) renders the tab partway through the rebuild. That render used up `DataCleanup.lastDone`, so the render at the end showed the button as if nothing had run. The other actions don't render partway, so they already showed "Cleared".
- **Fix (`views-cleanup.js`):** `DataCleanup.running` names the action under way; `_done()` ends it. A render meanwhile shows that button as "Working…", disabled, and leaves `lastDone` for the render `_done()` makes. Before, the first of those renders showed "Rebuilt" before the import had finished, and the next one put the button back to "Rebuild", enabled, while the backup file was still being written.
- **Unchanged:** what Rebuild does, its messages, and every other action.

### Settings → Accounts
- **The ▲▼ arrows kept the old name after a rename.** Their `aria-label` ("Move Bank Checking up") was set when the tab rendered, and renaming an account doesn't re-render it, so a screen reader heard the old name until the next render. Saving a name now updates the row's two arrows.

### Developer views
- **The date-range label no longer shows under their title.** DB Inspector, DB Schema, Changelog, AI Eval and Import Logs (`db-inspector`, `db-schema`, `changelog`, `ai-eval`, `db-logs`) don't use the date range. They are in `NO_RANGE_VIEWS` (`ui.js`) now, with the Plan screens, Trends and Settings.

### Docs
- **Stale wording in code comments:** "data tab" in `init.js` (the file pickers lead to Settings → Import, and Reconnect is offered there), and "Data & Reset" in `core.js`, `db.js`, `migrate.js`, `views-cleanup.js`, `views-data.js` and `init.js`: the tab is **Data & reset**.
- **CLAUDE.md:** §9 and §12 list the developer views in `NO_RANGE_VIEWS`; §14 says Data & reset; §20 describes `DataCleanup.running`.

---

## [1.16.26] — 2026-11-02

### Fixed
Expand Down
12 changes: 7 additions & 5 deletions CLAUDE.md

Large diffs are not rendered by default.

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.16.26  ·  **Stack:** Vanilla JS, HTML, CSS  ·  **Install:** None
**Version:** v1.16.27  ·  **Stack:** Vanilla JS, HTML, CSS  ·  **Install:** None

---

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

---

*FinLens v1.16.26 — Built for one person's finances, designed to be useful for anyone's.*
*FinLens v1.16.27 — 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 @@ -1164,7 +1164,7 @@
<div class="folder-banner-wrap" id="folderBanner" hidden></div>
<div class="content" id="content"></div>
</main>
<footer class="appfoot">v1.16.26 · FinLens</footer>
<footer class="appfoot">v1.16.27 · FinLens</footer>

<!-- side drawer: transaction detail, bill and plan forms (ui.js openDrawer) -->
<div class="drawer-scrim" id="drawerScrim" onclick="closeDrawer()" hidden></div>
Expand Down
2 changes: 1 addition & 1 deletion js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const _saveStateDebounced = debounce(async (state) => {
await saveStateToFile(state);
}, 5000);

/* ---------- Folder + state-file maintenance (Settings → Data & Reset) ---------- */
/* ---------- Folder + state-file maintenance (Settings → Data & reset) ---------- */
// Browsers only show a file-permission prompt during a user gesture, so the
// functions that may need write access must be called from a click handler.

Expand Down
2 changes: 1 addition & 1 deletion js/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ const DB = {
});
},

/* ── Cleanup & reset (used by Settings → Data & Reset, views-cleanup.js) ── */
/* ── Cleanup & reset (used by Settings → Data & reset, views-cleanup.js) ── */

/** Every object store in finlens_db. Keep in sync with open() → onupgradeneeded. */
STORES: ['transactions', 'tx_overrides', 'accounts', 'import_log', 'app_state'],
Expand Down
6 changes: 3 additions & 3 deletions js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
renderActive();
});

/* ---- File pickers → data tab ---- */
/* ---- File pickers → Settings → Import (handleFilePick(), views-data.js) ---- */
const folderPick = $('#folderPick');
const filePick = $('#filePick');
if (folderPick) folderPick.addEventListener('change', e => { if (e.target.files.length) handleFilePick(e.target.files); folderPick.value=''; });
Expand Down Expand Up @@ -135,7 +135,7 @@
// Only needed if IndexedDB has no transactions (fresh install or DB cleared).
// If DB already has transactions, we skip the CSV reload — data is already loaded.
// Skipped while csvAutoImportPaused: the user cleared their transactions on purpose
// (Settings → Data & Reset), so they stay cleared until the user imports again.
// (Settings → Data & reset), so they stay cleared until the user imports again.
if (!State.transactions.length && !State.csvAutoImportPaused) {
try {
const csvHandle = await idbGet('csvDirHandle');
Expand All @@ -144,7 +144,7 @@
if (perm === 'granted') {
await reloadFromDirHandle(csvHandle);
} else {
// Permission needs a user gesture — mark so Data tab can show reconnect UI
// Permission needs a user gesture: Settings → Import shows Reconnect (views-data.js)
State._csvNeedsReconnect = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ const IdMigration = {
if (typeof DB !== 'undefined' && DB._db) {
const [ovs, accounts, logs, appState] = await Promise.all(
['tx_overrides', 'accounts', 'import_log', 'app_state'].map((s) => this._all(s)));
// An import stores the account before its transactions, Data & Reset clears the two
// An import stores the account before its transactions, Data & reset clears the two
// together, and this migration rewrites every store in one IndexedDB transaction, so
// transactions with old codes always come with an account that has one.
const txs = accounts.some((a) => this.isOld(a.id)) ? await this._all('transactions') : [];
Expand Down
6 changes: 4 additions & 2 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function showView(id) {
const pt=$('#pageTitle'); if (pt) pt.textContent=VIEWS[id].title;
const bar=$('.pagebar'); if (bar) bar.classList.remove('hero');
// Screens that don't use the date range hide its label: the Plan screens (Budget has its
// own month), Trends (always the latest six months) and Settings.
// own month), Trends (always the latest six months), Settings and the developer views.
const rl=$('#rangeLabel'); if (rl) rl.hidden=NO_RANGE_VIEWS.includes(id);
// body[data-view] lets CSS size the page per screen (Settings is narrower); first-run is
// set again by the Welcome if it shows.
Expand Down Expand Up @@ -213,7 +213,9 @@ function chartColor(name, alpha) {
/* ---------- APP BAR: Plan menu, filter popovers, ☰ menu ---------- */
const PLAN_VIEWS = ['budgets','buckets','debt','investments','forecast'];
// Screens that ignore the date range: the shell hides its label there (v1.15.0, v1.16.0).
const NO_RANGE_VIEWS = [...PLAN_VIEWS, 'trends', 'settings'];
// The developer views (not in the nav: showView() from DevTools) show stored records, the
// changelog or the eval's samples, never the range (v1.16.27).
const NO_RANGE_VIEWS = [...PLAN_VIEWS, 'trends', 'settings', 'db-inspector', 'db-schema', 'changelog', 'ai-eval', 'db-logs'];
let _appBarOpen = null; // { btn, panel } of the menu or popover that's open

function openAppBarPopup(btn, panel) {
Expand Down
21 changes: 15 additions & 6 deletions js/views-cleanup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ================================================================
FINLENS — views-cleanup.js
Settings → Data & Reset: clean up imported data, the database and
Settings → Data & reset: clean up imported data, the database and
logs, clear plans, disconnect the CSV folder, or start over.
Loaded after views-settings.js, before views-db.js.

Expand All @@ -15,6 +15,7 @@
const DataCleanup = {
lastMessage: null, // { kind: 'good'|'warn'|'bad', text } shown once at the top of the tab
lastDone: null, // 'action|arg' of the action that just ran: its button shows "Cleared" once
running: null, // 'action|arg' of the action running now; _done() ends it

// Plans and history the user created: [State key, label, empty value (default [])].
// Saved under storageKey(State key) (core.js).
Expand Down Expand Up @@ -286,6 +287,7 @@ const DataCleanup = {

_done(kind, text) {
this.lastMessage = { kind, text };
this.running = null;
if (kind === 'bad') this.lastDone = null;
renderActive();
},
Expand All @@ -297,8 +299,12 @@ registerView('data-cleanup', 'Data & reset', (root) => {
wireLinks(root);
const msg = DataCleanup.lastMessage;
DataCleanup.lastMessage = null;
const done = DataCleanup.lastDone;
DataCleanup.lastDone = null;
// A render while an action runs (Rebuild's import renders the tab partway through) keeps
// that button at "Working…" and leaves lastDone for the render _done() makes. Up to
// v1.16.26 it used lastDone up, so a finished Rebuild read "Rebuild", not "Rebuilt".
const running = DataCleanup.running;
const done = running ? null : DataCleanup.lastDone;
if (!running) DataCleanup.lastDone = null;
if (msg) appendHtml(root, callout(msg.kind === 'good' ? 'good' : msg.kind, escapeHtml(msg.text)));

const folder = State.lastFolderName;
Expand Down Expand Up @@ -344,10 +350,10 @@ registerView('data-cleanup', 'Data & reset', (root) => {
appendHtml(root, `<section class="panel" aria-labelledby="cleanH">
<div><h2 id="cleanH">Clean up</h2><p class="sub">Each button asks you to click again to confirm.</p></div>
<div class="clean-rows">${rows.map(([act, arg, title, desc, label, doneLabel, needsHandle]) => {
const isDone = done === act + '|' + arg;
const isDone = done === act + '|' + arg, isRunning = running === act + '|' + arg;
return `<div class="clean-row"${needsHandle ? ' data-needs-handle' : ''}>
<div class="who"><div class="t">${title}</div><div class="d">${desc}</div></div>
<button type="button" class="btn ghost clean-btn${isDone ? ' done' : ''}" data-dc-action="${act}" data-dc-arg="${escapeHtml(arg)}" data-dc-label="${label}" data-dc-done="${doneLabel}" aria-label="${escapeHtml(title)}"${isDone ? ' disabled' : ''}>${isDone ? doneLabel : label}</button>
<button type="button" class="btn ghost clean-btn${isDone ? ' done' : ''}" data-dc-action="${act}" data-dc-arg="${escapeHtml(arg)}" data-dc-label="${label}" data-dc-done="${doneLabel}" aria-label="${escapeHtml(title)}"${isDone || isRunning ? ' disabled' : ''}>${isRunning ? 'Working…' : isDone ? doneLabel : label}</button>
</div>`;
}).join('')}</div>
</section>`);
Expand Down Expand Up @@ -390,9 +396,12 @@ registerView('data-cleanup', 'Data & reset', (root) => {
b.classList.remove('armed');
b.disabled = true;
b.textContent = 'Working…';
DataCleanup.lastDone = b.dataset.dcAction + '|' + b.dataset.dcArg;
const key = b.dataset.dcAction + '|' + b.dataset.dcArg;
DataCleanup.lastDone = key;
DataCleanup.running = key;
try { await DataCleanup[b.dataset.dcAction](b.dataset.dcArg); }
catch(e) { console.error('[FinLens] cleanup:', e); DataCleanup._done('bad', 'Something went wrong: ' + (e.message || e)); }
finally { if (DataCleanup.running === key) DataCleanup.running = null; } // every action ends in _done(); in case one doesn't
}));

$('#dcExport').onclick = () => exportAllData();
Expand Down
4 changes: 3 additions & 1 deletion js/views-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ async function reconnectDataFolder() {
if (!State.transactions.length) {
restored = await _restoreStateIfBrowserEmpty();
// Boot skipped the CSV auto-import for lack of access; do it now, unless the user
// cleared their transactions on purpose (Data & Reset) and import is paused.
// cleared their transactions on purpose (Data & reset) and import is paused.
if (!State.transactions.length && !State.csvAutoImportPaused) await reloadFromDirHandle(dir);
}
State._csvNeedsReconnect = false;
Expand Down Expand Up @@ -749,6 +749,8 @@ registerView('accounts','Accounts',(root)=>{
$$('[data-acct-name]',root).forEach(inp=>inp.addEventListener('change',()=>{
const id=inp.dataset.acctName, shown=setAccountName(id, inp.value);
inp.value=shown;
// The row's order arrows name the account: give them the new name now, not at the next render
$$(`[data-move="${CSS.escape(id)}"]`,root).forEach(b=>b.setAttribute('aria-label',`Move ${shown} ${b.dataset.dir==='-1'?'up':'down'}`));
say('good',State.accountLabels[id]?`Saved the name “${shown}”.`:`Using the default name “${shown}”.`);
}));
$$('[data-acct-money]',root).forEach(inp=>inp.addEventListener('change',()=>{
Expand Down
2 changes: 1 addition & 1 deletion js/views-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function _renderGeneralSettings(root) {
/* ---- About (the Theme row is gone: light only for now) ---- */
appendHtml(root,`<section class="panel" aria-labelledby="dispH">
<h2 id="dispH">About</h2>
<div class="set-row"><span class="t">Version</span><span class="v">FinLens v1.16.26</span></div>
<div class="set-row"><span class="t">Version</span><span class="v">FinLens v1.16.27</span></div>
</section>`);

/* ---- Anthropic API key ---- */
Expand Down