Skip to content

Fix: timeline diff for a file's last checkpoint always showed no changes - #1

Open
Sil-Boydens wants to merge 2 commits into
panfotis:mainfrom
Sil-Boydens:main
Open

Fix: timeline diff for a file's last checkpoint always showed no changes#1
Sil-Boydens wants to merge 2 commits into
panfotis:mainfrom
Sil-Boydens:main

Conversation

@Sil-Boydens

Copy link
Copy Markdown

Summary

Each backup snapshot reflects the post-edit state as of that checkpoint (it's identical to the live file right after that edit). For a file's last checkpoint in a session there's no "next" backup to diff against, so the existing fallback compared that checkpoint's own backup to the current file — which are always identical by construction. This hid the checkpoint entirely, and if opened anyway, showed an empty diff.

Fix

When a checkpoint has no next backup, diff against the previous version's backup (hash@v(version-1)) instead — that's the actual pre-edit state for that checkpoint. Applied in both:

  • checkpointWebviewProvider.ts (_hasTimelineDiff, decides whether the checkpoint is shown at all)
  • extension.ts (viewDiffData, the actual diff view opened on click)

Test plan

  • npm run compile passes with no type errors
  • Verified against a real session: compared each affected file's previous backup vs. current file content directly, confirming a real diff exists where the extension was previously reporting none
  • Maintainer: reload the extension and confirm checkpoints for a file's last edit in a session now show up and diff correctly

This change (investigation, fix, and above PR description) was written by Claude (Anthropic). i'm not good in TypeScript or javascript but i did test the changes that were made and verified this as working.

Each backup snapshot reflects the post-edit state as of that checkpoint
(it's identical to the live file right after that edit), so a file's
last checkpoint in a session has no "next" backup to diff against. The
existing fallback compared that checkpoint's own backup to the current
file, which are always identical by construction - hiding the checkpoint
entirely and, if clicked anyway, showing an empty diff.

Fix: for a checkpoint with no next backup, diff against the PREVIOUS
version's backup instead (hash@v(version-1)), which is the actual
pre-edit state for that checkpoint. Applied in both the visibility
check (checkpointWebviewProvider.ts) and the diff viewer (extension.ts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant