Monorepo for Tangled
0

Configure Feed

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

appview/pulls: collapse comment box on post, guarded round id

Lewis: May this revision serve well! <lewis@tangled.org>

Lewis (Jun 29, 2026, 9:08 PM +0300) 12128183 7285a60f

+3 -3
+1 -1
appview/pages/templates/repo/pulls/fragments/pullNewComment.html
··· 9 9 hx-swap="beforeend" 10 10 hx-disabled-elt="find button[type='submit']" 11 11 hx-on::before-request="this.querySelector('.error').innerHTML = ''" 12 - hx-on::after-request="if(event.detail.successful) this.reset()" 12 + hx-on::after-request="if(event.detail.successful) htmx.ajax('GET', '/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions', {target: '#actions-{{ .RoundNumber }}', swap: 'outerHTML'})" 13 13 > 14 14 <input name="subject-uri" type="hidden" value="{{ .Pull.AtUri }}"> 15 15 <input name="pull-round-idx" type="hidden" value="{{ .RoundNumber }}">
+1 -1
appview/pulls/comment.go
··· 28 28 29 29 roundNumberStr := chi.URLParam(r, "round") 30 30 roundNumber, err := strconv.Atoi(roundNumberStr) 31 - if err != nil || roundNumber >= len(pull.Submissions) { 31 + if err != nil || roundNumber < 0 || roundNumber >= len(pull.Submissions) { 32 32 http.Error(w, "bad round id", http.StatusBadRequest) 33 33 l.Error("failed to parse round id", "err", err, "round_number_str", roundNumberStr) 34 34 return
+1 -1
appview/pulls/single.go
··· 136 136 if r, err := strconv.Atoi(roundId); err == nil { 137 137 roundIdInt = r 138 138 } 139 - if roundIdInt >= len(pull.Submissions) { 139 + if roundIdInt < 0 || roundIdInt >= len(pull.Submissions) { 140 140 http.Error(w, "bad round id", http.StatusBadRequest) 141 141 l.Error("failed to parse round id", "err", err, "round_number", roundIdInt) 142 142 return