Skip to content

v1.16.15: Cleanup — remove unused views-database.js, fix the in-app changelog, update stale wording - #38

Open
gitluis wants to merge 3 commits into
fix-drawer-focusfrom
cleanup-stale-docs-and-dead-code
Open

gitluis wants to merge 3 commits into
fix-drawer-focusfrom
cleanup-stale-docs-and-dead-code

Conversation

@gitluis

@gitluis gitluis commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #37 (fix-drawer-focus), in a chain of fixes on top of the Clarity redesign (#16 → #17 → #19 → #20 → #21). Merge in order: #16, #17, #19, #20, #21, then the fixes #24–#38 and #39–#50 in order, then #10, then #23. #18 is a separate patch on master (already merged).
This cleanup doesn't use any earlier fix's code; it is stacked only so versions and the CHANGELOG merge cleanly.

Summary

A grouped housekeeping PR (§0 allows grouping minor changes). There's no new feature and no data change.

  1. js/views-database.js is deleted. index.html never loaded it, and nothing referenced it.
  2. The developer Changelog view reads CHANGELOG.md. It showed a copy embedded in views-db.js that stopped at v1.4.1. When the file can't be read, as when FinLens is opened as a file, it shows a short note pointing to CHANGELOG.md.
  3. Stale wording is fixed: 7 places in README and CLAUDE.md that pointed to the old Data tab, Settings or a Theme tab, plus one Overview link that opened the wrong Settings tab. (An 8th, CLAUDE.md §4.3, was already rewritten by v1.16.12: Fix clearing an account name not bringing the default name back #35 lower in the stack; see the table.)
  4. Luis's desktop-only decision is recorded in CLAUDE.md §1.
  5. Version v1.16.15.

What changed

1. js/views-database.js

  • Deleted. It registered an old "Database" section: a database view with Import / Accounts / Categories / Logs / Inspector sub-tabs, saving currentDbView.
  • Nothing referenced it:
    • no <script> tag in index.html;
    • none of its symbols (dbSubviews, State.currentDbView, the database view) is used anywhere else;
    • it isn't in README's file list.
  • CLAUDE.md §3 no longer lists it.
  • Left as written (history): docs/archive/IMPLEMENTATION_STATUS.md and earlier CHANGELOG entries still mention it.

2. The in-app Changelog view (changelog in js/views-db.js)

How it loaded:

  • It never read CHANGELOG.md. The whole changelog was embedded in views-db.js as a block comment, read back with Function.toString().
  • The v1.9.4 "CRLF" fix (which CLAUDE.md's history mentions) made that read work on Windows checkouts. It didn't add a fetch.
  • Nobody updated the copy after v1.4.1, so the view showed 15 versions out of 37 (at v1.16.0).

What it does now:

  • loadChangelog() fetches CHANGELOG.md (relative to index.html, cache: 'no-cache') each time the view opens, normalizes CRLF, and renders it through renderMarkdown() with the same outline and styling as before.
  • The embedded copy is gone (about 210 lines).
  • When the file can't be read, the view shows a note: "The version history is in CHANGELOG.md, in the FinLens folder next to index.html. Open that file to read it." It adds why: either "FinLens is opened as a file here…" or "FinLens couldn't load it from this address."
  • From file://, no fetch is tried. Chrome, Edge and Firefox refuse to fetch files from a page opened as a file, and log a console error when you try.
  • If you leave the view before the file arrives, the result is dropped (body.isConnected).
  • The file's own # FinLens Changelog heading is left out. The view used to render it as a second H1, against CLAUDE.md §12 ("Views never render their own H1"); the shell's "Changelog" title is the page's H1.

Why this approach:

  • One source of truth. The view reads the file the changelog discipline (§17) already keeps current, so it can't drift again.
  • A fallback copy is what drifted. Keeping one in step would need a build step (ruled out by §15) or a manual edit on every release, which is what stopped happening after v1.4.1.
  • The note covers what a copy covered. The only case a copy served is file://, and there the file is sitting next to index.html. This is a developer-only view.

Scope in views-db.js: only section 3 changed, from its banner comment to the end of the file. The DB Schema and DB Inspector code above it is untouched. (#30's one-word schema note change, {type,id}, is further up the file and merged without a conflict.)

3. Stale wording

Fixed:

Where Was Now
README, Supported Accounts, "Other CSV" set initial balance manually in Data tab set its starting balance in Settings → Accounts
README, Data Persistence, step 1 pick a CSV folder in the Data tab on the Welcome screen or in Settings → Import
README, Data Persistence, step 2 click Save Now Save now (the button's label) in Settings → Import
CLAUDE.md §3 lists views-database.js removed; views-db.js notes the Changelog reads CHANGELOG.md
CLAUDE.md §4.3, Account name user-editable via Data tab dropped in the stack: #35 already rewrote this line ("Default name (§18), never the name you typed … Show acctName(id)"), so this PR keeps #35's text, and its CHANGELOG and "Last updated" note no longer list §4.3
CLAUDE.md §6, .seg (Settings → Theme) (Settings → General → Theme)
CLAUDE.md §18, credit_card balance Manual override in Data tab the balance owed entered in Settings → Accounts or Settings → Credit cards; without one, the sum of the card's transactions (checked against currentBalances())
CLAUDE.md §19, Transfer Keywords user-editable from Settings edited on the Transfers screen (§11)
js/views-main.js, Overview credit card "No credit limit set · Add one" opened Settings → Accounts, which has had no limit field since v1.16.0 opens Settings → Credit cards

Checked and still accurate, so left alone:

  • README: "top bar"; the ☰ menu on narrow windows (the responsive CSS stays); "Double-click an account name to rename it" (wireAccountRename()); the Transfers diagram ("Where money moved").
  • CLAUDE.md:
    • "the sidebar is gone" (§12);
    • finlens_navCollapsed "left by the sidebar" (§20);
    • buckets with an old emoji icon (§4.1);
    • "replaces the emoji rule" (§12).
  • Every in-app link target exists: each data-goto, data-tab and showView('…') points to a registered view or Settings tab.

Found but not changed, because they're outside "README, CLAUDE.md and user-facing strings":

  • Code comments in js/init.js:
    • line 84, "File pickers → data tab";
    • line 147, "mark so Data tab can show reconnect UI".
  • "Data & Reset" capitalization (the tab is "Data & reset") in comments in core.js, db.js, init.js, views-cleanup.js, and in CLAUDE.md §14. The tab exists; only the case differs.
  • views-eval.js says "the AI Analysis tab" in the text it writes into EVAL.md. Changing it would change regenerated eval docs.

4. Desktop only

CLAUDE.md §1, under "What it does": 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.

5. Version

v1.16.15 in:

  • CHANGELOG.md (new entry)
  • the index.html footer
  • README.md (badge and footer line)
  • js/views-settings.js
  • CLAUDE.md §1, and its "Last updated" line

Not verified

  • Browsers other than headless Chromium. The file:// behavior relies on browsers refusing to fetch from a page opened as a file; Firefox and Safari do too by default, but neither was run.
  • A real web server. The http checks used the harness's local origin; nothing was checked over GitHub Pages or python -m http.server.
  • How the view looks in dark mode (only a light screenshot was taken). The styling code is unchanged apart from the note, which uses the existing .callout.plain.
  • No phone checks, per the desktop-only decision. The existing phone checks in test-clarity.js still pass.
Automated checks: earlier run, not re-run · ecfcab2

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 commit ecfcab2, chained on #37. Each script ran as NODE_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).

Script Result on ecfcab2
test-clarity.js 55/55
test-insights.js 137/137
test-finances.js 126/126
test-plan.js 127/127
boot.js 257 transactions, 24 views, 0 errors
race.js 6 errors, all renderImportLog (the race #18 fixes on master; not in this stack)
test-clear-edits.js (from #24) 47/47
test-rebuild-folder.js (from #25) 57/57
test-partial-import.js (from #26) 47/47
test-json-import.js (from #27) 28/28
test-new-browser-copy.js (from #28) 10/10
test-json-export.js (from #29) 31/31
test-plan-links.js (from #30) 60/60
test-rule-flags.js (from #31, as updated by #32) 67/67
test-drawer-flags.js (from #32) 36/36
test-start-balance.js (from #33, as updated by #34) 193/193
test-ai-summary-period.js (from #34) 78/78
test-account-names.js (from #35) 40/40
test-account-order.js (from #36) 32/32
test-drawer-focus.js (from #37) 167/167
test-cleanup.js (new in this PR) 21/21

Measured before the chain

By the agent that wrote the fix, on cf7199f (built on 70c7125, v1.16.0; then numbered v1.16.12). The changelog counts there are for v1.16.0's CHANGELOG plus this entry; on this branch the test reads the stack's CHANGELOG, with every v1.16.x entry.

Headless Chromium (Playwright) at 1280×900 against samples/. CDNs are served from npm by the harness, over http://localhost:4173. All scripts ran as NODE_PATH=$(npm root -g) node <script> <worktree> <outdir>.

New: test-cleanup.js (21 checks).

  • views-database.js: it's gone, and nothing in index.html, README, CLAUDE.md (outside its history line) or js/ names it. No database view is registered. Boot, the import, all 24 views and the Changelog: no request 404s or fails.
  • Over http:
    • the Changelog shows CHANGELOG.md's top version first, and all 38 versions in order (37 before this entry);
    • the outline has one link per version, and a link moves to its version;
    • there's one H1 on the page;
    • no embedded copy is left;
    • the footer version matches the changelog's top version;
    • CRLF line endings render the same;
    • leaving the view before the file arrives leaves the next screen alone;
    • no console errors.
  • When CHANGELOG.md can't be read:
    • the request aborted, or a 404: the note shows, with no versions and no outline, and no errors other than the browser's own "Failed to load resource";
    • FinLens loaded from file:// (scripts from disk): the note says FinLens is opened as a file, no fetch is tried, and there are no console errors.
  • Overview: with no credit limit set, "Add one" opens Settings → Credit cards, which has the limit field.
Script Before (70c7125) After (cf7199f)
test-cleanup.js (new) 9/21 21/21
test-clarity.js 55/55 55/55
test-finances.js 126/126 126/126
test-plan.js 127/127 127/127
test-insights.js (version check reads the footer) 137/137 137/137
boot.js 0 errors 0 errors
race.js 6, 8, 6, 6 errors (four runs) 7, 7, 7, 9 errors (four runs), then 7 on the final commit

The 12 checks that failed before:

  • the file still exists and is listed in CLAUDE.md;
  • the view showed 1.4.1 first and only 15 versions;
  • the outline, the H1 and the "no embedded copy" checks;
  • CRLF (still the old copy);
  • the credit-limit link opened Accounts;
  • the old copy instead of a note in the three can't-read cases.

race.js: every error in every run is renderImportLog (#18). The counts vary with machine load; the 9 came from a run with seven suites in parallel. None come from this change.

No existing suite was edited.

Screenshots: changelog-http.png, changelog-note.png and changelog-file.png in the test output folder.

Manual QA steps

Setup

  1. git checkout cleanup-stale-docs-and-dead-code.
  2. Open index.html in Edge from disk (file://). Your usual data is fine: this PR doesn't change saving or importing.
  3. For test 3 you also need FinLens served over http. In a terminal, in the repo folder, run python -m http.server 8000. Leave it running.

The Changelog view has no link in the app. You open it from DevTools: F12 → Console, type showView('changelog') and press Enter.

1. The app still boots and nothing asks for the deleted file

  1. With FinLens open from disk, press F12 → Network tab. Tick Disable cache.
  2. Press F5.
  3. Type views-database in the Network filter box.
  4. Switch to the Console tab.

Expected:

  • No request for views-database.js appears (it was never loaded; there's no 404 either).
  • No red errors in the Console.
  • The footer and Settings → General → Version both say v1.16.15.

2. Changelog opened as a file shows the note

  1. Still on file://, in the Console, run showView('changelog').
  2. Read the page.
  3. Look at the Console.

Expected:

  • The page title is Changelog, with the line "Version history for FinLens, from CHANGELOG.md."
  • A note says: "The version history is in CHANGELOG.md, in the FinLens folder next to index.html. Open that file to read it. FinLens is opened as a file here, and browsers don't let a page opened that way read other files."
  • No version list and no outline of version links.
  • No new red error in the Console (no fetch was tried).

Before this fix: the view showed an old embedded copy that started at v1.4.1.

3. Changelog over http shows the real file

  1. Open a new tab at http://localhost:8000/index.html. (It's a different site to the browser, so it starts empty. Click Try it with sample data if you want data; the Changelog doesn't need it.)
  2. F12 → Console, run showView('changelog').
  3. Look at the top of the page and the row of version links under the intro line.
  4. Click the link for an older version, e.g. [1.10.0].
  5. In the Console, run document.querySelectorAll('h1').length.

Expected:

  • The first version shown is [1.16.15] — 2026-11-02, the same as the top of CHANGELOG.md.
  • The outline has one link per version, newest first, down to the oldest in the file.
  • Step 4 scrolls to that version.
  • There's no second "FinLens Changelog" heading inside the page. Step 5 prints 1.
  • No red errors in the Console.

4. Leaving the view while it loads

  1. Over http, in Network, set throttling to Slow 3G (the "No throttling" dropdown).
  2. Run showView('changelog') and, straight away, click Overview in the app bar.
  3. Wait a few seconds. Set throttling back to No throttling.

Expected:

  • The Overview stays as it is; changelog text never appears on it.
  • No red errors in the Console.

5. A missing CHANGELOG.md over http shows the note

  1. Stop the server (Ctrl+C). Rename CHANGELOG.md to CHANGELOG.bak. Start the server again.
  2. Reload http://localhost:8000/index.html and run showView('changelog').
  3. Rename the file back afterwards.

Expected:

  • The same note as test 2, but ending "FinLens couldn't load it from this address."
  • The only Console error is the browser's own "Failed to load resource … 404" for CHANGELOG.md.

6. Overview "Add one" opens Credit cards

  1. Back in the file:// tab, make sure a credit card has no limit: Settings → Credit cards, clear Credit limit ($) for the card if it has one.
  2. Open Overview. Find the credit card's account card.
  3. Click Add one in "No credit limit set · Add one".

Expected:

  • Settings opens on the Credit cards tab, which has the Credit limit ($) field.

Before this fix: it opened Settings → Accounts, which has no limit field.

7. Regression: the DB views still work

  1. In the file:// tab, in the Console, run showView('db-schema').
  2. Run showView('db-inspector').

Expected:

  • DB Schema shows the store diagram, and DB Inspector shows the store browser, as before.
  • No red errors in the Console.

8. Docs read correctly

  1. Open README.md. Find "Other CSV" under Supported Accounts, and the Data Persistence steps.
  2. Open CLAUDE.md §1 and find Desktop only.

Expected:

  • README says to set a starting balance in Settings → Accounts, to pick the folder on the Welcome screen or in Settings → Import, and Save now in Settings → Import. No "Data tab".
  • CLAUDE.md §1 has "Desktop only (Luis, 2026-11-02): FinLens targets desktop browsers; don't spend work on phone layouts…".

Please check before merging

https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft


Generated by Claude Code

…md, fix stale wording (v1.16.15)

- 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
gitluis pushed a commit that referenced this pull request Nov 2, 2026
…e-tab

Merges cleanup-stale-docs-and-dead-code (#38), the top of the fix chain
stacked on #21, so #10 can merge last. No rebase.

Conflicts:
- Versions: 1.17.0 kept in the footer, README, Settings -> General and
  CLAUDE.md §1. CHANGELOG: 1.17.0, then 1.16.15 ... 1.16.1, then 1.16.0.
- CLAUDE.md: "Last updated" is #10's note followed by the chain's
  history; §3's views-db.js line names both the Database tab and the
  Changelog view that reads CHANGELOG.md.
- views-db.js: #10's rebuilt DB Schema code, with #30's plan link note
  ({type,id}); the Changelog banner keeps "4. CHANGELOG" with #38's
  text and code (loadChangelog(), no embedded copy).
- views-settings.js: #10's tab-bar comment and version line.
- #10's wording about the embedded changelog, which #38 removed, is
  updated in CLAUDE.md §19 and the 1.17.0 entry.

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

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.15. renderImportLog() keeps #18's guards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
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 pushed a commit that referenced this pull request Nov 2, 2026
…database-tab

Brings in the second fix chain (#24-#38 already merged here; now the twelve
fixes v1.16.16-v1.16.27). Version stays v1.17.0; CHANGELOG runs 1.17.0,
1.16.27 ... 1.16.0, 1.10.5 ...

Conflicts:
- CHANGELOG.md: 1.17.0 entry on top of the chain's changelog.
- README.md, index.html, js/views-settings.js, CLAUDE.md section 1: v1.17.0.
- CLAUDE.md Last updated: #10's note, then the chain's history from v1.16.27.
- js/views-db.js: #10's rewritten DB Schema kept; the chain's one change there
  (ruleCategories in the app_state note, v1.16.25) applied to #10's note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
@gitluis gitluis added chore Housekeeping: cleanup, dead code, licensing documentation Improvements or additions to documentation labels 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
…-stale-docs-and-dead-code

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

# Conflicts:
#	CLAUDE.md
#	js/views-settings.js
@gitluis gitluis changed the title v1.16.15: cleanup — remove unused views-database.js, fix the in-app changelog, update stale wording v1.16.15: Cleanup — remove unused views-database.js, fix the in-app changelog, update stale wording Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Housekeeping: cleanup, dead code, licensing documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants