From e56c88f96d78f1d6a4dbc2b81d3b7a86b853329e Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sat, 23 May 2026 17:16:48 +0900 Subject: [PATCH] appview/pages: don't reset comment form after request This can catch `pages.Notice` responses which is not a successful request. We refresh the page on successful case, so it's fine to not refresh the form. Signed-off-by: Seongmin Lee --- appview/pages/templates/fragments/comment/reply.html | 1 - appview/pages/templates/repo/issues/fragments/newComment.html | 2 +- .../pages/templates/repo/pulls/fragments/pullNewComment.html | 2 -- appview/pages/templates/strings/string.html | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/appview/pages/templates/fragments/comment/reply.html b/appview/pages/templates/fragments/comment/reply.html index e115627c..46835e89 100644 --- a/appview/pages/templates/fragments/comment/reply.html +++ b/appview/pages/templates/fragments/comment/reply.html @@ -5,7 +5,6 @@ hx-swap="none" hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea" hx-on::before-request="this.querySelector('#comment-error').innerHTML = ''" - hx-on::after-request="if(event.detail.successful) this.reset()" hx-disabled-elt="find button[type='submit']" > {{ template "user/fragments/picHandleLink" .LoggedInUser.Did }} diff --git a/appview/pages/templates/repo/issues/fragments/newComment.html b/appview/pages/templates/repo/issues/fragments/newComment.html index 9dff87f3..cc6a680b 100644 --- a/appview/pages/templates/repo/issues/fragments/newComment.html +++ b/appview/pages/templates/repo/issues/fragments/newComment.html @@ -6,7 +6,7 @@ hx-trigger="submit, click from:#close-button, keydown[commentButtonEnabled() && (ctrlKey || metaKey) && key=='Enter'] from:#comment-textarea" hx-disabled-elt="find button[type='submit']" hx-on::before-request="document.getElementById('comment-error').innerHTML = ''" - hx-on::after-request="if(event.detail.successful) this.reset()" + hx-swap="none" class="group/form " > diff --git a/appview/pages/templates/repo/pulls/fragments/pullNewComment.html b/appview/pages/templates/repo/pulls/fragments/pullNewComment.html index 8de34f38..bae06cfd 100644 --- a/appview/pages/templates/repo/pulls/fragments/pullNewComment.html +++ b/appview/pages/templates/repo/pulls/fragments/pullNewComment.html @@ -8,8 +8,6 @@ hx-target="#pull-comments-{{ .RoundNumber }}" hx-swap="beforeend" hx-disabled-elt="find button[type='submit']" - hx-on::before-request="this.querySelector('.error').innerHTML = ''" - hx-on::after-request="if(event.detail.successful) htmx.ajax('GET', '/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions', {target: '#actions-{{ .RoundNumber }}', swap: 'outerHTML'})" > diff --git a/appview/pages/templates/strings/string.html b/appview/pages/templates/strings/string.html index 20c4c878..0029cc4f 100644 --- a/appview/pages/templates/strings/string.html +++ b/appview/pages/templates/strings/string.html @@ -118,7 +118,6 @@ hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea" hx-swap="none" hx-disabled-elt="find button[type='submit']" - hx-on::after-request="if(event.detail.successful) this.reset()" class="group/form" > -- 2.51.2