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 @@
- <.form for={@form} phx-change="suggest" phx-submit="login" class="mt-6 space-y-4">
+ <.form
+ for={@form}
+ id="login-form"
+ phx-change="suggest"
+ phx-submit="login"
+ class="mt-6 space-y-4"
+ >
- <.site_cards site={@site} record={@record} feed={@feed} />
+ <.site_cards site={@site} record={@record} feed={@feed} did={@current_scope.user.did} />
<% :feed -> %>
<.feed_step feeds={@feeds} />
<% :publication -> %>
@@ -86,8 +86,7 @@
siteā¦
<:failed :let={_}>
- Couldn't read your
- site.
+ Couldn't read your site.
@@ -557,16 +556,21 @@
end
attr :label, :string, required: true
- attr :value, :string, default: nil
+ attr :value, :string, required: true
+ attr :href, :string, default: nil
defp record_field(assigns) do
~H"""
-
{@label}
- {@value}
- Not set
- yet
+ {@label}
+
+ <%= if @href do %>
+ <.link class="underline" href={@href}>{@value}
+ <% else %>
+ {@value}
+ <% end %>
+
+ Not set yet
"""
end
@@ -574,6 +578,7 @@
attr :site, :map, required: true
attr :record, :any, required: true
attr :feed, :any, required: true
+ attr :did, :string, required: true
defp site_cards(assigns) do
~H"""
@@ -582,8 +587,7 @@
<:badge>
<.icon name="hero-clock" class="size-3.5" /> Checked just now
@@ -654,7 +658,15 @@
- <.record_field label="rkey" value={@site.rkey} />
+ <.record_field
+ label="rkey"
+ value={@site.rkey}
+ href={
+ AnnotAt.Atproto.inspect_url(
+ AnnotAt.Atproto.StandardSite.publication_uri(@did, @site.rkey)
+ )
+ }
+ />
<.record_field label="Name" value={record["name"]} />
<.record_field label="URL" value={record["url"]} />
<.record_field label="Description" value={record["description"]} />
--
tangled.sh