Skip to content
Draft
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
85 changes: 85 additions & 0 deletions .github/scripts/rename_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"""Rename the app everywhere a person sees its name — and nowhere else.

python3 .github/scripts/rename_app.py "NewName" # dry run: list every change
python3 .github/scripts/rename_app.py "NewName" --apply # make the changes
python3 .github/scripts/rename_app.py "NewName" --apply --initials NN # pick favicon letters

Run it on the rename branch right after merging the latest master into it, so it
catches every place the name appears at that point (the redesign stack adds many).

Changes:
- "FinLens" -> NewName (titles, header, footer, Settings, README, docs, messages)
- "FINLENS" -> NEWNAME (file header comments)
- the "FL" initials in the favicon -> the new name's initials

Never changes (on purpose):
- lowercase "finlens": what's left is the GitHub repo name in URLs (gitluis/finlens)
and the old eval kind the app still accepts (published AI Eval results,
"finlens-ai-eval"). Storage itself has generic names since
v2.0.2 (app_db, app_fs, app_ keys, app-state.json), so a rename never
touches people's data.
- CHANGELOG history (only a new entry is added, by hand), published eval results
(docs/EVAL.md, docs/eval-results.json, docs/eval-runs/) and docs/archive/ —
past history stays as is.
- The GitHub repo name and URLs (rename the repo in Settings; GitHub redirects
old links).
"""
import pathlib, re, subprocess, sys

if len(sys.argv) < 2 or sys.argv[1].startswith("-"):
sys.exit(__doc__)
new = sys.argv[1].strip()
apply = "--apply" in sys.argv[2:]
if not re.fullmatch(r"[A-Za-z][A-Za-z0-9 ]{1,30}", new):
sys.exit("The new name must be 2-31 letters, digits or spaces, starting with a letter.")
# Favicon initials: the capitals of the name ("FinLens" -> "FL", "Tally House" -> "TH"),
# else its first letter ("Cuadre" -> "C"). Override with --initials XY.
caps = re.findall(r"[A-Z]", new)
initials = ("".join(caps[:2]) if len(caps) >= 2 else new[0].upper())
if "--initials" in sys.argv:
initials = sys.argv[sys.argv.index("--initials") + 1][:2]

root = pathlib.Path(__file__).resolve().parents[2]
SKIP_FILES = {"CHANGELOG.md", "docs/EVAL.md", "docs/eval-results.json",
".github/scripts/rename_app.py", ".github/bank-names.txt"}
SKIP_PREFIXES = ("docs/eval-runs/", "docs/archive/")
RULES = [
(re.compile(r"FinLens"), new),
(re.compile(r"FINLENS"), new.upper()),
]

files = subprocess.run(["git", "ls-files"], cwd=root, capture_output=True, text=True, check=True).stdout.split()
changed_files, changes, kept = 0, 0, 0
for rel in files:
if rel in SKIP_FILES or rel.startswith(SKIP_PREFIXES):
continue
path = root / rel
try:
text = path.read_text(encoding="utf-8")
except UnicodeDecodeError:
continue
kept += len(re.findall(r"finlens", text))
out_lines, n_file = [], 0
for i, line in enumerate(text.split("\n"), 1):
new_line = line
for rx, rep in RULES:
new_line = rx.sub(rep, new_line)
if rel == "index.html" and 'rel="icon"' in new_line:
new_line = new_line.replace(">FL</text>", f">{initials}</text>")
if new_line != line:
n = sum(len(rx.findall(line)) for rx, _ in RULES) or 1
n_file += n
if not apply:
print(f"{rel}:{i}: {line.strip()[:110]}")
out_lines.append(new_line)
if n_file:
changed_files += 1
changes += n_file
if apply:
path.write_text("\n".join(out_lines), encoding="utf-8")

mode = "Changed" if apply else "Would change"
print(f"\n{mode} {changes} occurrences in {changed_files} files (favicon initials: {initials}).")
print(f"Left as is: {kept} lowercase 'finlens' (repo URLs, the old eval kind still accepted).")
if not apply:
print("Dry run only. Add --apply to make the changes.")
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Financial data — never commit real transaction exports or backups
data/
finlens-data.json
# State backup (all transactions + settings), plus copies archived by "Start over" —
# ignored wherever the CSV folder lives
finlens-state.json
finlens-state-backup-*.json
# Settings exports and saved AI analyses
finlens-export-*.json
finlens-analysis-*.md
app-state.json
app-state-*.json
app-state-backup-*.json
# Settings exports and saved AI analyses / history
app-export-*.json
ai-analysis-*.md
ai-history-*.md

# macOS
.DS_Store
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

---

## [2.0.2] — 2026-11-04

### Changed — Storage names (start fresh after updating)
- **Everything FinLens stores now has a generic name, not the app's,** so renaming the app never touches anyone's data:

| What | Up to v1.18.x | Now |
|---|---|---|
| IndexedDB (all data) | `finlens_db` | `app_db` |
| IndexedDB (connected folder) | `finlens_fs` | `app_fs` |
| localStorage keys | `finlens_*` | `app_*` |
| Backup file in your folder | `finlens-state.json` | `app-state.json` |
| Start over's backup copy | `finlens-state-backup-*.json` | `app-state-backup-*.json` |
| JSON export | `finlens-export-*.json` | `app-export-*.json` |
| Saved AI answer / history | `finlens-analysis-*.md`, `finlens-ai-history-*.md` | `ai-analysis-*.md`, `ai-history-*.md` |
| AI Eval results (`kind`) | `finlens-ai-eval` | `ai-eval-results` (old files still load) |

- **Names only: nothing is copied from the old names** (decided 2026-11-04). After updating, FinLens opens empty. **Before updating, export JSON** (Settings → Data & reset). After: connect your folder or import your CSVs, then import that JSON. The old copies stay in the browser and folder until you remove them (browser site data; delete the old `finlens-state.json`).
- **`.gitignore`** lists the new file names instead of the old ones. `data/` is still ignored as a whole; an old `finlens-state.json` or export kept anywhere else in the repo folder no longer is, so delete those (they hold your data, so don't leave them in the repo).
- **CLAUDE.md §20:** the storage names and the old ones.

### Technical — Rename
- **Rename script** (`.github/scripts/rename_app.py`) for the name people see, once the new name is chosen: `python3 .github/scripts/rename_app.py "NewName"` lists every change (dry run), `--apply` makes them. It renames "FinLens" / "FINLENS" in titles, the app bar, the footer, Settings, messages, the README and current docs, and favicon letters if there are any. History stays as written: older CHANGELOG entries, published eval results, `docs/archive/`. The AI request doesn't contain the name, so a rename needs no eval re-run.
- **Stacked on #51** (merged in), so the script and the storage names work on the redesigned code.
- Part of the **v2.0 — Public launch** milestone. Left open on purpose until the name and domain are chosen; merge it before the GitHub Pages deploy.

---

## [1.18.1] — 2026-11-02

### Docs
Expand Down
Loading