dev vouch dev on at. thats about it atvouch.dev
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

link to dids instead of handles

handles are ephemeral

authored by

Luna and committed by tangled.org f2d62514 a88f8408

+25 -25
+3 -3
appview/lib/atvouch/tangled/comment_builder.ex
··· 58 58 defp did_link(did, handle_map) do 59 59 case Map.get(handle_map, did) do 60 60 handle when is_binary(handle) and handle != "" -> 61 - "[@#{handle}](https://bsky.app/profile/#{handle})" 61 + "[@#{handle}](https://bsky.app/profile/#{did})" 62 62 63 63 _ -> 64 64 "[#{did}](https://bsky.app/profile/#{did})" 65 65 end 66 66 end 67 67 68 - defp display_name_link(_did, handle) when is_binary(handle) and handle != "" do 69 - "[@#{handle}](https://bsky.app/profile/#{handle})" 68 + defp display_name_link(did, handle) when is_binary(handle) and handle != "" do 69 + "[@#{handle}](https://bsky.app/profile/#{did})" 70 70 end 71 71 72 72 defp display_name_link(did, _handle), do: "`#{did}`"
+3 -3
appview/test/atvouch/pull_handler_test.exs
··· 216 216 assert comment.handle == "repoowner.test" 217 217 assert comment.rkey == "testrepo" 218 218 assert comment.number == 1 219 - assert comment.body =~ "atvouch routes for [@author.test](https://bsky.app/profile/author.test)" 220 - assert comment.body =~ "[@maintainer1.test](https://bsky.app/profile/maintainer1.test)" 219 + assert comment.body =~ "atvouch routes for [@author.test](https://bsky.app/profile/did:plc:author)" 220 + assert comment.body =~ "[@maintainer1.test](https://bsky.app/profile/did:plc:maintainer1)" 221 221 assert comment.body =~ "direct vouch" 222 - assert comment.body =~ "[@maintainer2.test](https://bsky.app/profile/maintainer2.test)" 222 + assert comment.body =~ "[@maintainer2.test](https://bsky.app/profile/did:plc:maintainer2)" 223 223 224 224 # Verify dedup record was created 225 225 assert Atvouch.BotComment.exists?(repo_at_uri, 1)
+14 -14
appview/test/atvouch/tangled/comment_builder_test.exs
··· 21 21 routes = [{@alice_did, "alice.test", {:self, @alice_did}}] 22 22 result = CommentBuilder.build_comment(@author_did, "author.test", routes, @handle_map) 23 23 24 - assert result =~ "**[@alice.test](https://bsky.app/profile/alice.test)** is a maintainer" 24 + assert result =~ "**[@alice.test](https://bsky.app/profile/did:plc:alice)** is a maintainer" 25 25 end 26 26 27 27 test "formats self route with nil handle" do ··· 35 35 routes = [{@alice_did, "alice.test", {:direct, @author_did}}] 36 36 result = CommentBuilder.build_comment(@author_did, "author.test", routes, @handle_map) 37 37 38 - assert result =~ "## atvouch routes for [@author.test](https://bsky.app/profile/author.test)" 39 - assert result =~ "**[@alice.test](https://bsky.app/profile/alice.test)**: direct vouch" 38 + assert result =~ "## atvouch routes for [@author.test](https://bsky.app/profile/did:plc:author)" 39 + assert result =~ "**[@alice.test](https://bsky.app/profile/did:plc:alice)**: direct vouch" 40 40 assert result =~ "generated by [atvouch]" 41 41 end 42 42 ··· 48 48 49 49 result = CommentBuilder.build_comment(@author_did, "author.test", routes, @handle_map) 50 50 51 - assert result =~ "**[@alice.test](https://bsky.app/profile/alice.test)**:" 52 - assert result =~ "- [@alice.test](https://bsky.app/profile/alice.test) -> [@bob.test](https://bsky.app/profile/bob.test) -> [@author.test](https://bsky.app/profile/author.test)" 51 + assert result =~ "**[@alice.test](https://bsky.app/profile/did:plc:alice)**:" 52 + assert result =~ "- [@alice.test](https://bsky.app/profile/did:plc:alice) -> [@bob.test](https://bsky.app/profile/did:plc:bob) -> [@author.test](https://bsky.app/profile/did:plc:author)" 53 53 end 54 54 55 55 test "formats multi-hop routes without handle map falls back to DIDs" do ··· 67 67 routes = [{@alice_did, "alice.test", {:routes, @author_did, []}}] 68 68 result = CommentBuilder.build_comment(@author_did, "author.test", routes, @handle_map) 69 69 70 - assert result =~ "**[@alice.test](https://bsky.app/profile/alice.test)**: no routes found" 70 + assert result =~ "**[@alice.test](https://bsky.app/profile/did:plc:alice)**: no routes found" 71 71 end 72 72 73 73 test "formats multiple maintainers with mixed results" do ··· 80 80 81 81 result = CommentBuilder.build_comment(@author_did, "author.test", routes, @handle_map) 82 82 83 - assert result =~ "**[@alice.test](https://bsky.app/profile/alice.test)**: direct vouch" 84 - assert result =~ "**[@bob.test](https://bsky.app/profile/bob.test)**:" 85 - assert result =~ "- [@bob.test](https://bsky.app/profile/bob.test) -> [@carol.test](https://bsky.app/profile/carol.test) -> [@author.test](https://bsky.app/profile/author.test)" 86 - assert result =~ "**[@dave.test](https://bsky.app/profile/dave.test)**: no routes found" 83 + assert result =~ "**[@alice.test](https://bsky.app/profile/did:plc:alice)**: direct vouch" 84 + assert result =~ "**[@bob.test](https://bsky.app/profile/did:plc:bob)**:" 85 + assert result =~ "- [@bob.test](https://bsky.app/profile/did:plc:bob) -> [@carol.test](https://bsky.app/profile/did:plc:carol) -> [@author.test](https://bsky.app/profile/did:plc:author)" 86 + assert result =~ "**[@dave.test](https://bsky.app/profile/did:plc:dave)**: no routes found" 87 87 end 88 88 89 89 test "falls back to DID when handle is nil" do ··· 111 111 result = CommentBuilder.build_comment(@author_did, "author.test", routes, @handle_map) 112 112 113 113 assert result =~ 114 - "- [@alice.test](https://bsky.app/profile/alice.test) -> [@bob.test](https://bsky.app/profile/bob.test) -> [@carol.test](https://bsky.app/profile/carol.test) -> [@author.test](https://bsky.app/profile/author.test)" 114 + "- [@alice.test](https://bsky.app/profile/did:plc:alice) -> [@bob.test](https://bsky.app/profile/did:plc:bob) -> [@carol.test](https://bsky.app/profile/did:plc:carol) -> [@author.test](https://bsky.app/profile/did:plc:author)" 115 115 end 116 116 117 117 test "formats multiple routes for one maintainer" do ··· 126 126 127 127 result = CommentBuilder.build_comment(@author_did, "author.test", routes, @handle_map) 128 128 129 - assert result =~ "- [@alice.test](https://bsky.app/profile/alice.test) -> [@bob.test](https://bsky.app/profile/bob.test) -> [@author.test](https://bsky.app/profile/author.test)" 130 - assert result =~ "- [@alice.test](https://bsky.app/profile/alice.test) -> [@carol.test](https://bsky.app/profile/carol.test) -> [@author.test](https://bsky.app/profile/author.test)" 129 + assert result =~ "- [@alice.test](https://bsky.app/profile/did:plc:alice) -> [@bob.test](https://bsky.app/profile/did:plc:bob) -> [@author.test](https://bsky.app/profile/did:plc:author)" 130 + assert result =~ "- [@alice.test](https://bsky.app/profile/did:plc:alice) -> [@carol.test](https://bsky.app/profile/did:plc:carol) -> [@author.test](https://bsky.app/profile/did:plc:author)" 131 131 end 132 132 133 133 test "partial handle map resolves known DIDs and falls back for unknown" do ··· 143 143 144 144 result = CommentBuilder.build_comment(@author_did, "author.test", routes, partial_map) 145 145 146 - assert result =~ "[@alice.test](https://bsky.app/profile/alice.test) -> [#{@bob_did}](https://bsky.app/profile/#{@bob_did}) -> [@author.test](https://bsky.app/profile/author.test)" 146 + assert result =~ "[@alice.test](https://bsky.app/profile/did:plc:alice) -> [#{@bob_did}](https://bsky.app/profile/#{@bob_did}) -> [@author.test](https://bsky.app/profile/did:plc:author)" 147 147 end 148 148 end
+5 -5
frontend/src/App.tsx
··· 303 303 <li key={v.rkey}> 304 304 {v.valid ? ( 305 305 <> 306 - <a className="vouch-handle" href={`https://bsky.app/profile/${v.handle ?? v.did}`} target="_blank" rel="noopener noreferrer">{v.handle ?? v.did}</a> 306 + <a className="vouch-handle" href={`https://bsky.app/profile/${v.did}`} target="_blank" rel="noopener noreferrer">{v.handle ?? v.did}</a> 307 307 <span className="vouch-date"> 308 308 {new Date(v.createdAt).toISOString().slice(0, 10)} 309 309 </span> ··· 542 542 <li key={v.did}> 543 543 <a 544 544 className="vouch-handle" 545 - href={`https://bsky.app/profile/${v.handle ?? v.did}`} 545 + href={`https://bsky.app/profile/${v.did}`} 546 546 target="_blank" 547 547 rel="noopener noreferrer" 548 548 > ··· 798 798 <img className="maintainer-avatar" src={info.avatar} alt="" /> 799 799 )} 800 800 <a 801 - href={`https://bsky.app/profile/${info?.handle ?? did}`} 801 + href={`https://bsky.app/profile/${did}`} 802 802 target="_blank" 803 803 rel="noopener noreferrer" 804 804 > ··· 940 940 handle: string; 941 941 }) { 942 942 if (result.directVouch) { 943 - return <pre className="success">you -&gt; <a href={`https://bsky.app/profile/${handle}`} target="_blank" rel="noopener noreferrer">{handle}</a></pre>; 943 + return <pre className="success">you -&gt; <a href={`https://bsky.app/profile/${result.targetDID}`} target="_blank" rel="noopener noreferrer">{handle}</a></pre>; 944 944 } 945 945 946 946 if (result.paths.length === 0) { ··· 959 959 return ( 960 960 <span key={did}> 961 961 {j > 0 && " -> "} 962 - <a href={`https://bsky.app/profile/${label}`} target="_blank" rel="noopener noreferrer">{label}</a> 962 + <a href={`https://bsky.app/profile/${did}`} target="_blank" rel="noopener noreferrer">{label}</a> 963 963 </span> 964 964 ); 965 965 })}