Skip to content

Add git history viewer with markdown diff #99

@lambdalisue

Description

@lambdalisue

Summary

View previous versions of a file from git history and compare any two versions side by side, similar to GitHub's Markdown diff viewer.

Motivation

When working with versioned Markdown files, users often need to see how a document has evolved — what was added, removed, or reworded. Currently this requires switching to a terminal or GitHub web UI. An integrated git history viewer with visual diff would keep users in their flow.

Proposed Behavior

History Browser

  • View the git log for the current file
  • Select any commit to view that version of the file (rendered or source)
  • Show commit metadata (author, date, message)

Diff Viewer

  • Compare any two versions of a file (e.g. current vs. a past commit, or two arbitrary commits)
  • Side-by-side or unified diff view
  • Markdown-aware rendering: show diffs on the rendered output (like GitHub's rich diff), not just raw text
  • Highlight added / removed / changed sections with color coding

Technical Considerations

  • Use git log --follow to track file renames
  • Use git show <commit>:<path> to retrieve historical content
  • Diff algorithm: operate on rendered Markdown (HTML diff) or source lines, or both
  • Performance: lazy-load commit list for files with long history
  • UI: could reuse the tab system to open historical versions as read-only tabs

Metadata

Metadata

Assignees

No one assigned

    Labels

    maybe onedayI'm not sure if this should be included or too lazy to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions