Skip to content

fix(diff): reprocess htmx content after loading more files (#36568)#36577

Merged
wxiaoguang merged 4 commits into
go-gitea:release/v1.25from
tyroneyeh:backport-36568-v1.25
Feb 10, 2026
Merged

fix(diff): reprocess htmx content after loading more files (#36568)#36577
wxiaoguang merged 4 commits into
go-gitea:release/v1.25from
tyroneyeh:backport-36568-v1.25

Conversation

@tyroneyeh
Copy link
Copy Markdown
Contributor

@tyroneyeh tyroneyeh commented Feb 10, 2026

The "Show more files" button replaces #diff-incomplete with newly loaded diff file boxes.
The inserted HTML may contain htmx attributes, but they are not processed after insertion.
Wrap the incomplete diff placeholder with a temporary wrapper so we can call htmx.process() on the newly inserted content. After processing, unwrap the wrapper to keep the DOM structure unchanged.

  • Open a large PR diff page where Diff.IsIncomplete is true
  • Click "Show more files"
  • Verify newly loaded file boxes behave correctly (htmx-related features work as expected)

image

…36568)

The "Show more files" button replaces `#diff-incomplete` with newly
loaded diff file boxes.
The inserted HTML may contain htmx attributes, but they are not
processed after insertion.
Wrap the incomplete diff placeholder with a temporary wrapper so we can
call `htmx.process()` on the newly inserted content.
After processing, unwrap the wrapper to keep the DOM structure
unchanged.
- Open a large PR diff page where `Diff.IsIncomplete` is true
- Click "Show more files"
- Verify newly loaded file boxes behave correctly (htmx-related features
work as expected)

<img width="927" height="278" alt="image"
src="https://github.com/user-attachments/assets/54f2b4f2-c0e1-483c-9e26-79a2838e98ee"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 10, 2026
@GiteaBot GiteaBot added this to the 1.25.5 milestone Feb 10, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 10, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 10, 2026
@wxiaoguang wxiaoguang merged commit 4f1408c into go-gitea:release/v1.25 Feb 10, 2026
26 checks passed
@tyroneyeh tyroneyeh deleted the backport-36568-v1.25 branch February 10, 2026 05:12
@go-gitea go-gitea locked as resolved and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants