Repository navigation
Add opt-in line wrapping to both diff layouts - #609
Merged
Merged
Conversation
Keep the existing markup and templates for unwrapped diffs. Add a line-by-line wrapping modifier and emit each prepared side-by-side pair into one table row, so the taller side determines row height. Expose the option in the demo and preserve it across redraws. The paired rows build on Mohana Priya's design in #589, with #563 as prior art. Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>
Use one generation-guarded request per demo redraw. Scope wrap rules to the owning table and isolate nested diff widgets. Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>
Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>
Deploying diff2html with
|
| Latest commit: |
b2505fa
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://04fb5013.diff2html.pages.dev |
| Branch Preview URL: | https://rodrigo-opt-in-line-wrapping.diff2html.pages.dev |
Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>
rtfpessoa
marked this pull request as ready for review
November 28, 2026 16:42
This was referenced Nov 28, 2026
Closed
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.
Motivation
Long diff lines can force horizontal scrolling, and independently wrapping two side-by-side tables lets the rows drift out of alignment. Add
wrapLines: truein both existing formats without changing the default output. The paired-row design builds on Mohana Priya's work in #589; #563 is prior art.How it works
wrapLinesdefaults tofalse. Line-by-line adds a scoped CSS marker when enabled. Side-by-side reuses prepared line pairs and writes both sides into one row, so the next pair starts below the taller side.?wrapLines=true. Only the latest request may update the preview. Wrapping styles stay inside their own diff, including when a custom info message contains another diff.Verification
Review focus
Check the paired table and CSS scoping: the opt-in DOM differs, and selection may span both columns. Custom line-by-line templates need the wrapping marker to opt in. No new layout, CLI flag, dependency, or JavaScript row sizing. Other browser engines, assistive technology, and live clipboard behavior were not verified.