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