Repository navigation
Conversation
- Sidebar status for finlens-state.json: Saving…, Saved h:mm, Backups paused (Reconnect), Backup failed (Retry), Backups off. - beforeunload flushes a waiting save and asks the browser to confirm while a save is waiting or running and the folder is writable. - Tab hidden flushes a waiting save immediately. - Save delay 5 s -> 1.5 s; a manual save cancels a waiting one. - CLAUDE.md §4.5/§8, README, Import tab text, CHANGELOG, version v1.17.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBYnr2QiFrzchNxfCti
…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
Rebuilds PR #23 on the Clarity app bar. #23 put a backup status line in the old sidebar, which the redesign removed; this folds it into the sync badge and keeps Luis's resting wording. - Badge: "Synced" (tooltip "Saved at 10:42 AM to finlens-state.json in ..."), "Saving..." while a save waits or runs (neutral pill, pulsing dot, same width as Synced), "Not synced" for no folder, access lapsed or a failed save. The tooltip gives the cause; the click opens Settings -> Import, reconnects, or retries the save (syncRetryClick). syncBadgeState() picks label, tooltip, accessible name and action in one place. - Accessibility: the button's name starts with the label and ends with its action; a polite status region (#syncStatus) announces only when backups stop or come back, never "Saving...". - Saves wait 1.5 s instead of 5 s (SAVE_DELAY_MS); a manual save cancels a waiting one; tab hidden flushes a waiting save. - beforeunload: attached only while a save is waiting or running and the folder is connected and writable; flushes and asks the browser to confirm. The listener stays attached until the prompt is answered, since removing it during the event cancels the prompt. - Start over (State._resetInProgress) cancels a waiting save and writes nothing. _folderNeedsAccess, the Reconnect banner, _lastSaveError and the permission checks are unchanged. #23's _noBackupFolder/hasBackupFolder() are replaced by the redesign's State._folderLinked. - Import tab: "1.5 seconds after a change". README, CLAUDE.md (§1, §4.5, §6, §8, §9, §12, §14, Last updated), CHANGELOG; version v1.18.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Owner
Author
|
Rebuilt on the Clarity redesign.
🤖 Generated with Claude Code https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft Generated by Claude Code |
…s-indicator Brings in the second fix chain through #10. Version stays v1.18.0; CHANGELOG runs 1.18.0, 1.17.0, 1.16.27 ... (merged without conflict). Conflicts (CLAUDE.md only): - Section 14, prompting code: this branch's sync badge line, with the tab name the chain corrected ("Data & reset"). - Last updated: this branch's note, then #10's from v1.17.0 with the chain's history from v1.16.27. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
This was referenced Nov 2, 2026
Open
Open
Open
v1.16.2: Fix Rebuild from your folder clearing everything when the folder has no CSV it can read
#25
Open
Open
This was referenced Nov 2, 2026
…ve-status-indicator 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
This was referenced Nov 4, 2026
Open
Owner
Author
|
Dark theme taken out of the stack (Luis, 2026-11-04). #17 is light only for now: no ◐ toggle, no Light / Dark / Match system setting, no dark tokens. It comes back later in its own PR. #17's change was merged forward into this branch (no force push).
🤖 Generated with Claude Code https://claude.ai/code/session_013Z8iBUZo6LRYpLthSp2PRi Generated by Claude Code |
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The app bar's sync badge now says whether
finlens-state.jsonis up to date, and FinLens stops the backup from falling behind when you leave right after a change. This is #23 rebuilt on the Clarity redesign. The original put a status line in the old sidebar, which the redesign removed.What changed
Kept from the original #23
_saveStateDebounced(),SAVE_DELAY_MS= 1500,State._savePending,State._saving),flushPendingSave(),backupWouldBeLost(), and thevisibilitychangeflush, injs/core.js.Changed for the app bar
syncBadgeState()(views-data.js) gives each state its label, tooltip, accessible name and action;updateSyncBadge()draws it andsyncBadgeClick()runs it. Before this PR the badge's click for a failed save only opened Settings; now it retries (syncRetryClick()). Reconnect and Retry run from the click, as §14 requires.--muted,--text-2) with a slowly pulsing dot (steady with reduced motion), and a min-width makes Synced and Saving… the same width.role="status"region (#syncStatus) announces when backups stop or come back. It never announces Saving…, or Synced after an ordinary save._syncLeaveGuard()). v1.18.0: Backup status in the sync badge; save before leaving #23 kept one attached all the time and checked inside it. An always-onbeforeunloadlistener can keep the page out of the back/forward cache.State._folderLinked(a stored handle). v1.18.0: Backup status in the sync badge; save before leaving #23'sState._noBackupFolderandhasBackupFolder()did the same job and are dropped.beforeunloadevent (a fast write completes in its microtasks), removing the listener then cancels Chromium's prompt._leaveGuardHoldkeeps it until the prompt closes. The original v1.18.0: Backup status in the sync badge; save before leaving #23 didn't hit this, because its listener was never removed.State._resetInProgressnow also cancels a waiting save, so nothing is scheduled or written during the reset.State._folderNeedsAccess, the Reconnect banner,State._lastSaveError, the folder-permission checks.--sidebar-badtoken (no sidebar any more); v1.18.0: Backup status in the sync badge; save before leaving #23's[1.17.0]CHANGELOG entry and version strings (v1.17.0: Settings → Database tab (DB Inspector, DB Schema), rebuilt on the Clarity redesign #10 is v1.17.0).Files:
js/core.js,js/views-data.js,index.html(badge style, live region, footer),README.md,CLAUDE.md(§1, §4.5, §6, §8, §9, §12, §14, Last updated),CHANGELOG.md,js/views-settings.js. Version v1.18.0.Merge:
settings-database-tabwas merged into this branch first. All seven files #23 touched conflicted; each was resolved by taking the redesign's version, and the feature was rebuilt in the next commit.Not verified
inert. Saves run 1.5 s after a drawer closes, so this only happens when a save finishes or fails while a drawer is open; the badge still shows it.Automated checks: earlier run, not re-run · 60c9c7c
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), samples only, at 1280px, in light and dark. CDNs are served from npm (the SRI hashes still verify).
All on
60c9c7c, one suite at a time:That's 1,512 checks. The same suites (without test-save-status) passed 1,448/1,448 on the merge commit before the rebuild.
New suite
test-save-status.js(64 checks). It uses a fake folder handle installed in front ofinit.js, astest-clear-edits.jsdoes, with switches for a lapsed permission, a write that throws and a write held open. It covers #23's own checks and:getByRole('button', { name })) and click;beforeunloadlistener attached only while a save is pending (counted with CDPDOMDebugger.getEventListeners);requestPermission()ran with user activation); a failing Retry is announced again; a Retry refused at the prompt moves to Reconnect;http://with saves in flight and onfile://, with no errors.Existing checks changed in my copy: two suites, for reasons this PR changes on purpose:
updateSyncBadge()about 0.3 s after a theme change. That change's real save is still waiting then, so the badge now rightly says "Saving…". And at 1.5 s (5 s before) the save runs during the sequence, finds no folder and resets_folderLinked. Fix: wait for!State._savePending && !State._savingbefore faking. No assertion changed.[1.18.0],[1.17.0], 1.16.15 … 1.16.0.Screenshots of the badge in every state, light and dark, were reviewed (Synced, Saving…, and Not synced for no folder, access lapsed and a failed save). Synced and Saving… are the same width; text is clear in every state. Measured contrast: 6.4–6.9:1 light, 7.3–10.9:1 dark.
Manual QA steps
Setup
git checkout save-status-indicator.samples/into a new scratch folder, e.g.C:\temp\finlens-23. This PR is about savingfinlens-state.json, so never use your real folder.index.htmlin Edge. Keep F12 → Console open for the whole run: each write logs[FinLens] Auto-saved state to finlens-state.json.The badge is the pill at the right of the app bar, left of the date-range button. Hover over it to see its tooltip.
1. No folder: Not synced, and the click opens Import
Expected:
2. Connect the folder: Synced, with the save time
Expected:
finlens-state.jsonnow exists in the scratch folder.3. A change shows Saving… for about 1.5 s, then Synced
Expected:
Auto-saved state to finlens-state.jsonfor the burst, not three.Before this PR: the badge stayed Synced during the 5-second wait, with no sign a save was pending.
4. Leaving right after a change asks "Leave site?" and writes the save
LEAVE TEST, click Save changes.LEAVE TEST 2, and this time click Reload (or Leave).finlens-state.jsonin a text editor and search forLEAVE TEST 2.Expected:
LEAVE TEST 2.5. Switching tabs writes a waiting save at once
Expected:
Auto-saved state to finlens-state.jsonlogged at the moment you switched, not 1.5 s later. The badge reads Synced when you return.6. Folder access lapsed: Not synced, the click reconnects, no leave prompt
index.htmlagain in a new tab.Expected:
7. A failed save: Not synced, the click retries
finlens-23-x).finlens-23.Expected:
Failed to save state to file.If renaming the folder doesn't make the save fail on your machine, note it: I couldn't confirm from the code which error Edge gives for a moved folder.
8. Regression: Save now, Start over, and the screen-reader text
aria-label.RESET, click Erase and start over.Expected:
aria-labelstarts with the visible text, e.g. "Synced, saved at 10:42 AM. Open Import settings".finlens-state.jsonis not re-created in the folder (you'll see only the backup copy if you chose Keep a copy).Please check before merging
masterif GitHub doesn't.https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Generated by Claude Code