plan 0028: setup history records every edit, with a Used / All view and 3-day retention - #435
Merged
Merged
Conversation
Setup history only ever showed the states assigned to a session, because a
revision was frozen solely on assignment and the orphan sweep removed any
revision no session referenced. Plain edits left no trace.
- Freeze a content-addressed revision on every setup save (add + update in
useSetupManager); dedup makes an unchanged save a no-op.
- Narrow the orphan prune: a revision is swept only when no session references
it AND its live setup has been deleted, so a setup's edit history persists.
- buildSetupHistory gains a `view` filter ("used" default | "all"), an
`entry.used` marker that follows the kart/course filter, and used/total
counts. Diffs stay relative to the previous displayed entry.
- SetupHistoryPanel: Used / All segmented toggle with counts, a Used badge on
cards in the All view, and an empty-state hint pointing at All when only
unused edits exist. New keys in all seven drawer locales.
- Tests for the new prune rule and the view modes; docs, CHANGELOG, plan 0028.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014945fnvJ5WPFRCtTszkdnS
…agged revisions local Round one kept every unreferenced revision of a live setup forever, which is a lot of data on a hectic track weekend. Rein it in and lean on the sweeper: - Retention rule (findPrunableRevisionIds): an unreferenced revision is deleted once it is older than 3 days, unless it is the newest unreferenced revision of a still-existing setup. A dedup re-freeze bumps updatedAt so a re-save reads as fresh. Replaces the once-per-3-days localStorage throttle; the sweep (three reads) now runs on garage mount and whenever the history panel opens. - Untagged revisions never reach the cloud: new StoreAccessor.pushFilter seam, honoured by pushRecord and the reconcile push loop, admits only revisions a local session references. Assignment emits the revision put after the metadata write so the gate sees it; the tombstone clears only on an upload. - History panel sweeps before listing and, in the All view, shows a notice stating the retention rule (all seven drawer locales). - Tests for the retention rule, the updatedAt bump, the push gate (engine + accessor); docs, CHANGELOG, and plan 0028 updated to the final design. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014945fnvJ5WPFRCtTszkdnS
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lapwing | 1265a23 | Commit Preview URL Branch Preview URL |
Sep 11 2026, 02:43 AM |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Coverage SummaryLines: 60.6% (8455/13951) · Statements: 59.65% · Functions: 56.61% · Branches: 57.29% Per-file coverage
|
Reading a track day top-down means the latest change should be the first card. The view-model stays oldest-first (the diff chain depends on it); the panel reverses at render time, so the original sits at the bottom and each card above it diffs against the one below. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014945fnvJ5WPFRCtTszkdnS
13 tasks
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
Opening a setup's history only ever showed the states that had been assigned to a session. A revision was frozen solely on assignment, and the orphan sweep deleted anything no session referenced, so plain edits on a hectic track day left no trace.
This makes the history general, but bounded:
useSetupManager). Content hashing makes an unchanged save a no-op; a dedup re-freeze bumpsupdatedAtso "saved again today" reads as fresh.SetupHistoryFilter.view, defaultused, which matches the old behaviour). In All, revisions a session ran carry a Used badge. Theusedmarker follows the kart/course filter so the two views always agree, and diffs are against the previous displayed card.findPrunableRevisionIds). An untagged revision is deleted once it is older thanREVISION_RETENTION_MS, unless it is the newest untagged revision of a setup that still exists. A deleted setup's untagged revisions all age out. The sweep is three IndexedDB reads and runs on garage mount and whenever the history panel opens, so the panel always matches the notice it shows in the All view.StoreAccessor.pushFilterseam: the setup-revisions accessor admits only ids some localsessionSetupRevreferences, honoured by bothpushRecordand the reconcile push loop. Assignment emits the revisionputafter the metadata write so the gate sees the reference; the tombstone clears only on an actual upload.Design record with the rejected alternatives from both rounds:
docs/plans/0028-setup-history-view-modes.md.Related Issues
None.
Type of Change
Checklist
npm run lintpassesnpm run typecheckpassesnpm run test:runpassesnpm run buildsucceedsREADME.md,CLAUDE.md, Credits,CHANGELOG.md)datalogParser.ts, added tests, updated the formats tableNotes for Reviewers
updatedAtbump on dedup, the Used/All view model, and the push gate at both the engine and accessor level.setupHistory.*locale keys were translated by hand for es/fr/de/it/pt-BR/ja (the seeder needs an API key this environment doesn't have); the parity test passes.🤖 Generated with Claude Code
https://claude.ai/code/session_014945fnvJ5WPFRCtTszkdnS
Generated by Claude Code