Skip to content

Hunk Separator Polish#497

Merged
amadeus merged 6 commits intomainfrom
amadeus/custom-hunk-doc-fixes
Apr 12, 2026
Merged

Hunk Separator Polish#497
amadeus merged 6 commits intomainfrom
amadeus/custom-hunk-doc-fixes

Conversation

@amadeus
Copy link
Copy Markdown
Member

@amadeus amadeus commented Apr 12, 2026

This updates the docs and examples to better reflect our intentions around custom hunk separators.

Mostly deprecating the raw custom hunk api, remove old broken docs, and help explain how a custom css variant is the preferred way to go, with both visual and code examples.

  • Fixed the expand-all button to be a div (to match it's other siblings, whoops)
  • Also fixed a bug with non-worker File/Diffs on hydration not updating on their first JS based render

amadeus added 4 commits April 11, 2026 17:30
* Make the button a matching div
* Tweak capitalization to make it more flexible
* Add role: 'button'
* Basically the next render would be often broken...
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Apr 12, 2026 2:33am
pierrejs-docs Ready Ready Preview Apr 12, 2026 2:33am

Request Review

@amadeus
Copy link
Copy Markdown
Member Author

amadeus commented Apr 12, 2026

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f78a30c9b7

ℹ️ 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".

Comment on lines +383 to +385
if (this.diff != null) {
this.computedLang =
this.diff?.lang ?? getFiletypeFromFileName(this.diff.name);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep highlighter init tied to the requested diff language

initializeHighlighter() now overwrites this.computedLang from this.diff, which can still point to the previously rendered diff when renderDiff() kicks off asyncHighlight(diff) for a new file/language. In that flow, the wrong language gets loaded into the shared highlighter, and the subsequent highlight pass for the new diff can fail (or stay plain-text) when that language was not already attached. This is a functional regression in non-worker rendering when switching across file types.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in the next commit

@amadeus
Copy link
Copy Markdown
Member Author

amadeus commented Apr 12, 2026

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

@amadeus amadeus merged commit 4488824 into main Apr 12, 2026
10 checks passed
@amadeus amadeus deleted the amadeus/custom-hunk-doc-fixes branch April 12, 2026 02:38
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.

1 participant