Experimental browser for the Atmosphere
{ "uri": "at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3lmfkus4tws22", "cid": "bafyreiclr7pvv6aipvz662yc4srl4utt33olrlo3pyjg4w7h4tc44s7h64", "value": { "$type": "sh.tangled.repo.pull", "patch": "diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go\nindex 8d88604699bf29588e4d0013f82ff54d44e89999..ed2399abdddb7113c3c2707aa376bf47d119c221 100644\n--- a/appview/pages/funcmap.go\n+++ b/appview/pages/funcmap.go\n@@ -33,6 +33,10 @@ \t\t},\n \t\t\"add\": func(a, b int) int {\n \t\t\treturn a + b\n \t\t},\n+\t\t// the absolute state of go templates\n+\t\t\"add64\": func(a, b int64) int64 {\n+\t\t\treturn a + b\n+\t\t},\n \t\t\"sub\": func(a, b int) int {\n \t\t\treturn a - b\n \t\t},\ndiff --git a/appview/pages/templates/fragments/diff.html b/appview/pages/templates/fragments/diff.html\nindex 76bd445834b6983f2412abfbf9535218ad2a794b..0e4fd835185e78629bb76e62bb7716aec032459a 100644\n--- a/appview/pages/templates/fragments/diff.html\n+++ b/appview/pages/templates/fragments/diff.html\n@@ -81,27 +81,43 @@ <p class=\"text-center text-gray-400 dark:text-gray-500 p-4\">\n This is a binary file and will not be displayed.\n </p>\n {{ else }}\n- <pre class=\"overflow-x-auto\"><div class=\"overflow-x-auto\"><div class=\"min-w-full inline-block\">{{- range .TextFragments -}}<div class=\"bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 select-none\">{{- .Header -}}</div>{{- range .Lines -}}\n- {{- if eq .Op.String \"+\" -}}\n- <div class=\"bg-green-100 dark:bg-green-800/30 text-green-700 dark:text-green-400 flex min-w-full\">\n- <div class=\"w-10 flex-shrink-0 select-none p-1 text-center\">{{ .Op.String }}</div>\n- <div class=\"p-1 whitespace-pre\">{{ .Line }}</div>\n- </div>\n- {{- end -}}\n- {{- if eq .Op.String \"-\" -}}\n- <div class=\"bg-red-100 dark:bg-red-800/30 text-red-700 dark:text-red-400 flex min-w-full\">\n- <div class=\"w-10 flex-shrink-0 select-none p-1 text-center\">{{ .Op.String }}</div>\n- <div class=\"p-1 whitespace-pre\">{{ .Line }}</div>\n- </div>\n- {{- end -}}\n- {{- if eq .Op.String \" \" -}}\n- <div class=\"bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 flex min-w-full\">\n- <div class=\"w-10 flex-shrink-0 select-none p-1 text-center\">{{ .Op.String }}</div>\n- <div class=\"p-1 whitespace-pre\">{{ .Line }}</div>\n- </div>\n- {{- end -}}\n- {{- end -}}\n- {{- end -}}</div></div></pre>\n+ <pre class=\"overflow-x-auto\"><div class=\"overflow-x-auto\"><div class=\"min-w-full inline-block\">{{- range .TextFragments -}}<div class=\"bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 select-none text-center\">···</div>\n+ {{- $oldStart := .OldPosition -}}\n+ {{- $newStart := .NewPosition -}}\n+ {{- $lineNrStyle := \"min-w-[3rem] flex-shrink-0 select-none text-right\" -}}\n+ {{- $lineNrSepStyle1 := \"text-gray-400 dark:text-gray-500 bg-white dark:bg-gray-800\" -}}\n+ {{- $lineNrSepStyle2 := \"text-gray-400 dark:text-gray-500 bg-white dark:bg-gray-800 pr-2\" -}}\n+ {{- range .Lines -}}\n+ {{- if eq .Op.String \"+\" -}}\n+ <div class=\"bg-green-100 dark:bg-green-800/30 text-green-700 dark:text-green-400 flex min-w-full items-center\">\n+ <div class=\"{{$lineNrStyle}} {{$lineNrSepStyle1}}\"><span aria-hidden=\"true\" class=\"invisible\">{{$newStart}}</span></div>\n+ <div class=\"{{$lineNrStyle}} {{$lineNrSepStyle2}}\">{{ $newStart }}</div>\n+ <div class=\"w-5 flex-shrink-0 select-none text-center\">{{ .Op.String }}</div>\n+ <div class=\"px-2\">{{ .Line }}</div>\n+ </div>\n+ {{- $newStart = add64 $newStart 1 -}}\n+ {{- end -}}\n+ {{- if eq .Op.String \"-\" -}}\n+ <div class=\"bg-red-100 dark:bg-red-800/30 text-red-700 dark:text-red-400 flex min-w-full items-center\">\n+ <div class=\"{{$lineNrStyle}} {{$lineNrSepStyle1}}\">{{ $oldStart }}</div>\n+ <div class=\"{{$lineNrStyle}} {{$lineNrSepStyle2}}\"><span aria-hidden=\"true\" class=\"invisible\">{{$oldStart}}</span></div>\n+ <div class=\"w-5 flex-shrink-0 select-none text-center\">{{ .Op.String }}</div>\n+ <div class=\"px-2\">{{ .Line }}</div>\n+ </div>\n+ {{- $oldStart = add64 $oldStart 1 -}}\n+ {{- end -}}\n+ {{- if eq .Op.String \" \" -}}\n+ <div class=\"bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 flex min-w-full items-center\">\n+ <div class=\"{{$lineNrStyle}} {{$lineNrSepStyle1}}\">{{ $oldStart }}</div>\n+ <div class=\"{{$lineNrStyle}} {{$lineNrSepStyle2}}\">{{ $newStart }}</div>\n+ <div class=\"w-5 flex-shrink-0 select-none text-center\">{{ .Op.String }}</div>\n+ <div class=\"px-2\">{{ .Line }}</div>\n+ </div>\n+ {{- $newStart = add64 $newStart 1 -}}\n+ {{- $oldStart = add64 $oldStart 1 -}}\n+ {{- end -}}\n+ {{- end -}}\n+ {{- end -}}</div></div></pre>\n {{- end -}}\n {{ end }}\n </div>\ndiff --git a/appview/pages/templates/fragments/editRepoDescription.html b/appview/pages/templates/fragments/editRepoDescription.html\nindex d0c094b1a3f5820b6b56009a73e2dd764977d6ce..c931b9c29e0d6b2af75a48639175c93d81236d38 100644\n--- a/appview/pages/templates/fragments/editRepoDescription.html\n+++ b/appview/pages/templates/fragments/editRepoDescription.html\n@@ -1,10 +1,10 @@\n {{ define \"fragments/editRepoDescription\" }}\n <form hx-put=\"/{{ .RepoInfo.FullName }}/description\" hx-target=\"this\" hx-swap=\"outerHTML\" class=\"flex flex-wrap gap-2\">\n <input type=\"text\" class=\"p-1\" name=\"description\" value=\"{{ .RepoInfo.Description }}\">\n- <button type=\"submit\" class=\"btn p-2 flex items-center gap-2 no-underline text-sm\">\n+ <button type=\"submit\" class=\"btn p-1 flex items-center gap-2 no-underline text-sm\">\n {{ i \"check\" \"w-3 h-3\" }} save \n </button>\n- <button type=\"button\" class=\"btn p-2 flex items-center gap-2 no-underline text-sm\" hx-get=\"/{{ .RepoInfo.FullName }}/description\" >\n+ <button type=\"button\" class=\"btn p-1 flex items-center gap-2 no-underline text-sm\" hx-get=\"/{{ .RepoInfo.FullName }}/description\" >\n {{ i \"x\" \"w-3 h-3\" }} cancel \n </button>\n </form>\ndiff --git a/appview/pages/templates/fragments/repoDescription.html b/appview/pages/templates/fragments/repoDescription.html\nindex 9f292d065fa3677c8ab789de38d608a7b09473b6..4a6735fad637af44c7b89128d5609c2c58b40112 100644\n--- a/appview/pages/templates/fragments/repoDescription.html\n+++ b/appview/pages/templates/fragments/repoDescription.html\n@@ -1,5 +1,5 @@\n {{ define \"fragments/repoDescription\" }}\n-<span id=\"repo-description\" class=\"flex flex-wrap items-center gap-2\" hx-target=\"this\" hx-swap=\"outerHTML\">\n+<span id=\"repo-description\" class=\"flex flex-wrap items-center gap-2 text-sm\" hx-target=\"this\" hx-swap=\"outerHTML\">\n {{ if .RepoInfo.Description }}\n {{ .RepoInfo.Description }}\n {{ else }}\n@@ -7,8 +7,8 @@ <span class=\"italic\">this repo has no description</span>\n {{ end }}\n \n {{ if .RepoInfo.Roles.IsOwner }}\n- <button class=\"btn p-2 flex items-center gap-2 no-underline text-sm\" hx-get=\"/{{ .RepoInfo.FullName }}/description/edit\">\n- {{ i \"pencil\" \"w-3 h-3\" }} edit\n+ <button class=\"flex items-center gap-2 no-underline text-sm\" hx-get=\"/{{ .RepoInfo.FullName }}/description/edit\">\n+ {{ i \"pencil\" \"w-3 h-3\" }}\n </button>\n {{ end }}\n </span>\ndiff --git a/appview/pages/templates/repo/blob.html b/appview/pages/templates/repo/blob.html\nindex 18a2cdc717973e71d15876178c676badaf7c455c..d4c7643ad1a866b77683931c79beab50c6099ea7 100644\n--- a/appview/pages/templates/repo/blob.html\n+++ b/appview/pages/templates/repo/blob.html\n@@ -60,7 +60,7 @@ </p>\n {{ else }}\n <div class=\"overflow-auto relative\">\n {{ if .ShowRendered }}\n- <div id=\"blob-contents\" class=\"prose dark:prose-invert p-6\">{{ .RenderedContents }}</div>\n+ <div id=\"blob-contents\" class=\"prose dark:prose-invert\">{{ .RenderedContents }}</div>\n {{ else }}\n <div id=\"blob-contents\" class=\"whitespace-pre peer-target:bg-yellow-200 dark:peer-target:bg-yellow-900\">{{ $.Contents | escapeHtml }}</div>\n {{ end }}\n", "title": "appview: add line numbers to diffs", "pullId": 42, "source": { "branch": "diff-improvements" }, "targetRepo": "at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.repo/3liuighjy2h22", "targetBranch": "master" } }