plan 0028: roll back to, or duplicate, a session-linked setup revision - #439
Merged
Merged
Conversation
Once the newest revision is untagged scratch there was no way back. Both actions anchor to revisions a session ran: those are permanent (never swept) and already in the cloud, so the target can neither vanish mid-tap nor be missing on another device. - Roll back: one target only, the revision that most recently ran on a session (SetupHistory.latestReferencedId, ignoring kart/course filters), offered only when the live setup's current hash differs from it. Confirm dialog, then restoreSetupFromRevision writes the frozen values onto the live record (keeping id/vehicle/name) through the ordinary update path, which freezes and dedups back onto that hash. The scratch edits remain the newest untagged revision, so they survive the sweep. - Duplicate: on every revision that ran, duplicateSetupFromRevision creates a new setup named "<name> (copy)" carrying that revision's values. - HistoryCard gains an actions slot; the panel reloads and toasts after either action; SetupsTab re-derives the live setup while the panel is open and now keeps the full hash (shortened at display) for the drift check. - Tests for both pure helpers and the latest-run selection; docs, CHANGELOG, and plan 0028 round three. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014945fnvJ5WPFRCtTszkdnS
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Coverage SummaryLines: 60.63% (8467/13963) · Statements: 59.69% · Functions: 56.65% · Branches: 57.32% Per-file coverage
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lapwing | 14252c5 | Commit Preview URL Branch Preview URL |
Sep 11 2026, 03:38 AM |
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
Follow-up to #435. Once a setup's newest revision is untagged scratch from a track day, there was no way back. This adds two actions to setup-history cards, both anchored to revisions a session ran: those are permanent (never swept) and already in the cloud, so a target can neither vanish mid-tap nor be missing on another device. Untagged revisions get no buttons.
SetupHistory.latestReferencedId, by session start then capture time, ignoring the kart/course filters), and only while the live setup's current hash differs from it. A confirm dialog, thenrestoreSetupFromRevisionwrites the frozen values onto the live record (keeping id, vehicle, name, createdAt) through the ordinary update path, which freezes and dedups back onto that hash. The scratch edits remain the newest untagged revision, so they survive the sweep and the rollback is undoable by hand for three days.duplicateSetupFromRevisioncreates a new setup named " (copy)" on the revision's vehicle, carrying its values. A copy of identical content on the same setup is impossible under content addressing, so "a new, unlinked revision" necessarily means a new setup whose original revision is that content.HistoryCardgains anactionsslot; the panel reloads and toasts after either action.SetupsTabre-derives the live setup from the list while the panel is open, and now keeps each setup's full hash (shortened at display) so the panel can detect drift.Design notes and the rejected alternatives (tappable cards + popup, any-used-revision rollback) are in
docs/plans/0028-setup-history-view-modes.md, round three.Related Issues
Follows #435.
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
setupHistory.*locale keys were translated by hand; the parity test passes.🤖 Generated with Claude Code
https://claude.ai/code/session_014945fnvJ5WPFRCtTszkdnS
Generated by Claude Code