From db50bad7a871a1aac877d4818a123ae1f565c9e2 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Wed, 21 Jan 2026 10:21:20 +0000 Subject: [PATCH] appview/pages/pulls: allow collapsing submission comments works like reddit threads: you click on the vertical line connecting each comment and it collapses the thread. Signed-off-by: oppiliappan --- input.css | 2 +- appview/pages/templates/repo/pulls/pull.html | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------ appview/pages/templates/repo/pulls/fragments/pullNewComment.html | 2 +- 3 file(s) changed, 55 insertion(s)(+), 32 deletion(s)(-) diff --git a/input.css b/input.css --- a/input.css +++ b/input.css @@ -96,7 +96,7 @@ @apply border border-gray-400 block rounded bg-gray-50 focus:ring-black p-3 dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:focus:ring-gray-400; } textarea { - @apply border border-gray-400 block rounded bg-gray-50 focus:ring-black p-3 dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:focus:ring-gray-400; + @apply border border-gray-400 block rounded bg-gray-50 focus:outline-none focus:ring-1 focus:ring-black p-3 dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:focus:ring-gray-400; } details summary::-webkit-details-marker { display: none; diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html --- a/appview/pages/templates/repo/pulls/pull.html +++ b/appview/pages/templates/repo/pulls/pull.html @@ -139,7 +139,7 @@
-
+
-

Submissions

+

Comments

{{ template "subsPanelSummary" $ }}
@@ -164,8 +164,8 @@ {{ $latest := $pull.LastRoundNumber }}
- {{ i "chevron-up" "size-4" }} - + {{ i "chevron-up" "size-4" }} +
{{ end }} @@ -222,27 +222,9 @@ {{ $idx := index . 1 }} {{ $lastIdx := index . 2 }} {{ $root := index . 3 }} -
+
{{ template "submissionHeader" $ }} {{ template "submissionComments" $ }} - - {{ if eq $lastIdx $item.RoundNumber }} - {{ block "mergeStatus" $root }} {{ end }} - {{ block "resubmitStatus" $root }} {{ end }} - {{ end }} - - {{ if $root.LoggedInUser }} - {{ template "repo/pulls/fragments/pullActions" - (dict - "LoggedInUser" $root.LoggedInUser - "Pull" $root.Pull - "RepoInfo" $root.RepoInfo - "RoundNumber" $item.RoundNumber - "MergeCheck" $root.MergeCheck - "ResubmitCheck" $root.ResubmitCheck - "BranchDeleteStatus" $root.BranchDeleteStatus - "Stack" $root.Stack) }} - {{ end }}
{{ end }} @@ -510,21 +492,62 @@ {{ define "submissionComments" }} {{ $item := index . 0 }} -
- {{ range $item.Comments }} - {{ template "submissionComment" . }} - {{ end }} -
+ {{ $idx := index . 1 }} + {{ $lastIdx := index . 2 }} + {{ $root := index . 3 }} + {{ $c := len $item.Comments }} +
+ + +
+
+
+
+ + {{ i "circle-plus" "size-4 z-5" }} + expand {{ $c }} comment{{ if ne $c 1 }}s{{ end }} + +
+
+
+ {{ range $item.Comments }} + {{ template "submissionComment" . }} + {{ end }} +
+ +
+ {{ if eq $lastIdx $item.RoundNumber }} + {{ block "mergeStatus" $root }} {{ end }} + {{ block "resubmitStatus" $root }} {{ end }} + {{ end }} +
+
+ {{ if $root.LoggedInUser }} + {{ template "repo/pulls/fragments/pullActions" + (dict + "LoggedInUser" $root.LoggedInUser + "Pull" $root.Pull + "RepoInfo" $root.RepoInfo + "RoundNumber" $item.RoundNumber + "MergeCheck" $root.MergeCheck + "ResubmitCheck" $root.ResubmitCheck + "BranchDeleteStatus" $root.BranchDeleteStatus + "Stack" $root.Stack) }} + {{ end }} +
+
{{ end }} {{ define "submissionComment" }}
-
+
diff --git a/appview/pages/templates/repo/pulls/fragments/pullNewComment.html b/appview/pages/templates/repo/pulls/fragments/pullNewComment.html --- a/appview/pages/templates/repo/pulls/fragments/pullNewComment.html +++ b/appview/pages/templates/repo/pulls/fragments/pullNewComment.html @@ -12,7 +12,7 @@ > -- tangled.sh