Skip to content

[diffs] CodeView: Custom header / footer support#926

Merged
amadeus merged 13 commits into
beta-1.3from
amadeus/codeview-header-footer
Jul 3, 2026
Merged

[diffs] CodeView: Custom header / footer support#926
amadeus merged 13 commits into
beta-1.3from
amadeus/codeview-header-footer

Conversation

@amadeus

@amadeus amadeus commented Jul 1, 2026

Copy link
Copy Markdown
Member

Add support for custom rendered header/footer content sections in CodeView

I figured out an API that shouldn't really depend on knowing how tall things are, the elements are intentionally not virtualized and should automatically be tracked by ResizeObservers.

I went for an implementation that would the lightest weight to start with to get a sense of how useful the API might be for people.

An example of it working in DiffsHub (although I don't think we'll ship this):

Header Example:

CleanShot 2026-07-01 at 14 39 36

Footer Example:

CleanShot 2026-07-01 at 14 41 01

Fixes #894

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jul 3, 2026 7:27pm
pierre-docs-diffshub Ready Ready Preview Jul 3, 2026 7:27pm
pierre-docs-trees Ready Ready Preview Jul 3, 2026 7:27pm
pierrejs-diff-demo Ready Ready Preview Jul 3, 2026 7:27pm

Request Review

@amadeus

amadeus commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

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

Copy link
Copy Markdown

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: 5c05390ae4

ℹ️ 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 thread packages/diffs/src/components/CodeView.ts
@amadeus

amadeus commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: c6b154ca27

ℹ️ 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 commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

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

Copy link
Copy Markdown

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: 49c0af4cb5

ℹ️ 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 thread packages/diffs/src/react/CodeView.tsx
amadeus added 13 commits July 3, 2026 12:25
* DOM reconcilation stuff
* Various math-ing stuff
* Lots of verbose comments by claude
Cleaned up some slop from earlier on the initial measure, but then also
added the ResizeObserver stuff
Took a bit of back and forth from the robot to get on the right solution
that worked within the same confines of before.
* Prevent scroll fixing if scrolled to the top and a header component is
  added lazily
* Scroll to should take the header into account
Dunno why, i just prefer that...
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