ATProto Browser

ATProto Browser

Experimental browser for the Atmosphere

Record data

{
  "uri": "at://did:plc:hwevmowznbiukdf6uk5dwrrq/sh.tangled.repo.pull/3lmomsgqjg222",
  "cid": "bafyreih7nnky5xyrzuhaucsnmoswhytxwhgtl27nl4fxnsghygatenyuyu",
  "value": {
    "$type": "sh.tangled.repo.pull",
    "patch": "diff --git a/appview/pages/templates/fragments/pullActions.html b/appview/pages/templates/fragments/pullActions.html\nindex 4af59429dcac08ad25b687dfcaf57702840cd1cb..7b1d560b318955dbe823cd363ad55aec31aa89ed 100644\n--- a/appview/pages/templates/fragments/pullActions.html\n+++ b/appview/pages/templates/fragments/pullActions.html\n@@ -79,7 +79,7 @@         <button \n           hx-post=\"/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/reopen\"\n           hx-swap=\"none\"\n           class=\"btn p-2 flex items-center gap-2\">\n-          {{ i \"circle-dot\" \"w-4 h-4\" }}\n+          {{ i \"refresh-ccw-dot\" \"w-4 h-4\" }}\n             <span>reopen</span>\n         </button>\n         {{ end }}\ndiff --git a/appview/pages/templates/repo/issues/issue.html b/appview/pages/templates/repo/issues/issue.html\nindex 611d1707fa2d8f2d11c1f4c13dbb61cde5ad20fb..f083453d7d5caf4aeb324462bdbb61a4e9ba4a31 100644\n--- a/appview/pages/templates/repo/issues/issue.html\n+++ b/appview/pages/templates/repo/issues/issue.html\n@@ -45,7 +45,7 @@ {{ end }}\n \n {{ define \"repoAfter\" }}\n     {{ if gt (len .Comments) 0 }}\n-    <section id=\"comments\" class=\"my-4 space-y-2 relative\">\n+    <section id=\"comments\" class=\"my-2 mt-2 space-y-2 relative\">\n         {{ range $index, $comment := .Comments }}\n             <div\n                 id=\"comment-{{ .CommentId }}\"\n@@ -65,14 +65,13 @@ {{ end }}\n \n {{ define \"newComment\" }}\n   {{ if .LoggedInUser }}\n-\n   <form \n       id=\"comment-form\" \n       hx-post=\"/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment\"\n       hx-on::after-request=\"if(event.detail.successful) this.reset()\"\n   >\n     <div class=\"bg-white dark:bg-gray-800 rounded drop-shadow-sm py-4 px-4 relative w-full md:w-3/5\">\n-      <div class=\"absolute left-8 -top-4 w-px h-4 bg-gray-300 dark:bg-gray-600\"></div>\n+      <div class=\"absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600\"></div>\n       <div class=\"text-sm pb-2 text-gray-500 dark:text-gray-400\">\n         {{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}\n       </div>\n@@ -84,7 +83,6 @@               placeholder=\"Add to the discussion. Markdown is supported.\"\n               onkeyup=\"updateCommentForm()\"\n           ></textarea>\n           <div id=\"issue-comment\"></div>\n-          \n       <div id=\"issue-action\" class=\"error\"></div>\n     </div>\n     \n@@ -100,7 +98,7 @@         >\n             {{ i \"message-square-plus\" \"w-4 h-4\" }}\n             comment\n         </button>\n-        \n+\n         {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }}\n         {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }}\n         {{ if and (or $isIssueAuthor $isRepoCollaborator) (eq .State \"open\") }}\n@@ -119,16 +117,30 @@             hx-post=\"/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment\" \n             hx-trigger=\"click from:#close-button\" \n             hx-disabled-elt=\"#close-with-comment\"\n             hx-target=\"#issue-comment\"\n-            hx-vals=\"js:{body: document.getElementById('comment-textarea').value.trim() !== '' ? document.getElementById('comment-textarea').value : null}\">\n+            hx-vals=\"js:{body: document.getElementById('comment-textarea').value.trim() !== '' ? document.getElementById('comment-textarea').value : ''}\"\n+            hx-swap=\"none\"\n+        >\n         </div>\n         <div \n             id=\"close-issue\" \n             hx-disabled-elt=\"#close-issue\"\n             hx-post=\"/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/close\" \n-            hx-trigger=\"click from:#close-button, revealed from:#close-with-comment\" \n+            hx-trigger=\"click from:#close-button\" \n             hx-target=\"#issue-action\"\n-            hx-swap=\"none\">\n+            hx-swap=\"none\"\n+        >\n         </div>\n+        <script>\n+            document.addEventListener('htmx:configRequest', function(evt) {\n+                if (evt.target.id === 'close-with-comment') {\n+                    const commentText = document.getElementById('comment-textarea').value.trim();\n+                    if (commentText === '') {\n+                        evt.detail.parameters = {};\n+                        evt.preventDefault();\n+                    }\n+                }\n+            });\n+        </script>\n         {{ else if and (or $isIssueAuthor $isRepoCollaborator) (eq .State \"closed\") }}\n         <button \n             type=\"button\" \n@@ -136,23 +148,23 @@             class=\"btn flex items-center gap-2\"\n             hx-post=\"/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/reopen\"\n             hx-swap=\"none\"\n         >\n-            {{ i \"circle-dot\" \"w-4 h-4\" }}\n+            {{ i \"refresh-ccw-dot\" \"w-4 h-4\" }}\n             reopen\n         </button>\n         {{ end }}\n-        \n+\n         <script>\n         function updateCommentForm() {\n             const textarea = document.getElementById('comment-textarea');\n             const commentButton = document.getElementById('comment-button');\n             const closeButton = document.getElementById('close-button');\n-            \n+\n             if (textarea.value.trim() !== '') {\n                 commentButton.removeAttribute('disabled');\n             } else {\n                 commentButton.setAttribute('disabled', '');\n             }\n-            \n+\n             if (closeButton) {\n                 if (textarea.value.trim() !== '') {\n                     closeButton.innerHTML = '{{ i \"ban\" \"w-4 h-4\" }} close with comment';\n@@ -161,7 +173,7 @@                     closeButton.innerHTML = '{{ i \"ban\" \"w-4 h-4\" }} close';\n                 }\n             }\n         }\n-        \n+\n         document.addEventListener('DOMContentLoaded', function() {\n             updateCommentForm();\n         });\n@@ -169,7 +181,7 @@         </script>\n     </div>\n   </form> \n   {{ else }}\n-    <div class=\"bg-white dark:bg-gray-800 dark:text-gray-400 rounded drop-shadow-sm px-6 py-4 mt-8\">\n+    <div class=\"bg-white dark:bg-gray-800 rounded drop-shadow-sm py-4 px-4 relative w-fit\">\n       <div class=\"absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600\"></div>\n       <a href=\"/login\" class=\"underline\">login</a> to join the discussion\n     </div>\n",
    "title": "appview: pages/templates/repo: make issues more consistent with pulls",
    "pullId": 47,
    "source": {
      "branch": "push-xttmuzqzktwv"
    },
    "targetRepo": "at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.repo/3liuighjy2h22",
    "targetBranch": "master"
  }
}