Skip to content

feat(github): color-code inline diffs on the pull request page - #359

Open
abdulwahabmonilola-ctrl wants to merge 1 commit into
AyinkxLab:mainfrom
abdulwahabmonilola-ctrl:feat/71-color-coded-inline-diff
Open

abdulwahabmonilola-ctrl wants to merge 1 commit into
AyinkxLab:mainfrom
abdulwahabmonilola-ctrl:feat/71-color-coded-inline-diff

Conversation

@abdulwahabmonilola-ctrl

Copy link
Copy Markdown

Closes #71

What

The pull request detail page rendered each file patch as a monochrome escaped <pre>, while the commit page already used GitHub.renderPatch.

Changes

  • app/static/js/github_pull.js - route each file's patch through GH.renderPatch(file.patch), which classifies added (+) lines, removed (-) lines, hunk headers (@@), file metadata, and context lines, and HTML-escapes every line.

Acceptance criteria

  • Lines starting with + render in the added style (green via .diff-added).
  • Lines starting with - render in the removed style (red via .diff-removed).
  • Context lines stay neutral (.diff-line only).
  • Long files keep the existing truncation limit (unchanged; renderPatch only classifies the patch it is given).

Validation

  • pytest tests/test_github_diff_highlighting.py -> 5 passed (evaluates renderPatch under Node with a DOM shim, plus wiring/CSS checks).
  • ruff check and black --check clean on the changed test file.

@abdulwahabmonilola-ctrl
abdulwahabmonilola-ctrl force-pushed the feat/71-color-coded-inline-diff branch from 5c88cc0 to 9be7a2b Compare October 4, 2026 08:17
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.

Add color-coded inline diff highlighting

2 participants