This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages: remove `pullNewComment` fragment

It's just style change which can be done by CSS.

Signed-off-by: Seongmin Lee <git@boltless.me>

author
Seongmin Lee
committer
Tangled
date (Jul 22, 2026, 4:28 PM +0300) commit 64c94491 parent 9e6250a4 change-id wozpoyqw
+40 -123
-1
appview/pages/compose_parse_test.go
··· 31 31 {"pullCompareBranches", []string{"repo/pulls/fragments/pullCompareBranches"}}, 32 32 {"pullCompareForksBranches", []string{"repo/pulls/fragments/pullCompareForksBranches"}}, 33 33 {"pull.html via repo base", []string{"layouts/base", "layouts/repobase", "repo/pulls/pull"}}, 34 - {"pullNewComment", []string{"repo/pulls/fragments/pullNewComment"}}, 35 34 {"pullComment", []string{"fragments/comment/pullComment"}}, 36 35 } 37 36
-11
appview/pages/pages.go
··· 1586 1586 return p.executePlain("repo/pulls/fragments/pullActions", w, params) 1587 1587 } 1588 1588 1589 - type PullNewCommentParams struct { 1590 - BaseParams 1591 - RepoInfo repoinfo.RepoInfo 1592 - Pull *models.Pull 1593 - RoundNumber int 1594 - } 1595 - 1596 - func (p *Pages) PullNewCommentFragment(w io.Writer, params PullNewCommentParams) error { 1597 - return p.executePlain("repo/pulls/fragments/pullNewComment", w, params) 1598 - } 1599 - 1600 1589 type RepoCompareParams struct { 1601 1590 BaseParams 1602 1591 RepoInfo repoinfo.RepoInfo
+40 -8
appview/pages/templates/repo/pulls/fragments/pullActions.html
··· 37 37 {{ if and (not $loading) $isLastRound }} 38 38 {{ template "resubmitStatus" . }} 39 39 {{ end }} 40 - <div id="actions-{{$roundNumber}}" hx-target="this" class="flex flex-wrap gap-2 relative" 40 + <input type="checkbox" id="comment-toggle-{{$roundNumber}}" class="peer/comment hidden"/> 41 + <div class="hidden peer-checked/comment:flex flex-col gap-2"> 42 + <form 43 + class="w-full flex flex-wrap gap-2 group" 44 + hx-post="/comment" 45 + hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea" 46 + hx-target="#pull-comments-{{ .RoundNumber }}" 47 + hx-swap="beforeend" 48 + hx-disabled-elt="find button[type='submit']" 49 + hx-on::after-request="if(event.target === this && event.detail.successful) htmx.ajax('GET', '/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions', {target: '#action-card-{{ .RoundNumber }}', swap: 'outerHTML'})" 50 + > 51 + <input name="subject-uri" type="hidden" value="{{ .Pull.AtUri }}"> 52 + <input name="pull-round-idx" type="hidden" value="{{ .RoundNumber }}"> 53 + {{ template "fragments/markdownEditor" 54 + (dict "Name" "body" 55 + "BlobName" "blob" 56 + "Rows" 8 57 + "Required" true 58 + "Placeholder" "Add to the discussion...") }} 59 + <div class="flex flex-wrap items-stretch justify-end gap-2 text-gray-500 dark:text-gray-400 text-sm w-full"> 60 + <label title="Toggle comment form" for="comment-toggle-{{$roundNumber}}" class="btn-flat text-red-500 dark:text-red-400 flex gap-2 items-center"> 61 + {{ i "x" "size-4" }} 62 + <span>Cancel</span> 63 + </label> 64 + <button 65 + type="submit" 66 + class="btn-create-flat flex items-center gap-2"> 67 + {{ i "reply" "size-4 inline group-[.htmx-request]:hidden" }} 68 + {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }} 69 + Reply 70 + </button> 71 + </div> 72 + <div id="comment-error-{{ .RoundNumber }}" class="error"></div> 73 + </form> 74 + </div> 75 + <div id="actions-{{$roundNumber}}" hx-target="this" class="peer-checked/comment:hidden flex flex-wrap gap-2 relative" 41 76 {{ if $loading }} 42 77 hx-swap="outerHTML" 43 78 {{ end }} 44 79 > 45 80 {{ if .LoggedInUser }} 46 - <button 47 - hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ $roundNumber }}/comment" 48 - class="btn-flat p-2 flex items-center gap-2 no-underline hover:no-underline group"> 49 - {{ i "message-square-plus" "w-4 h-4 inline group-[.htmx-request]:hidden" }} 50 - {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 51 - Comment 52 - </button> 81 + <label title="Toggle comment form" for="comment-toggle-{{$roundNumber}}" class="btn-flat"> 82 + {{ i "message-square-plus" "size-4" }} 83 + <span>Comment</span> 84 + </label> 53 85 {{ end }} 54 86 {{ if and (not $loading) .BranchDeleteStatus }} 55 87 <button
-55
appview/pages/templates/repo/pulls/fragments/pullNewComment.html
··· 1 - {{ define "repo/pulls/fragments/pullNewComment" }} 2 - <div class="w-full flex flex-col gap-2"> 3 - {{ template "user/fragments/picHandleLink" .LoggedInUser.Did }} 4 - <form 5 - class="w-full flex flex-wrap gap-2 group" 6 - hx-post="/comment" 7 - hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea" 8 - hx-target="#pull-comments-{{ .RoundNumber }}" 9 - hx-swap="beforeend" 10 - hx-disabled-elt="find button[type='submit']" 11 - hx-on::after-request="if(event.target === this && event.detail.successful) htmx.ajax('GET', '/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions', {target: '#action-card-{{ .RoundNumber }}', swap: 'outerHTML'})" 12 - > 13 - <input name="subject-uri" type="hidden" value="{{ .Pull.AtUri }}"> 14 - <input name="pull-round-idx" type="hidden" value="{{ .RoundNumber }}"> 15 - {{ template "fragments/markdownEditor" 16 - (dict "Name" "body" 17 - "BlobName" "blob" 18 - "Rows" 8 19 - "Required" true 20 - "Placeholder" "Add to the discussion...") }} 21 - {{ template "replyActions" . }} 22 - <div id="comment-error-{{ .RoundNumber }}" class="error"></div> 23 - </form> 24 - </div> 25 - {{ end }} 26 - 27 - {{ define "replyActions" }} 28 - <div class="flex flex-wrap items-stretch justify-end gap-2 text-gray-500 dark:text-gray-400 text-sm w-full"> 29 - {{ template "cancel" . }} 30 - {{ template "reply" . }} 31 - </div> 32 - {{ end }} 33 - 34 - {{ define "cancel" }} 35 - <button 36 - type="button" 37 - class="btn-flat text-red-500 dark:text-red-400 flex gap-2 items-center group" 38 - hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions" 39 - hx-swap="outerHTML" 40 - hx-target="#action-card-{{.RoundNumber}}" 41 - > 42 - {{ i "x" "w-4 h-4" }} 43 - <span>Cancel</span> 44 - </button> 45 - {{ end }} 46 - 47 - {{ define "reply" }} 48 - <button 49 - type="submit" 50 - class="btn-create-flat flex items-center gap-2"> 51 - {{ i "reply" "w-4 h-4 inline group-[.htmx-request]:hidden" }} 52 - {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 53 - Reply 54 - </button> 55 - {{ end }}
-47
appview/pulls/comment.go
··· 1 - package pulls 2 - 3 - import ( 4 - "net/http" 5 - "strconv" 6 - 7 - "tangled.org/core/appview/models" 8 - "tangled.org/core/appview/pages" 9 - 10 - "github.com/go-chi/chi/v5" 11 - ) 12 - 13 - func (s *Pulls) PullComment(w http.ResponseWriter, r *http.Request) { 14 - l := s.logger.With("handler", "PullComment") 15 - 16 - user := s.oauth.GetMultiAccountUser(r) 17 - if user != nil { 18 - l = l.With("user", user.Did) 19 - } 20 - 21 - pull, ok := r.Context().Value("pull").(*models.Pull) 22 - if !ok { 23 - l.Error("failed to get pull") 24 - s.pages.Notice(w, "pull-error", "Failed to edit patch. Try again later.") 25 - return 26 - } 27 - l = l.With("pull_id", pull.PullId, "pull_owner", pull.OwnerDid) 28 - 29 - roundNumberStr := chi.URLParam(r, "round") 30 - roundNumber, err := strconv.Atoi(roundNumberStr) 31 - if err != nil || roundNumber < 0 || roundNumber >= len(pull.Submissions) { 32 - http.Error(w, "bad round id", http.StatusBadRequest) 33 - l.Error("failed to parse round id", "err", err, "round_number_str", roundNumberStr) 34 - return 35 - } 36 - 37 - switch r.Method { 38 - case http.MethodGet: 39 - s.pages.PullNewCommentFragment(w, pages.PullNewCommentParams{ 40 - BaseParams: pages.BaseParamsFromContext(r.Context()), 41 - RepoInfo: s.repoResolver.GetRepoInfo(r, user), 42 - Pull: pull, 43 - RoundNumber: roundNumber, 44 - }) 45 - return 46 - } 47 - }
-1
appview/pulls/router.go
··· 26 26 r.Get("/", s.RepoPullPatch) 27 27 r.Get("/interdiff", s.RepoPullInterdiff) 28 28 r.Get("/actions", s.PullActions) 29 - r.Get("/comment", s.PullComment) 30 29 }) 31 30 32 31 r.Route("/round/{round}.patch", func(r chi.Router) {