Files
ai-agent/backend/gitdiff.py
Gabriel Vidal 377807933f feat(ai-agent): image viewer + syntax highlighting in the diff view
The full-screen diff view (/diff/*) now renders image files as before/after
bitmaps that open in the design-system media viewer instead of the flat
"Binary file — no text diff." note, and text files get Prism grammar colouring
per diff line (add/del/context row shading and gutters preserved).

- backend: GET /api/diff-blob serves the raw bytes of a file inside a diff —
  at a commit's rev for a single-commit diff, or the working-tree copy for
  conversation/uncommitted diffs (path-traversal guarded, 12 MB cap).
- frontend: new DiffContent.tsx with DiffImage (viewer) + DiffCode (highlighted
  hunks via prism-react-renderer, one Highlight per hunk mapped 1:1 to lines);
  DiffView delegates to them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 04:57:20 +02:00

19 KiB