From 8d4795369bd7f17db68f79e8b91d6751f480bba5 Mon Sep 17 00:00:00 2001 From: Johanna Larsson Date: Fri, 03 Jul 2026 13:50:15 +0000 Subject: [PATCH] Add pdsls links on rkeys Also puts your did on the bottom right. Just trying to make it clearer that this is your data, without me having to recreate a whole atproto viewer. --- lib/annot_at/atproto.ex | 17 +++++++++++++++++ lib/annot_at/atproto/standard_site.ex | 7 +++++++ lib/annot_at_web/components/layouts.ex | 12 ++++++++---- lib/annot_at_web/controllers/live/login_live.ex | 8 +++++++- lib/annot_at_web/controllers/live/site_live.ex | 36 ++++++++++++++++++++++++------------ 5 file(s) changed, 63 insertion(s)(+), 17 deletion(s)(-) diff --git a/lib/annot_at/atproto.ex b/lib/annot_at/atproto.ex new file mode 100644 --- /dev/null +++ b/lib/annot_at/atproto.ex @@ -0,0 +1,17 @@ +defmodule AnnotAt.Atproto do + @moduledoc """ + atproto is the protocol that underpins all of the functionality + in this service. + + https://atproto.com/ + """ + + @inspect_site "https://pdsls.dev/" + + @doc """ + Let users inspect their records. + """ + def inspect_url(aturi) do + @inspect_site <> aturi + end +end diff --git a/lib/annot_at/atproto/standard_site.ex b/lib/annot_at/atproto/standard_site.ex --- a/lib/annot_at/atproto/standard_site.ex +++ b/lib/annot_at/atproto/standard_site.ex @@ -126,6 +126,13 @@ } end + @doc """ + Construct an at-uri for a document, useful when referencing documents. + """ + def document_uri(did, rkey) do + "at://#{did}/site.standard.document/#{rkey}" + end + defp fetch_user(user_id) do case Accounts.get_user(user_id) do nil -> {:error, :no_session} diff --git a/lib/annot_at_web/components/layouts.ex b/lib/annot_at_web/components/layouts.ex --- a/lib/annot_at_web/components/layouts.ex +++ b/lib/annot_at_web/components/layouts.ex @@ -80,9 +80,7 @@