diff --git a/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts b/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts index 9936c4a1..03d3f510 100644 --- a/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts +++ b/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts @@ -27,7 +27,12 @@ export async function getPostPageData(uri: string) { const postUrl = `https://${pubRecord?.base_path}/${rkey}`; const constellationBacklinks = await getConstellationBacklinks(postUrl); - // Combine database mentions and constellation backlinks + // Deduplicate constellation backlinks (same post could appear in both links and embeds) + const uniqueBacklinks = Array.from( + new Map(constellationBacklinks.map((b) => [b.uri, b])).values(), + ); + + // Combine database mentions (already deduplicated by DB constraint) and constellation backlinks const quotesAndMentions: { uri: string; link?: string }[] = [ // Database mentions (quotes with link to quoted content) ...document.document_mentions_in_bsky.map((m) => ({ @@ -35,7 +40,7 @@ export async function getPostPageData(uri: string) { link: m.link, })), // Constellation backlinks (direct post mentions without quote context) - ...constellationBacklinks, + ...uniqueBacklinks, ]; return { -- 2.51.2 From 9fb4d20cafdef75e8d67459a39238c17d53ccc68 Mon Sep 17 00:00:00 2001 From: celine Date: Tue, 4 Nov 2025 16:06:09 -0500 Subject: [PATCH 2/2] added a publish button if you don't have pubs yet --- .../home/Actions/CreateNewButton.tsx | 2 + app/(home-pages)/home/HomeLayout.tsx | 27 +------ app/globals.css | 5 ++ app/login/LoginForm.tsx | 25 +++--- components/ActionBar/Navigation.tsx | 5 +- components/ActionBar/Publications.tsx | 81 +++++++++++++++++-- components/LoginButton.tsx | 2 + 7 files changed, 103 insertions(+), 44 deletions(-) diff --git a/app/(home-pages)/home/Actions/CreateNewButton.tsx b/app/(home-pages)/home/Actions/CreateNewButton.tsx index be84e719..33ab9e3d 100644 --- a/app/(home-pages)/home/Actions/CreateNewButton.tsx +++ b/app/(home-pages)/home/Actions/CreateNewButton.tsx @@ -51,6 +51,8 @@ export const CreateNewLeafletButton = (props: {}) => { return ( )} {signingWithHandle ? ( -
+
setHandle(e.target.value)} required /> - - - Sign In - + Sign In
) : ( -
- - - Log In/Sign Up with Bluesky +
+ + {props.compact ? : } + {props.compact ? "Link" : "Log In/Sign Up with"} Bluesky
)} diff --git a/components/ActionBar/Navigation.tsx b/components/ActionBar/Navigation.tsx index 1d996b46..93575b06 100644 --- a/components/ActionBar/Navigation.tsx +++ b/components/ActionBar/Navigation.tsx @@ -93,7 +93,10 @@ const NavigationOptions = (props: { diff --git a/components/ActionBar/Publications.tsx b/components/ActionBar/Publications.tsx index f38cd4ce..a16f8aee 100644 --- a/components/ActionBar/Publications.tsx +++ b/components/ActionBar/Publications.tsx @@ -10,6 +10,11 @@ import { AtUri } from "@atproto/syntax"; import { ActionButton } from "./ActionButton"; import { SpeedyLink } from "components/SpeedyLink"; import { PublishSmall } from "components/Icons/PublishSmall"; +import { Popover } from "components/Popover"; +import { BlueskyLogin } from "app/login/LoginForm"; +import { ButtonPrimary } from "components/Buttons"; +import { useIsMobile } from "src/hooks/isMobile"; +import { useState } from "react"; export const PublicationButtons = (props: { currentPubUri: string | undefined; @@ -18,13 +23,11 @@ export const PublicationButtons = (props: { // don't show pub list button if not logged in or no pub list // we show a "start a pub" banner instead - if (!identity || !identity.atp_did) return ; + if (!identity || !identity.atp_did || identity.publications.length === 0) + return ; return (
{identity.publications?.map((d) => { - // console.log("thisURI : " + d.uri); - // console.log("currentURI : " + props.currentPubUri); - return ( { - return ( - + let { identity } = useIdentityData(); + let isMobile = useIsMobile(); + + let [state, setState] = useState<"default" | "info">("default"); + if (isMobile && state == "default") + return ( } nav - subtext="Blog on ATProto!" + subtext="Start a blog on ATProto!" + onClick={() => { + setState("info"); + }} /> - + ); + + if (isMobile && state === "info") return ; + else + return ( + } + nav + subtext="Start a blog on ATProto!" + /> + } + > + + + ); +}; + +const PublishPopoverContent = () => { + let { identity } = useIdentityData(); + + return ( +
+
+ +
+
Publish on AT Proto
+ {identity && identity.atp_did ? ( + // has ATProto account and no pubs + <> +
+ Start a new publication
+ on AT Proto +
+ + + Start a Publication! + + + + ) : ( + // no ATProto account and no pubs + <> +
+ Link a Bluesky account to start a new publication on AT Proto +
+ + + + )} +
); }; diff --git a/components/LoginButton.tsx b/components/LoginButton.tsx index c3471052..6c240026 100644 --- a/components/LoginButton.tsx +++ b/components/LoginButton.tsx @@ -29,6 +29,8 @@ export function LoginActionButton() { return ( } label="Sign In" /> }