Skip to content

Consider using a React component instead of diff2html for patch preview - #6883

Open
goldpanth3r wants to merge 1 commit into
mozilla:masterfrom
goldpanth3r:fix-6868-Consider-using-a-React-component-instead-of-diff2html-for-patch-preview
Open

goldpanth3r wants to merge 1 commit into
mozilla:masterfrom
goldpanth3r:fix-6868-Consider-using-a-React-component-instead-of-diff2html-for-patch-preview

Conversation

@goldpanth3r

Copy link
Copy Markdown
Contributor

Fixes #6868
Replaced diff2html's dangerouslySetInnerHTML-based rendering in PatchView with react-diff-view, which renders the diff as real React elements instead of an injected HTML string.

  • parseDiff/Diff/Hunk replace diff2html's parse/html
  • Per-file headers shown when a patch touches more than one file
    (replacing diff2html's drawFileList option)
  • Dark styling for the diff, matching the app's existing color tokens
    (--green/--red at the same opacity used by .badge.succeeded/.failed),
    added in globals.css
    (replacing diff2html's colorScheme: ColorSchemeType.DARK)

@goldpanth3r
goldpanth3r requested a review from a team as a code owner September 20, 2026 08:04
@goldpanth3r
goldpanth3r force-pushed the fix-6868-Consider-using-a-React-component-instead-of-diff2html-for-patch-preview branch from a75d708 to 2175760 Compare September 21, 2026 06:12
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.

Consider using a React component instead of diff2html for patch preview

1 participant