Skip to content

Feature Request & Bug Fixes: Binary file support, raw/rendered toggle, and rendering performance #43

Description

@raheemuddin786

I'd like to propose a few enhancements and fixes to the version history diff views:

  1. Binary file support: Currently, attempting to diff binary files (like images) doesn't render them visually. It would be great to have side-by-side previews for images and basic metadata fallbacks for other binary types.
  2. View toggle: Add a toggle bar to switch between the rendered markdown view and the raw diff view.
  3. Performance optimizations: Large files can freeze the UI when calculating diffs. We can resolve this by:
    • Deferring the heavy synchronous computation using setTimeout to yield to the browser's paint cycle.
    • Setting matching: 'none' in diff2html config to avoid expensive line matching algorithms on large diffs.
    • Disabling drawFileList in the config to hide the redundant file header.

I already have these changes fully implemented, tested, and ready to submit in a PR. Let me know if it's okay to open the PR for this!

Attached the reference output images:

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions