Skip to content

Conversation

@petermiller310
Copy link
Contributor

@petermiller310 petermiller310 commented Jan 25, 2026

Motivation

  • The diff viewer currently treats all files as text, showing unreadable binary content or "Diff unavailable" for image files
  • Users need to visually compare image changes (icons, assets, screenshots) without leaving the app
  • MCP tools can generate and manipulate image assets during Codex sessions—being able to preview these changes directly in Codex Monitor makes it easier to review AI-generated visual content

Description

  • Added image_mime_type() helper in Rust to detect image files by extension and provide MIME types (png, jpg, jpeg, gif, webp, svg, bmp, ico)
  • Extended GitFileDiff with is_binary, is_image, old_image_data, new_image_data, plus old_image_mime/new_image_mime for correct per-side previews
  • Updated get_git_diffs() to load old/new image previews per-side, skip non-image sides, and enforce a 10MB cap to keep IPC responsive
  • Created ImageDiffCard React component with side-by-side before/after comparison
  • Added CSS styles for image diff layout with colored panes (red for old, green for new) and checkerboard background for transparency
  • Fixed useGitDiffs hook to pass through image metadata fields to the diff viewer

Testing

  • npm run lint passed
  • npm run test passed (180 tests)
  • npm run typecheck passed
  • cargo test passed (32 tests + daemon/tests)
  • Manually verified image diff preview works in dev mode
Screen.Recording.2026-01-25.at.9.14.33.AM.mov

@petermiller310 petermiller310 marked this pull request as draft January 25, 2026 15:47
@petermiller310 petermiller310 force-pushed the feat/image-diff-preview branch 2 times, most recently from 059b162 to 57c9e63 Compare January 25, 2026 16:03
@petermiller310 petermiller310 marked this pull request as ready for review January 25, 2026 16:13
@petermiller310 petermiller310 force-pushed the feat/image-diff-preview branch 2 times, most recently from 8e00954 to 7cc2908 Compare January 25, 2026 16:48
@Dimillian
Copy link
Owner

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@petermiller310 petermiller310 force-pushed the feat/image-diff-preview branch from 7cc2908 to 7a5f844 Compare January 25, 2026 17:18
@petermiller310
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@petermiller310
Copy link
Contributor Author

petermiller310 commented Jan 25, 2026

@codex review

heads up @Dimillian , I pushed a small change after original codex review ran

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@Dimillian
Copy link
Owner

@codex review

@Dimillian
Copy link
Owner

@codex review

heads up @Dimillian , I pushed a small change after original codex review ran

One more run then. FYI I'll do manual testing and small fixes if needed before merge tonight or tomorrow.

Thanks for the feature added to the diff viewer!

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian Dimillian merged commit 6d747b5 into Dimillian:main Jan 26, 2026
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.

2 participants