Skip to content

feat(webui): highlight file previews and diffs - #4877

Merged
Re-bin merged 2 commits into
mainfrom
codex/webui-code-highlighting
Jul 10, 2026
Merged

Re-bin merged 2 commits into
mainfrom
codex/webui-code-highlighting

Conversation

@chengyongru

Copy link
Copy Markdown
Collaborator

Summary

  • add lazy Prism syntax highlighting to unified file diffs while preserving line numbers and add/delete backgrounds
  • normalize backend language aliases and infer diff languages from file paths
  • explicitly enable highlighting in file previews and add unit plus real-Prism integration coverage

Testing

  • npm run lint
  • npm run test -- --run (33 files, 476 tests)
  • npm run build

Notes

  • reuses the existing react-syntax-highlighter dependency; no package or lockfile changes

@chengyongru chengyongru added priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. feature webui test labels Jul 10, 2026
@chengyongru
chengyongru marked this pull request as draft July 10, 2026 14:51
@chengyongru
chengyongru marked this pull request as ready for review July 10, 2026 15:48
@chengyongru

Copy link
Copy Markdown
Collaborator Author
diff-light file-preview-light

@Re-bin Re-bin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This adds syntax highlighting at the WebUI rendering edge without changing backend or transcript contracts, while preserving diff line numbers and add/delete semantics.

The language normalization, real Prism rendering, and chunk-boundary behavior are covered. Validated on the current main with 24 focused tests and a production WebUI build.

@Re-bin
Re-bin merged commit 137fbf8 into main Jul 10, 2026
5 checks passed
@Re-bin
Re-bin deleted the codex/webui-code-highlighting branch July 10, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. test valid webui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants