Skip to content

Conversation

zokkis
Copy link
Contributor

@zokkis zokkis commented Feb 11, 2024

Don't do a full page load when searching code and fold the result


  • maybe the idea to send depending on the htmx-header the full-content or only the searchresults needs to be discussed

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 11, 2024
$(document).on('click', '.fold-container .fold-button', ({currentTarget}) => {
invertFileFolding(currentTarget.closest('.fold-container'), currentTarget);
});
}
Copy link
Member

@silverwind silverwind Feb 13, 2024

Choose a reason for hiding this comment

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

Can we use a <details> element for the toggle mechanism instead of this JS? I know it can be (ab)used for a lot of use cases, so I think it's suitable.

ctx.Data["queryType"] = queryType
ctx.Data["PageIsViewCode"] = true

isHtmxRequest := len(ctx.Req.Header.Values("HX-Request")) > 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
isHtmxRequest := len(ctx.Req.Header.Values("HX-Request")) > 0
isHtmxRequest := ctx.Req.Header.Get("HX-Request") == "true"

@zokkis zokkis marked this pull request as draft February 15, 2024 21:25
@wxiaoguang
Copy link
Contributor

Using htmx without careful design would cause some "init" problems (see #29385 (comment) and #33854 )

About this PR: it is stale for long time, I then the benefit it brings is less than the maintainability cost. Feel free to reopen if there would be a better approach.

@wxiaoguang wxiaoguang closed this Mar 13, 2025
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants