From 96147ff9a3634c85fb4648744b50fd8bedbac4f4 Mon Sep 17 00:00:00 2001 From: eti Date: Fri, 15 May 2026 12:34:00 +0200 Subject: [PATCH] appview/pulls/create: scroll to top on submit Signed-off-by: eti --- .../pages/templates/repo/pulls/fragments/pullComposeHost.html | 3 ++- appview/pulls/create.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/appview/pages/templates/repo/pulls/fragments/pullComposeHost.html b/appview/pages/templates/repo/pulls/fragments/pullComposeHost.html index c3e75d63..05bc37bc 100644 --- a/appview/pages/templates/repo/pulls/fragments/pullComposeHost.html +++ b/appview/pages/templates/repo/pulls/fragments/pullComposeHost.html @@ -16,7 +16,8 @@ hx-post="/{{ .RepoInfo.FullName }}/pulls/new" hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:(#patch,#title,#body)" hx-indicator="#create-pull-spinner" - hx-swap="none" + hx-target="body" + hx-swap="innerHTML show:top" class="flex flex-col gap-6" >
diff --git a/appview/pulls/create.go b/appview/pulls/create.go index da54669e..690c71ff 100644 --- a/appview/pulls/create.go +++ b/appview/pulls/create.go @@ -335,7 +335,7 @@ func (s *Pulls) createPullRequest( s.applyCreationLabels(r.Context(), client, userDid, []*models.Pull{pull}, r.Form, repo) ownerSlashRepo := reporesolver.GetBaseRepoPath(r, repo) - s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls/%d", ownerSlashRepo, pullId)) + http.Redirect(w, r, fmt.Sprintf("/%s/pulls/%d", ownerSlashRepo, pullId), http.StatusFound) } func (s *Pulls) createStackedPullRequest( @@ -452,7 +452,7 @@ func (s *Pulls) createStackedPullRequest( s.applyCreationLabels(r.Context(), client, userDid, stack, r.Form, repo) ownerSlashRepo := reporesolver.GetBaseRepoPath(r, repo) - s.pages.HxLocation(w, fmt.Sprintf("/%s/pulls", ownerSlashRepo)) + http.Redirect(w, r, fmt.Sprintf("/%s/pulls", ownerSlashRepo), http.StatusFound) } func (s *Pulls) newStack( -- 2.51.2