Skip to content

feat(core): show parent function/class context in diff hunk headers#594

Draft
remorses wants to merge 8 commits intoanomalyco:mainfrom
remorses:contextual-lines
Draft

feat(core): show parent function/class context in diff hunk headers#594
remorses wants to merge 8 commits intoanomalyco:mainfrom
remorses:contextual-lines

Conversation

@remorses
Copy link
Contributor

@remorses remorses commented Jan 27, 2026

Parses the context text after @@ in unified diff hunk headers (e.g. @@ -10,5 +10,7 @@ function setup()) and renders it as a separator row between hunks. The @ sign appears in the gutter column alongside +/-, and the function/class name appears in the content area with the same background as context lines.

  • Parse @@ context text from raw diff string and attach to each hunk
  • Render hunk header rows only when context text is present (no empty @@ rows)
  • Show @ in the gutter sign column, context text in content area
  • Use same background colors as context lines for seamless blending
  • Add hunkHeaderFg option for the @ sign color
  • Add diff demo example with contextual headers
  • Add tests with inline snapshots for unified and split views

Closes #587

Screenshot 2026-01-27 at 13 16 49 Screenshot 2026-01-27 at 13 17 10

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 27, 2026

@opentui/core

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core@594

@opentui/react

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/react@594

@opentui/solid

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/solid@594

@opentui/core-darwin-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-arm64@594

@opentui/core-darwin-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-x64@594

@opentui/core-linux-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-arm64@594

@opentui/core-linux-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-x64@594

@opentui/core-win32-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-arm64@594

@opentui/core-win32-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-x64@594

commit: b05d420

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.

feat: Show parent function/class context in diff hunk headers

1 participant