Repository navigation
fix: count repeated lines in the content diff preview - #31
Open
Abhishek-B-R wants to merge 1 commit into
Open
Abhishek-B-R wants to merge 1 commit into
Abhishek-B-R wants to merge 1 commit into
Conversation
diffPreview compared the two snapshots as sets of lines, so adding a second copy of a line that already existed, or removing one of two identical lines, changed the page hash and raised a PAGE_CONTENT alert whose preview was empty with 0 added and 0 removed. The AI triage and summary saw no diff at all for the same reason. Compare the lines as a multiset instead.
Author
|
@YahiaBakour friendly bump: this makes |
Author
|
@YahiaBakour following up once: the branch has no conflicts with main and the only thing outstanding is a review. The change is limited to diffPreview (occurrence counts instead of a Set), with tests for both the added-duplicate and removed-duplicate cases. Happy to adjust if you'd prefer a different approach. |
This branch has not been deployed
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.
diffPreview compared snapshots as sets of lines. The change check is a hash of the whole page, so when a page only gains a second copy of an existing line (or loses one of two identical lines) the alert still fires, but its preview is empty with 0 added / 0 removed, and triage and the AI summary get "no line-level diff available".
This counts occurrences instead of using a Set. Output is the same for everything that worked before.
Added src/lib/diff-preview.test.ts. The two duplicate cases fail on main and pass here. npm test, typecheck and lint are clean.