Skip to content

fix: preserve real line numbers for Claude edit scenes - #27

Merged
TanbirRamim merged 1 commit into
TanbirRamim:mainfrom
Niranjan7407:fix/claude-real-line-numbers
Oct 27, 2026
Merged

TanbirRamim merged 1 commit into
TanbirRamim:mainfrom
Niranjan7407:fix/claude-real-line-numbers

Conversation

@Niranjan7407

Copy link
Copy Markdown
Contributor

Closes #1

What changed

  • Preserve the first valid structuredPatch hunk's oldStart from Claude Code Edit/MultiEdit results as an optional startLine on edit events.
  • Start the HTML player's edit-diff gutter at that offset so edits deeper in a file show meaningful line numbers.
  • Keep the existing line-1 fallback for logs without a structured patch, including older Claude logs and Codex/Gemini sessions.
  • Add a synthetic parser regression test for oldStart: 120 and a legacy result without structuredPatch.

How I tested it

  • npm run build
  • npm test
  • Render a synthetic Claude fixture and verify the edit gutter starts at the expected line.
  • No real session transcripts included.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@TanbirRamim
TanbirRamim merged commit be38f39 into TanbirRamim:main Oct 27, 2026
@TanbirRamim

Copy link
Copy Markdown
Owner

Merged, thanks @Niranjan7407! Really nice first fix, with a test and the legacy fallback. One thing I found while testing: oldStart is the first line of the hunk including the 3 context lines, so the numbers came out a bit early. I follow up in #28 by finding oldString in originalFile instead. If you like vibereel, a star helps others find it.

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.

Show real line numbers in edit scenes using structuredPatch

3 participants