Refactor photo embed analytics to post:photoEmbed:* namespace

Replaces the legacy post:gallery:* events, which only instrumented the
carousel layout (and so were biased by the PostGalleryEmbedEnable rollout)
with a coherent, layout-agnostic family that fires identically across the
single image, 2-4 image grid, and carousel renderers.

The new events all carry uri, authorDid, and an optional feedDescriptor,
and a layout discriminator ('single' | 'grid' | 'carousel') so opens and
impressions are directly comparable across layouts.

- post:photoEmbed:impression: fires once per mount of a post photo embed
- post:photoEmbed:open: fires from the shared onPress in ImageEmbed, so
  all three layouts emit it without per-layout duplication
- post:photoEmbed:carouselSwipe: in-feed carousel swipe (debounced)
- post:photoEmbed:lightboxSwipe: fires from the lightbox pager regardless
  of which layout opened it

The dead post:gallery:impression definition is removed, and
post:gallery:openLightbox / post:gallery:swipe are hard-removed with no
dual-emit period.

Quoted-post photos are attributed to the quoted post (quote.uri /
quote.author.did), not the surrounding post.
This commit is contained in:
vineyardbovines
2026-06-08 10:43:36 -04:00
parent 5c0429a3f7
commit 28bd708c6b
12 changed files with 136 additions and 17 deletions
+6
View File
@@ -429,6 +429,7 @@ let FeedItemInner = ({
onOpenEmbed={onOpenEmbed}
post={post}
additionalPostAlerts={additionalPostAlerts}
feedDescriptor={feedDescriptor}
/>
<PostControls
post={post}
@@ -460,6 +461,7 @@ let PostContent = ({
postAuthor,
onOpenEmbed,
additionalPostAlerts,
feedDescriptor,
}: {
moderation: ModerationDecision
richText: RichTextAPI
@@ -468,6 +470,7 @@ let PostContent = ({
onOpenEmbed: () => void
post: AppBskyFeedDefs.PostView
additionalPostAlerts?: AppModerationCause[]
feedDescriptor?: string
}): React.ReactNode => {
const [limitLines, setLimitLines] = useState(
() => countLines(richText.text) >= MAX_POST_LINES,
@@ -528,6 +531,9 @@ let PostContent = ({
moderation={moderation}
onOpen={onOpenEmbed}
viewContext={PostEmbedViewContext.Feed}
uri={post.uri}
authorDid={post.author.did}
feedDescriptor={feedDescriptor}
/>
</View>
) : null}