Monorepo for Tangled
tangled.org
1{{ define "title" }}
2 {{ .Pull.Title }} · Pull #{{ .Pull.PullId }} · {{ .RepoInfo.FullName }} · Tangled
3{{ end }}
4
5{{ define "extrameta" }}
6 {{ template "repo/pulls/fragments/og" (dict "RepoInfo" .RepoInfo "Pull" .Pull) }}
7{{ end }}
8
9{{ define "mainLayout" }}
10 <div class="px-1 flex-grow flex flex-col gap-4">
11 <div class="max-w-full md:max-w-screen-lg mx-auto">
12 {{ block "contentLayout" . }}
13 {{ block "content" . }}{{ end }}
14 {{ end }}
15 </div>
16 {{ block "contentAfterLayout" . }}
17 <main>
18 {{ block "contentAfter" . }}{{ end }}
19 </main>
20 {{ end }}
21 </div>
22 <script>
23 (function() {
24 const details = document.getElementById('bottomSheet');
25 const backdrop = document.getElementById('bottomSheetBackdrop');
26 const isDesktop = () => window.matchMedia('(min-width: 768px)').matches;
27
28 // function to update backdrop
29 const updateBackdrop = () => {
30 if (backdrop) {
31 if (details.open && !isDesktop()) {
32 backdrop.classList.remove('opacity-0', 'pointer-events-none');
33 backdrop.classList.add('opacity-100', 'pointer-events-auto');
34 document.body.style.overflow = 'hidden';
35 } else {
36 backdrop.classList.remove('opacity-100', 'pointer-events-auto');
37 backdrop.classList.add('opacity-0', 'pointer-events-none');
38 document.body.style.overflow = '';
39 }
40 }
41 };
42
43 // close on mobile initially
44 if (!isDesktop()) {
45 details.open = false;
46 }
47 updateBackdrop(); // initialize backdrop
48
49 // prevent closing on desktop
50 details.addEventListener('toggle', function(e) {
51 if (isDesktop() && !this.open) {
52 this.open = true;
53 }
54 updateBackdrop();
55 });
56
57 const mediaQuery = window.matchMedia('(min-width: 768px)');
58 mediaQuery.addEventListener('change', function(e) {
59 if (e.matches) {
60 // switched to desktop - keep open
61 details.open = true;
62 } else {
63 // switched to mobile - close
64 details.open = false;
65 }
66 updateBackdrop();
67 });
68
69 // close when clicking backdrop
70 if (backdrop) {
71 backdrop.addEventListener('click', () => {
72 if (!isDesktop()) {
73 details.open = false;
74 }
75 });
76 }
77 })();
78 </script>
79{{ end }}
80
81{{ define "repoContentLayout" }}
82 <div class="grid grid-cols-1 md:grid-cols-10 gap-4 w-full">
83 <div class="col-span-1 md:col-span-8 flex flex-col gap-4">
84 <section class="bg-white dark:bg-gray-800 p-6 rounded relative w-full mx-auto dark:text-white h-full flex-shrink">
85 {{ block "repoContent" . }}{{ end }}
86 </section>
87 {{ template "repo/pulls/fragments/pullVouchNudge" . }}
88 </div>
89 <div class="flex flex-col gap-6 col-span-1 md:col-span-2">
90 {{ template "repo/fragments/labelPanel"
91 (dict "RepoInfo" $.RepoInfo
92 "Defs" $.LabelDefs
93 "Subject" $.Pull.AtUri
94 "State" $.Pull.Labels) }}
95 {{ template "repo/fragments/participants" $.Pull.Participants }}
96 {{ template "repo/fragments/backlinks"
97 (dict "RepoInfo" $.RepoInfo
98 "Backlinks" $.Backlinks) }}
99 {{ template "repo/fragments/externalLinkPanel" $.Pull.AtUri }}
100 </div>
101 </div>
102{{ end }}
103
104{{ define "contentAfter" }}
105 <input type="hidden" id="round-link-base" value="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .ActiveRound }}" />
106 {{ if .IsInterdiff }}
107 <input type="hidden" id="is-interdiff" value="1" />
108 {{ end }}
109 {{ template "repo/fragments/diff" (list .Diff .DiffOpts $) }}
110{{ end }}
111
112{{ define "repoContent" }}
113 {{ template "repo/pulls/fragments/pullHeader" . }}
114 {{ if (gt (len .Stack) 1) }}
115 <div class="mt-8">
116 {{ template "repo/pulls/fragments/pullStack" . }}
117 </div>
118 {{ end }}
119{{ end }}
120
121{{ define "resize-grip" }}
122 {{ $id := index . 0 }}
123 {{ $target := index . 1 }}
124 {{ $direction := index . 2 }}
125 <div id="{{ $id }}"
126 data-resizer="vertical"
127 data-target="{{ $target }}"
128 data-direction="{{ $direction }}"
129 class="resizer-vertical hidden md:flex w-4 sticky top-12 max-h-screen flex-col items-center justify-center group">
130 <div class="w-1 h-16 group-hover:h-24 group-[.resizing]:h-24 transition-all rounded-full bg-gray-400 dark:bg-gray-500 group-hover:bg-gray-500 group-hover:dark:bg-gray-400"></div>
131 </div>
132{{ end }}
133
134{{ define "diffLayout" }}
135 {{ $diff := index . 0 }}
136 {{ $opts := index . 1 }}
137 {{ $root := index . 2 }}
138
139 <div class="flex col-span-full">
140 <!-- left panel -->
141 <div id="files" class="w-0 hidden md:block overflow-hidden sticky top-12 max-h-screen overflow-y-auto pb-12">
142 <section class="overflow-x-auto text-sm px-6 py-2 border-b border-x border-gray-200 dark:border-gray-700 w-full mx-auto min-h-full rounded-b rounded-t-none bg-white dark:bg-gray-800 shadow-sm">
143 {{ template "repo/fragments/fileTree" $diff.FileTree }}
144 </section>
145 </div>
146
147 {{ template "resize-grip" (list "resize-files" "files" "before") }}
148
149 <!-- main content -->
150 <div id="diff-files" class="flex-1 min-w-0 sticky top-12 pb-12">
151 {{ template "diffFiles" (list $diff $opts) }}
152 </div>
153
154 {{ template "resize-grip" (list "resize-subs" "subs" "after") }}
155
156 <!-- right panel -->
157 {{ template "subsPanel" $ }}
158 </div>
159{{ end }}
160
161{{ define "subsPanel" }}
162 {{ $root := index . 2 }}
163 {{ $pull := $root.Pull }}
164 {{ $bgColor := "bg-gray-600 dark:bg-gray-700" }}
165
166 {{ if $pull.State.IsOpen }}
167 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
168 {{ else if $pull.State.IsMerged }}
169 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }}
170 {{ else if $pull.State.IsAbandoned }}
171 {{ $bgColor = "bg-red-600 dark:bg-red-700" }}
172 {{ end }}
173
174 <!-- backdrop overlay - only visible on mobile when open -->
175 <div id="bottomSheetBackdrop" class="fixed inset-0 bg-black/50 md:hidden opacity-0 pointer-events-none transition-opacity duration-300 z-40"></div>
176 <!-- right panel - bottom sheet on mobile, side panel on desktop -->
177 <div id="subs" class="fixed bottom-0 left-0 right-0 z-50 w-full md:static md:z-auto md:max-h-screen md:sticky md:top-12 overflow-hidden">
178 <details open id="bottomSheet" class="rounded-t-2xl md:rounded-t shadow-lg md:shadow-none group/panel">
179 <summary class="
180 flex gap-4 items-center justify-between
181 rounded-t-2xl md:rounded-t cursor-pointer list-none p-4 md:h-12
182 text-white md:text-black md:dark:text-white
183 {{ $bgColor }}
184 md:bg-white md:dark:bg-gray-800
185 shadow-sm border-t md:border-x border-gray-200 dark:border-gray-700
186 md:pointer-events-none
187 ">
188 <h2 class="">History</h2>
189 <span class="pointer-events-auto cursor-text">
190 {{ template "subsPanelSummary" $ }}
191 </span>
192 </summary>
193 <div class="max-h-[85vh] md:max-h-[calc(100vh-3rem-3rem)] w-full flex flex-col-reverse gap-4 overflow-y-auto bg-slate-100 dark:bg-gray-900 md:bg-transparent">
194 {{ template "submissions" $root }}
195 </div>
196 </details>
197 </div>
198{{ end }}
199
200{{ define "subsPanelSummary" }}
201 {{ $root := index . 2 }}
202 {{ $pull := $root.Pull }}
203 {{ $rounds := len $pull.Submissions }}
204 {{ $comments := $pull.TotalComments }}
205 <div class="flex items-center gap-2 text-sm">
206 <span>
207 {{ $rounds }} round{{ if ne $rounds 1 }}s{{ end }}
208 </span>
209 <span class="select-none before:content-['\00B7']"></span>
210 <span>
211 {{ $comments }} comment{{ if ne $comments 1 }}s{{ end }}
212 </span>
213
214 <span class="md:hidden inline">
215 <span class="inline group-open:hidden">{{ i "chevron-up" "size-4" }}</span>
216 <span class="hidden group-open:inline">{{ i "chevron-down" "size-4" }}</span>
217 </span>
218 </div>
219{{ end }}
220
221{{ define "subsCheckbox" }}
222 <input type="checkbox" id="subsToggle" class="peer/subs hidden" checked/>
223{{ end }}
224
225{{ define "subsToggle" }}
226 <style>
227 #subsToggle:checked ~ div div#subs {
228 width: 100%;
229 margin-left: 0;
230 }
231 #subsToggle:checked ~ div label[for="subsToggle"] .show-toggle { display: none; }
232 #subsToggle:checked ~ div label[for="subsToggle"] .hide-toggle { display: flex; }
233 #subsToggle:not(:checked) ~ div label[for="subsToggle"] .hide-toggle { display: none; }
234
235 @media (min-width: 768px) {
236 #subsToggle:checked ~ div div#subs {
237 width: 25vw;
238 max-width: 50vw;
239 }
240 #subsToggle:not(:checked) ~ div div#subs {
241 width: 0;
242 display: none;
243 margin-left: 0;
244 }
245 #subsToggle:not(:checked) ~ div div#resize-subs {
246 display: none;
247 }
248 }
249 </style>
250 <label title="Toggle review panel" for="subsToggle" class="hidden md:flex items-center justify-end pointer-events-none">
251 <span class="show-toggle hit-area hit-area-4 hit-area-x-2 pointer-events-auto cursor-pointer">{{ i "message-square-more" "size-4" }}</span>
252 <span class="hide-toggle w-[25vw] justify-end"><span class="hit-area hit-area-4 hit-area-x-2 pointer-events-auto cursor-pointer">{{ i "message-square" "size-4" }}</span></span>
253 </label>
254{{ end }}
255
256
257{{ define "submissions" }}
258 {{ $lastIdx := sub (len .Pull.Submissions) 1 }}
259 {{ if not .LoggedInUser }}
260 {{ template "loginPrompt" $ }}
261 {{ end }}
262 {{ range $ridx, $item := reverse .Pull.Submissions }}
263 {{ $idx := sub $lastIdx $ridx }}
264 {{ template "submission" (list $item $idx $lastIdx $) }}
265 {{ end }}
266{{ end }}
267
268{{ define "submission" }}
269 {{ $item := index . 0 }}
270 {{ $idx := index . 1 }}
271 {{ $lastIdx := index . 2 }}
272 {{ $root := index . 3 }}
273 {{ $round := $item.RoundNumber }}
274 <div class="
275 w-full shadow-sm border overflow-clip
276
277 {{ if eq $round 0 }}rounded-b{{ else }}rounded{{ end }}
278 {{ if eq $round $root.ActiveRound }}
279 bg-blue-50/25 dark:bg-blue-900/10 border-blue-200 dark:border-blue-900
280 {{ else }}
281 bg-gray-50 dark:bg-gray-900 border-gray-200 dark:border-gray-700
282 {{ end }}
283 ">
284 {{ template "submissionHeader" $ }}
285 {{ template "submissionComments" $ }}
286 </div>
287{{ end }}
288
289{{ define "submissionHeader" }}
290 {{ $item := index . 0 }}
291 {{ $lastIdx := index . 2 }}
292 {{ $root := index . 3 }}
293 {{ $round := $item.RoundNumber }}
294 <div class="
295 {{ if ne $round 0 }}rounded-t{{ end }}
296 px-6 py-4 pr-2 pt-2
297 {{ if eq $round $root.ActiveRound }}
298 bg-blue-50 dark:bg-blue-950
299 {{ else }}
300 bg-white dark:bg-gray-800
301 {{ end }}
302
303 flex gap-2 sticky top-0 z-20">
304 <!-- left column: just profile picture -->
305 <div class="flex-shrink-0 pt-2">
306 {{ template "user/fragments/picLink" (list $root.Pull.OwnerDid "size-8" (index $root.VouchRelationships (did $root.Pull.OwnerDid))) }}
307 </div>
308 <!-- right column -->
309 <div class="flex-1 min-w-0 flex flex-col gap-1">
310 {{ template "submissionInfo" $ }}
311 {{ template "submissionCommits" $ }}
312 {{ template "submissionPipeline" $ }}
313 {{ if eq $lastIdx $round }}
314 <div id="mergecheck-banner">
315 {{ if $root.Pull.State.IsOpen }}
316 <div class="flex items-center gap-2 text-gray-500 dark:text-gray-400">
317 {{ i "loader-circle" "w-4 h-4 animate-spin" }}
318 <span>Checking mergeability…</span>
319 </div>
320 {{ end }}
321 </div>
322 {{ end }}
323 </div>
324 </div>
325{{ end }}
326
327{{ define "submissionInfo" }}
328 {{ $item := index . 0 }}
329 {{ $idx := index . 1 }}
330 {{ $root := index . 3 }}
331 {{ $round := $item.RoundNumber }}
332 <div class="flex gap-2 items-center justify-between mb-1">
333<span class="inline-flex items-center gap-2 text-sm
334 {{ if eq $round $root.ActiveRound }}
335 text-gray-600 dark:text-gray-300
336 {{ else }}
337 text-gray-500 dark:text-gray-400
338 {{ end }}
339 pt-2">
340 {{ $handle := resolve $root.Pull.OwnerDid }}
341 <a class="
342 {{ if eq $round $root.ActiveRound }}
343 text-gray-800 dark:text-gray-300 hover:text-gray-800 dark:hover:text-gray-200
344 {{ else }}
345 text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300
346 {{ end }}
347 " href="/{{ $handle }}">{{ $handle }}</a>
348 submitted
349 <span class="px-2 py-0.5 rounded font-mono text-xs border
350 {{ if eq $round $root.ActiveRound }}
351 text-blue-800 dark:text-white bg-blue-100 dark:bg-blue-600 border-blue-200 dark:border-blue-500
352 {{ else }}
353 text-black dark:text-white bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600
354 {{ end }}
355 ">
356 #{{ $round }}
357 </span>
358 <span class="select-none before:content-['\00B7']"></span>
359 <a class="
360 {{ if eq $round $root.ActiveRound }}
361 text-gray-600 dark:text-gray-300 hover:text-gray-600 dark:hover:text-gray-200
362 {{ else }}
363 text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300
364 {{ end }}
365 " href="#round-#{{ $round }}">
366 {{ template "repo/fragments/shortTime" $item.Created }}
367 </a>
368 </span>
369 <div class="flex gap-2 items-center">
370 {{ if or $root.IsInterdiff (ne $root.ActiveRound $round) }}
371 <a class="btn-flat flex items-center gap-2 no-underline hover:no-underline text-sm"
372 href="/{{ $root.RepoInfo.FullName }}/pulls/{{ $root.Pull.PullId }}/round/{{ $round }}?{{ safeUrl $root.DiffOpts.Encode }}#round-#{{ $round }}">
373 {{ i "diff" "w-4 h-4" }}
374 Diff
375 </a>
376 {{ end }}
377 {{ if and (ne $idx 0) (or (not $root.IsInterdiff) (ne $root.ActiveRound $round)) }}
378 <a class="btn-flat flex items-center gap-2 no-underline hover:no-underline text-sm"
379 href="/{{ $root.RepoInfo.FullName }}/pulls/{{ $root.Pull.PullId }}/round/{{ $round }}/interdiff?{{ safeUrl $root.DiffOpts.Encode }}">
380 {{ i "chevrons-left-right-ellipsis" "w-4 h-4 rotate-90" }}
381 Interdiff
382 </a>
383 {{ end }}
384 </div>
385 </div>
386{{ end }}
387
388{{ define "submissionCommits" }}
389 {{ $item := index . 0 }}
390 {{ $root := index . 3 }}
391 {{ $round := $item.RoundNumber }}
392 {{ $patches := $item.AsFormatPatch }}
393 {{ if $patches }}
394 <details class="group/commit">
395 <summary class="list-none cursor-pointer flex items-center gap-2">
396 <span>{{ i "git-commit-horizontal" "w-4 h-4" }}</span>
397 {{ len $patches }} commit{{ if ne (len $patches) 1 }}s{{ end }}
398 <div class="text-sm text-gray-500 dark:text-gray-400">
399 <span class="group-open/commit:hidden inline">Expand</span>
400 <span class="hidden group-open/commit:inline">Collapse</span>
401 </div>
402 </summary>
403 {{ range $patches }}
404 {{ template "submissionCommit" (list . $item $root) }}
405 {{ end }}
406 </details>
407 {{ end }}
408{{ end }}
409
410{{ define "submissionCommit" }}
411 {{ $patch := index . 0 }}
412 {{ $item := index . 1 }}
413 {{ $root := index . 2 }}
414 {{ $round := $item.RoundNumber }}
415 {{ with $patch }}
416 <div id="commit-{{.SHA}}" class="py-1 relative w-full md:max-w-3/5 md:w-fit flex flex-col text-gray-600 dark:text-gray-300">
417 <div class="flex items-baseline gap-2">
418 <div class="text-xs">
419 <!-- attempt to resolve $fullRepo: this is possible only on non-deleted forks and branches -->
420 {{ $fullRepo := "" }}
421 {{ if and $root.Pull.IsForkBased $root.Pull.PullSource.Repo }}
422 {{ $fullRepo = printf "%s/%s" (resolve $root.Pull.PullSource.Repo.Did) $root.Pull.PullSource.Repo.Slug }}
423 {{ else if $root.Pull.IsBranchBased }}
424 {{ $fullRepo = $root.RepoInfo.FullName }}
425 {{ end }}
426
427 <!-- if $fullRepo was resolved, link to it, otherwise just span without a link -->
428 {{ if $fullRepo }}
429 <a href="/{{ $fullRepo }}/commit/{{ .SHA }}" class="font-mono text-gray-600 dark:text-gray-300">{{ slice .SHA 0 8 }}</a>
430 {{ else }}
431 <span class="font-mono">{{ slice .SHA 0 8 }}</span>
432 {{ end }}
433 </div>
434
435 <div>
436 <span>{{ .Title | description }}</span>
437 {{ if gt (len .Body) 0 }}
438 <button
439 class="py-1/2 px-1 mx-2 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
440 hx-on:click="document.getElementById('body-{{$round}}-{{.SHA}}').classList.toggle('hidden')"
441 >
442 {{ i "ellipsis" "w-3 h-3" }}
443 </button>
444 {{ end }}
445 {{ if gt (len .Body) 0 }}
446 <p id="body-{{$round}}-{{.SHA}}" class="hidden mt-1 pb-2">{{ nl2br .Body }}</p>
447 {{ end }}
448 </div>
449 </div>
450 </div>
451 {{ end }}
452{{ end }}
453
454{{ define "mergeStatus" }}
455 {{ if .Pull.State.IsClosed }}
456 <div class="bg-gray-50 dark:bg-gray-700 border border-black dark:border-gray-500 rounded shadow-sm px-6 py-2 relative">
457 <div class="flex items-center gap-2 text-black dark:text-white">
458 {{ i "ban" "w-4 h-4" }}
459 <span class="font-medium">Closed without merging</span
460 >
461 </div>
462 </div>
463 {{ else if .Pull.State.IsMerged }}
464 <div class="bg-purple-50 dark:bg-purple-900 border border-purple-500 rounded shadow-sm px-6 py-2 relative">
465 <div class="flex items-center gap-2 text-purple-500 dark:text-purple-300">
466 {{ i "git-merge" "w-4 h-4" }}
467 <span class="font-medium">Pull request successfully merged</span
468 >
469 </div>
470 </div>
471 {{ else if .Pull.State.IsAbandoned }}
472 <div class="bg-red-50 dark:bg-red-900 border border-red-500 rounded shadow-sm px-6 py-2 relative">
473 <div class="flex items-center gap-2 text-red-500 dark:text-red-300">
474 {{ i "git-pull-request-closed" "w-4 h-4" }}
475 <span class="font-medium">This pull has been deleted (possibly by jj abandon or jj squash)</span>
476 </div>
477 </div>
478 {{ end }}
479{{ end }}
480
481{{ define "submissionPipeline" }}
482 {{ $item := index . 0 }}
483 {{ $root := index . 3 }}
484 {{ $pipeline := index $root.Pipelines $item.SourceRev }}
485 {{ with $pipeline }}
486 {{ $id := .Id }}
487 {{ if .Statuses }}
488 <details class="group/pipeline">
489 <summary class="cursor-pointer list-none flex items-center gap-2">
490 {{ template "repo/pipelines/fragments/pipelineSymbol" (dict "Pipeline" $pipeline "ShortSummary" false) }}
491 <div class="text-sm text-gray-500 dark:text-gray-400">
492 <span class="group-open/pipeline:hidden inline">Expand</span>
493 <span class="hidden group-open/pipeline:inline">Collapse</span>
494 </div>
495 </summary>
496 <div class="my-2 grid grid-cols-1 bg-white dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 divide-y divide-gray-200 dark:divide-gray-700">
497 {{ range $name, $all := .Statuses }}
498 <a href="/{{ $root.RepoInfo.FullName }}/pipelines/{{ $id }}/workflow/{{ $name }}" class="no-underline hover:no-underline hover:bg-gray-100/25 hover:dark:bg-gray-700/25">
499 <div
500 class="flex gap-2 items-center justify-between p-2">
501 {{ $lastStatus := $all.Latest }}
502 {{ $kind := $lastStatus.Status.String }}
503
504 <div id="left" class="flex items-center gap-2 flex-shrink-0">
505 {{ template "repo/pipelines/fragments/workflowSymbol" $all }}
506 {{ $name }}
507 </div>
508 <div id="right" class="flex items-center gap-2 flex-shrink-0">
509 <span class="font-bold">{{ $kind }}</span>
510 {{ if .TimeTaken }}
511 {{ template "repo/fragments/duration" .TimeTaken }}
512 {{ else }}
513 {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }}
514 {{ end }}
515 </div>
516 </div>
517 </a>
518 {{ end }}
519 </div>
520 </details>
521 {{ end }}
522 {{ end }}
523{{ end }}
524
525{{ define "submissionComments" }}
526 {{ $item := index . 0 }}
527 {{ $idx := index . 1 }}
528 {{ $lastIdx := index . 2 }}
529 {{ $root := index . 3 }}
530 {{ $round := $item.RoundNumber }}
531 {{ $c := len $item.Comments }}
532 <details class="relative ml-10 group/comments group/collapse" {{ if or (eq $c 0) (eq $root.ActiveRound $round) }}open{{ end }}>
533 <summary class="cursor-pointer list-none">
534 <div class="collapse-trigger hidden group-open/comments:block absolute -left-8 top-0 bottom-0 w-16 transition-colors flex items-center justify-center group/border z-4">
535 <div class="absolute left-1/2 -translate-x-1/2 top-0 bottom-0 w-0.5 group-open/comments:bg-gray-200 dark:group-open/comments:bg-gray-700 group-has-[.collapse-trigger:hover]/collapse:bg-gray-400 dark:group-has-[.collapse-trigger:hover]/collapse:bg-gray-500 transition-colors"> </div>
536 </div>
537 <div class="group-open/comments:hidden block relative group/summary py-4">
538 <div class="absolute -left-8 top-0 bottom-0 w-16 transition-colors flex items-center justify-center z-4">
539 <div class="absolute left-1/2 -translate-x-1/2 h-1/3 top-0 bottom-0 w-0.5 bg-gray-200 dark:bg-gray-700 group-hover/summary:bg-gray-400 dark:group-hover/summary:bg-gray-500 transition-colors"></div>
540 </div>
541 <span class="text-gray-500 dark:text-gray-400 text-sm group-hover/summary:text-gray-600 dark:group-hover/summary:text-gray-300 transition-colors flex items-center gap-2 -ml-2 relative">
542 {{ i "circle-plus" "size-4 z-5" }}
543 Expand {{ $c }} comment{{ if ne $c 1 }}s{{ end }}
544 </span>
545 </div>
546 </summary>
547 <div>
548 {{ range $item.Comments }}
549 {{ template "comment"
550 (dict "LoggedInUser" $root.LoggedInUser
551 "Reactions" (index (asReactionMapMap $root.Reactions) .FeedCommentAtUri)
552 "UserReacted" (index (asReactionStatusMapMap $root.UserReacted) .FeedCommentAtUri)
553 "VouchRelationship" (index $root.VouchRelationships .Did)
554 "Comment" .) }}
555 {{ end }}
556 </div>
557 {{ if gt $c 0}}
558 <button class="collapse-trigger flex items-center gap-2 -ml-2 relative cursor-pointer text-sm text-gray-500 dark:text-gray-400 group-has-[.collapse-trigger:hover]/collapse:text-gray-600 dark:group-has-[.collapse-trigger:hover]/collapse:text-gray-300 mt-4 pb-4 transition-colors" hx-on:click="this.closest('details').open = false">
559 <span class="bg-gray-50 dark:bg-slate-900 dark:rounded-full">{{ i "circle-chevron-up" "size-4 z-5" }}</span> Collapse comment{{ if ne $c 1 }}s{{ end }}
560 </button>
561 {{ end }}
562
563 <div class="relative -ml-10">
564 {{ if eq $lastIdx $item.RoundNumber }}
565 {{ block "mergeStatus" $root }} {{ end }}
566 <div id="resubmit-banner"></div>
567 {{ end }}
568 </div>
569 <div hx-include="this" class="relative -ml-10 bg-gray-50 dark:bg-gray-900">
570 {{ if $root.LoggedInUser }}
571 <input name="subject-uri" type="hidden" value="{{ $root.Pull.AtUri }}">
572 <input name="pull-round-idx" type="hidden" value="{{ $item.RoundNumber }}">
573 {{ end }}
574 {{ template "repo/pulls/fragments/pullActions"
575 (dict
576 "LoggedInUser" $root.LoggedInUser
577 "Pull" $root.Pull
578 "RepoInfo" $root.RepoInfo
579 "RoundNumber" $item.RoundNumber
580 "MergeCheck" $root.MergeCheck
581 "ResubmitCheck" $root.ResubmitCheck
582 "BranchDeleteStatus" $root.BranchDeleteStatus
583 "Stack" $root.Stack
584 "Loading" (eq $lastIdx $item.RoundNumber)) }}
585 </div>
586 </details>
587{{ end }}
588
589{{ define "comment" }}
590<div class="flex gap-2 -ml-4 py-4 w-full mx-auto group/comment">
591 <!-- left column: profile picture -->
592 <div class="flex-shrink-0 h-fit relative">
593 {{ template "user/fragments/picLink" (list .Comment.Did.String "size-8") }}
594 </div>
595 <!-- right column: name and body in two rows -->
596 <div class="flex-1 min-w-0">
597 {{ template "fragments/comment/commentHeader" . }}
598 {{ template "fragments/comment/commentBody" . }}
599 </div>
600</div>
601{{ end }}
602
603{{ define "loginPrompt" }}
604 <div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded shadow-sm p-2 relative flex gap-2 items-center">
605 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2">
606 Sign up
607 </a>
608 <span class="text-gray-500 dark:text-gray-400">or</span>
609 <a href="/login" class="underline">Login</a>
610 to add to the discussion
611 </div>
612{{ end }}