diff --git a/public/at/did:plc:4hqjfn7m6n5hno3doamuhgef/ai.syui.gpt.memory/index.json b/public/at/did:plc:4hqjfn7m6n5hno3doamuhgef/ai.syui.gpt.memory/index.json index 5f49b38..6cb354d 100644 --- a/public/at/did:plc:4hqjfn7m6n5hno3doamuhgef/ai.syui.gpt.memory/index.json +++ b/public/at/did:plc:4hqjfn7m6n5hno3doamuhgef/ai.syui.gpt.memory/index.json @@ -35,6 +35,5 @@ "3mhm7lcyvpm2z", "3mhm7litch332", "3mhm7lrzmep33", - "3mhme7m5cxj34", - "list" + "3mhme7m5cxj34" ] \ No newline at end of file diff --git a/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.gpt.memory/index.json b/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.gpt.memory/index.json index 5f49b38..6cb354d 100644 --- a/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.gpt.memory/index.json +++ b/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.gpt.memory/index.json @@ -35,6 +35,5 @@ "3mhm7lcyvpm2z", "3mhm7litch332", "3mhm7lrzmep33", - "3mhme7m5cxj34", - "list" + "3mhme7m5cxj34" ] \ No newline at end of file diff --git a/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.log.chat/index.json b/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.log.chat/index.json index 2f3dcab..ee68a4a 100644 --- a/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.log.chat/index.json +++ b/public/at/did:plc:6qyecktefllvenje24fcxnie/ai.syui.log.chat/index.json @@ -150,6 +150,5 @@ "3mhmdm05bt23", "3mhmdm06bt23", "3mhmdm07bt23", - "3mhmdm08bt23", - "list" + "3mhmdm08bt23" ] \ No newline at end of file diff --git a/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.chat/index.json b/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.chat/index.json index 650957d..60fa80c 100644 --- a/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.chat/index.json +++ b/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.chat/index.json @@ -150,6 +150,5 @@ "3mhmdm05us22", "3mhmdm06us22", "3mhmdm07us22", - "3mhmdm08us22", - "list" + "3mhmdm08us22" ] \ No newline at end of file diff --git a/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/index.json b/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/index.json index 0c62e11..1e53c31 100644 --- a/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/index.json +++ b/public/at/did:plc:vzsvtbtbnwn22xjqhcu3vd6y/ai.syui.log.post/index.json @@ -1,5 +1,4 @@ [ "3mchqlshygs2s", - "3mf653plsl722", - "list" + "3mf653plsl722" ] \ No newline at end of file diff --git a/public/font/aifont.woff2 b/public/font/aifont.woff2 new file mode 100644 index 0000000..fc8e415 Binary files /dev/null and b/public/font/aifont.woff2 differ diff --git a/src/commands/index.rs b/src/commands/index.rs index d8bc5de..1477686 100644 --- a/src/commands/index.rs +++ b/src/commands/index.rs @@ -65,7 +65,7 @@ pub fn run(content_dir: &Path) -> Result<()> { if !filename.ends_with(".json") { continue; } - if filename == "index.json" || filename == "describe.json" || filename == "self.json" { + if filename == "index.json" || filename == "list.json" || filename == "describe.json" || filename == "self.json" { continue; } diff --git a/src/web/lib/api.ts b/src/web/lib/api.ts index bbc9ce0..1e6f2c8 100644 --- a/src/web/lib/api.ts +++ b/src/web/lib/api.ts @@ -176,7 +176,7 @@ async function getLocalPosts(did: string, collection: string): Promise { try { const listRes = await fetch(`/at/${did}/${collection}/list.json`) if (listRes.ok && isJsonResponse(listRes)) { - const posts: Post[] = await listRes.json() + const posts: Post[] = (await listRes.json()).filter((p: Post) => p && p.value && p.value.publishedAt) return posts.sort((a, b) => new Date(b.value.publishedAt).getTime() - new Date(a.value.publishedAt).getTime() ) @@ -195,7 +195,7 @@ async function getLocalPosts(did: string, collection: string): Promise { return null }) ) - const posts = results.filter((p): p is Post => p !== null) + const posts = results.filter((p): p is Post => p !== null && !!p.value && !!p.value.publishedAt) return posts.sort((a, b) => new Date(b.value.publishedAt).getTime() - new Date(a.value.publishedAt).getTime() ) @@ -221,7 +221,7 @@ export async function getPosts(did: string, collection: string, localOnly = fals const res = await fetchWithTimeout(url, {}, 8000) if (res.ok) { const data: ListRecordsResponse = await res.json() - return data.records.sort((a, b) => + return data.records.filter(r => r && r.value && r.value.publishedAt).sort((a, b) => new Date(b.value.publishedAt).getTime() - new Date(a.value.publishedAt).getTime() ) } @@ -451,6 +451,7 @@ export async function getChatMessages( ]) const messages = [...userMessages, ...botMessages] + .filter(m => m && m.value && m.value.publishedAt) // Sort by publishedAt return messages.sort((a, b) => diff --git a/src/web/styles/main.css b/src/web/styles/main.css index 44f1276..cd3dbd0 100644 --- a/src/web/styles/main.css +++ b/src/web/styles/main.css @@ -1,3 +1,9 @@ +@font-face { + font-family: 'aifont'; + src: url('/font/aifont.woff2') format('woff2'); + font-display: swap; +} + :root { --btn-color: #0066cc; } @@ -9,7 +15,7 @@ } body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; + font-family: 'aifont', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #1a1a1a; background: #fff;