From cda82035d9ee82d7836ecb4456a5c613348a837a Mon Sep 17 00:00:00 2001
From: Casey <hatkidchan@gmail.com>
Date: Mon, 12 May 2025 21:53:58 +0300
Subject: [PATCH 1/5] Hopefully made it show profiles without profile

---
 src/lib/pdsfetch.ts | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/lib/pdsfetch.ts b/src/lib/pdsfetch.ts
index 20120fb..6caca73 100644
--- a/src/lib/pdsfetch.ts
+++ b/src/lib/pdsfetch.ts
@@ -133,6 +133,13 @@ const getAccountMetadata = async (
   did: `did:${string}:${string}`,
 ) => {
   // gonna assume self exists in the app.bsky.actor.profile
+  const account: AccountMetadata = {
+    did: did,
+    handle: "",
+    displayName: "",
+    avatarCid: null,
+  };
+
   try {
     const { data } = await rpc.get("com.atproto.repo.getRecord", {
       params: {
@@ -142,21 +149,22 @@ const getAccountMetadata = async (
       },
     });
     const value = data.value as AppBskyActorProfile.Record;
-    const handle = await blueskyHandleFromDid(did);
-    const account: AccountMetadata = {
-      did: did,
-      handle: handle,
-      displayName: value.displayName || "",
-      avatarCid: null,
-    };
+    account.displayName = value.displayName || "";
     if (value.avatar) {
       account.avatarCid = value.avatar.ref["$link"];
     }
-    return account;
   } catch (e) {
-    console.error(`Error fetching metadata for ${did}:`, e);
+    console.warn(`Error fetching profile for ${did}:`, e);
+  }
+
+  try {
+    account.handle = await blueskyHandleFromDid(did);
+  } catch (e) {
+    console.error(`Error fetching handle for ${did}:`, e);
     return null;
   }
+
+  return account;
 };
 
 const getAllMetadataFromPds = async (): Promise<AccountMetadata[]> => {

From 2ffb5d7b28059ffec60a12380978990e42a84473 Mon Sep 17 00:00:00 2001
From: Casey <hatkidchan@gmail.com>
Date: Mon, 12 May 2025 22:16:20 +0300
Subject: [PATCH 2/5] Shift the name a bit so it lines up

---
 src/lib/AccountComponent.svelte | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/lib/AccountComponent.svelte b/src/lib/AccountComponent.svelte
index 880db3f..01ac750 100644
--- a/src/lib/AccountComponent.svelte
+++ b/src/lib/AccountComponent.svelte
@@ -12,10 +12,14 @@
         alt="avatar of {account.displayName}"
         src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={account.did}&cid={account.avatarCid}"
       />
+      <div id="accountName">
+        {account.displayName || account.handle || account.did}
+      </div>
+    {:else}
+      <div id="accountName" class="no-avatar">
+        {account.displayName || account.handle || account.did}
+      </div>
     {/if}
-    <div id="accountName">
-      {account.displayName || account.handle || account.did}
-    </div>
   </div>
 </a>
 
@@ -28,6 +32,7 @@
     padding: 0px;
     margin-bottom: 15px;
     border: 1px solid var(--border-color);
+    min-height: 50px;
   }
   #accountName {
     margin-left: 10px;
@@ -39,6 +44,9 @@
     text-overflow: ellipsis;
     white-space: nowrap;
   }
+  .no-avatar {
+    margin-left: 60px !important;
+  }
   #avatar {
     width: 50px;
     height: 50px;

From 827a59e95884f093104e34615f7b464653c76ff4 Mon Sep 17 00:00:00 2001
From: Casey <hatkidchan@gmail.com>
Date: Thu, 15 May 2025 14:13:34 +0300
Subject: [PATCH 3/5] Removed the comment that is no longer true

---
 src/lib/pdsfetch.ts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/lib/pdsfetch.ts b/src/lib/pdsfetch.ts
index 6caca73..d57aff4 100644
--- a/src/lib/pdsfetch.ts
+++ b/src/lib/pdsfetch.ts
@@ -132,10 +132,9 @@ const getDidsFromPDS = async (): Promise<At.Did[]> => {
 const getAccountMetadata = async (
   did: `did:${string}:${string}`,
 ) => {
-  // gonna assume self exists in the app.bsky.actor.profile
   const account: AccountMetadata = {
     did: did,
-    handle: "",
+    handle: "", // Guaranteed to be filled out later
     displayName: "",
     avatarCid: null,
   };

From 16f6410db3de8fc9e66f2f0e302ba8873668c818 Mon Sep 17 00:00:00 2001
From: Ari <ariadna@hey.com>
Date: Thu, 29 May 2025 22:47:44 -0400
Subject: [PATCH 4/5] Edited Express theme (the account list avatars are 30px
 there, not 60)

---
 themes/express/theme.css | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/express/theme.css b/themes/express/theme.css
index d36d189..58c399e 100644
--- a/themes/express/theme.css
+++ b/themes/express/theme.css
@@ -251,7 +251,7 @@ a:hover {
 }
 
 .no-avatar {
-    margin-left: 70px !important;
+    margin-left: 40px !important;
 }
 
 /* App.Svelte */

From c348ed5d46a0d95422ea6f4925420be8ff3ce8f0 Mon Sep 17 00:00:00 2001
From: Astra <me@astrra.space>
Date: Fri, 30 May 2025 03:05:05 +0000
Subject: [PATCH 5/5] Fix users with no profile record not being shown (#7)

Co-authored-by: Casey <hatkidchan@gmail.com>
Co-authored-by: Ari <ariadna@hey.com>
Reviewed-on: https://git.witchcraft.systems/scientific-witchery/pds-dash/pulls/7
Reviewed-by: Ariadna <ariadna@hey.com>
---
 src/lib/AccountComponent.svelte | 10 +++++++---
 src/lib/pdsfetch.ts             | 27 +++++++++++++++++----------
 themes/express/theme.css        |  5 +++++
 themes/witchcraft/theme.css     |  6 ++++++
 4 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/src/lib/AccountComponent.svelte b/src/lib/AccountComponent.svelte
index 3f12cf7..faf6251 100644
--- a/src/lib/AccountComponent.svelte
+++ b/src/lib/AccountComponent.svelte
@@ -12,10 +12,14 @@
         alt="avatar of {account.displayName}"
         src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={account.did}&cid={account.avatarCid}"
       />
+      <div id="accountName">
+        {account.displayName || account.handle || account.did}
+      </div>
+    {:else}
+      <div id="accountName" class="no-avatar">
+        {account.displayName || account.handle || account.did}
+      </div>
     {/if}
-    <div id="accountName">
-      {account.displayName || account.handle || account.did}
-    </div>
   </div>
 </a>
 
diff --git a/src/lib/pdsfetch.ts b/src/lib/pdsfetch.ts
index 20120fb..d57aff4 100644
--- a/src/lib/pdsfetch.ts
+++ b/src/lib/pdsfetch.ts
@@ -132,7 +132,13 @@ const getDidsFromPDS = async (): Promise<At.Did[]> => {
 const getAccountMetadata = async (
   did: `did:${string}:${string}`,
 ) => {
-  // gonna assume self exists in the app.bsky.actor.profile
+  const account: AccountMetadata = {
+    did: did,
+    handle: "", // Guaranteed to be filled out later
+    displayName: "",
+    avatarCid: null,
+  };
+
   try {
     const { data } = await rpc.get("com.atproto.repo.getRecord", {
       params: {
@@ -142,21 +148,22 @@ const getAccountMetadata = async (
       },
     });
     const value = data.value as AppBskyActorProfile.Record;
-    const handle = await blueskyHandleFromDid(did);
-    const account: AccountMetadata = {
-      did: did,
-      handle: handle,
-      displayName: value.displayName || "",
-      avatarCid: null,
-    };
+    account.displayName = value.displayName || "";
     if (value.avatar) {
       account.avatarCid = value.avatar.ref["$link"];
     }
-    return account;
   } catch (e) {
-    console.error(`Error fetching metadata for ${did}:`, e);
+    console.warn(`Error fetching profile for ${did}:`, e);
+  }
+
+  try {
+    account.handle = await blueskyHandleFromDid(did);
+  } catch (e) {
+    console.error(`Error fetching handle for ${did}:`, e);
     return null;
   }
+
+  return account;
 };
 
 const getAllMetadataFromPds = async (): Promise<AccountMetadata[]> => {
diff --git a/themes/express/theme.css b/themes/express/theme.css
index cbc2336..58c399e 100644
--- a/themes/express/theme.css
+++ b/themes/express/theme.css
@@ -237,6 +237,7 @@ a:hover {
   margin-right: 4px;
   border: 4px solid var(--border-color);
   box-shadow: var(--border-color) 10px 10px;
+  min-height: 30px;
 }
 #accountName {
   margin-left: 10px;
@@ -249,6 +250,10 @@ a:hover {
   white-space: nowrap;
 }
 
+.no-avatar {
+    margin-left: 40px !important;
+}
+
 /* App.Svelte */
 /* desktop style */
 
diff --git a/themes/witchcraft/theme.css b/themes/witchcraft/theme.css
index cd15805..8ad63d4 100644
--- a/themes/witchcraft/theme.css
+++ b/themes/witchcraft/theme.css
@@ -235,6 +235,7 @@ a:hover {
   padding: 0px;
   margin-bottom: 15px;
   border: 1px solid var(--border-color);
+  min-height: 30px;
 }
 #accountName {
   margin-left: 10px;
@@ -247,6 +248,11 @@ a:hover {
   white-space: nowrap;
 }
 
+
+.no-avatar {
+    margin-left: 70px !important;
+}
+
 /* App.Svelte */
 /* desktop style */