From 801832c6e5c339cd2b9c0e8f4028ad9c6a9a5922 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Thu, 19 Feb 2026 21:32:37 +0100 Subject: [PATCH] feat: handle absolute internal links for stacked notes --- src/components/StackedPublicNote.vue | 17 +++++------- src/hooks/useATProtoLinks.hook.ts | 39 +++++++++++++++++++++++----- src/utils/link.ts | 3 ++- src/views/PublicNoteView.vue | 2 +- 4 files changed, 42 insertions(+), 19 deletions(-) diff --git a/src/components/StackedPublicNote.vue b/src/components/StackedPublicNote.vue index dd02c68..7c081c4 100644 --- a/src/components/StackedPublicNote.vue +++ b/src/components/StackedPublicNote.vue @@ -9,18 +9,15 @@ import { getUrl } from "@/modules/atproto/getUrl" import { withATProtoImages } from "@/modules/atproto/withATProtoImages" import { getAuthor } from "@/modules/atproto/getAuthor" import { PublicNoteRecord } from "@/modules/atproto/publicNote.types" -import { parseAtUri } from "@/modules/atproto/parseAtUri" const props = defineProps<{ - atUri: string + didrkey: string index: number - title?: string }>() -const atUri = computed(() => props.atUri) -const atUriProps = computed(() => parseAtUri(atUri.value)) -const did = computed(() => atUriProps.value.did) -const rkey = computed(() => atUriProps.value.rkey) +const didrkey = computed(() => props.didrkey) +const did = computed(() => props.didrkey.split("-")[0]) +const rkey = computed(() => props.didrkey.split("-")[1]) const index = computed(() => props.index) @@ -33,7 +30,7 @@ const className = computed(() => `stacked-note-${props.index}`) const titleClassName = computed(() => `title-${className.value}`) const { scrollToFocusedNote } = useRouteQueryStackedNotes() -const { listenToClick } = useATProtoLinks(className.value, atUri) +const { listenToClick } = useATProtoLinks(className.value, didrkey) const { displayNoteOverlay } = useNoteOverlay(className.value, index) const noteRecord = computedAsync(async () => @@ -70,12 +67,12 @@ watch( :class="{ [className]: true, overlay: displayNoteOverlay, - [`note-${rkey}`]: true, + [`note-${didrkey}`]: true, }" >