From f391060a8d6039b0630724d6a445d45662f2d196 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 5 Aug 2026 22:50:50 +0300 Subject: [PATCH] update lexicons, update threaditempostnumber --- lexicons/app/bsky/unspecced/defs.json | 119 +++++------------- .../components/ThreadItemPostNumber.tsx | 6 +- 2 files changed, 37 insertions(+), 88 deletions(-) diff --git a/lexicons/app/bsky/unspecced/defs.json b/lexicons/app/bsky/unspecced/defs.json index 609de81f8f..3dd830a6d2 100644 --- a/lexicons/app/bsky/unspecced/defs.json +++ b/lexicons/app/bsky/unspecced/defs.json @@ -6,48 +6,31 @@ "type": "object", "required": ["uri"], "properties": { - "uri": { - "type": "string", - "format": "at-uri" - } + "uri": { "type": "string", "format": "at-uri" } } }, "skeletonSearchActor": { "type": "object", "required": ["did"], "properties": { - "did": { - "type": "string", - "format": "did" - } + "did": { "type": "string", "format": "did" } } }, "skeletonSearchStarterPack": { "type": "object", "required": ["uri"], "properties": { - "uri": { - "type": "string", - "format": "at-uri" - } + "uri": { "type": "string", "format": "at-uri" } } }, "trendingTopic": { "type": "object", "required": ["topic", "link"], "properties": { - "topic": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "description": { - "type": "string" - }, - "link": { - "type": "string" - } + "topic": { "type": "string" }, + "displayName": { "type": "string" }, + "description": { "type": "string" }, + "link": { "type": "string" } } }, "skeletonTrend": { @@ -61,32 +44,14 @@ "dids" ], "properties": { - "topic": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "description": { - "type": "string" - }, - "link": { - "type": "string" - }, - "startedAt": { - "type": "string", - "format": "datetime" - }, - "postCount": { - "type": "integer" - }, - "status": { - "type": "string", - "knownValues": ["hot"] - }, - "category": { - "type": "string" - }, + "topic": { "type": "string" }, + "displayName": { "type": "string" }, + "description": { "type": "string" }, + "link": { "type": "string" }, + "startedAt": { "type": "string", "format": "datetime" }, + "postCount": { "type": "integer" }, + "status": { "type": "string", "knownValues": ["hot"] }, + "category": { "type": "string" }, "dids": { "type": "array", "items": { @@ -107,32 +72,14 @@ "actors" ], "properties": { - "topic": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "description": { - "type": "string" - }, - "link": { - "type": "string" - }, - "startedAt": { - "type": "string", - "format": "datetime" - }, - "postCount": { - "type": "integer" - }, - "status": { - "type": "string", - "knownValues": ["hot"] - }, - "category": { - "type": "string" - }, + "topic": { "type": "string" }, + "displayName": { "type": "string" }, + "description": { "type": "string" }, + "link": { "type": "string" }, + "startedAt": { "type": "string", "format": "datetime" }, + "postCount": { "type": "integer" }, + "status": { "type": "string", "knownValues": ["hot"] }, + "category": { "type": "string" }, "actors": { "type": "array", "items": { @@ -153,10 +100,7 @@ "mutedByViewer" ], "properties": { - "post": { - "type": "ref", - "ref": "app.bsky.feed.defs#postView" - }, + "post": { "type": "ref", "ref": "app.bsky.feed.defs#postView" }, "moreParents": { "type": "boolean", "description": "This post has more parents that were not present in the response. This is just a boolean, without the number of parents." @@ -167,7 +111,15 @@ }, "opThread": { "type": "boolean", - "description": "This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread." + "description": "This post is part of a contiguous thread by the OP from the thread root. Sub-threads by OP deeper in the tree are not considered an OP thread." + }, + "opThreadPostIndex": { + "type": "integer", + "description": "The 1-indexed position of this post within the contiguous OP thread. Only present when this post is part of the OP thread (see `opThread`)." + }, + "opThreadPostCount": { + "type": "integer", + "description": "The total number of posts in the contiguous OP thread that this post belongs to. Only present when this post is part of the OP thread (see `opThread`)." }, "hiddenByThreadgate": { "type": "boolean", @@ -191,10 +143,7 @@ "type": "object", "required": ["author"], "properties": { - "author": { - "type": "ref", - "ref": "app.bsky.feed.defs#blockedAuthor" - } + "author": { "type": "ref", "ref": "app.bsky.feed.defs#blockedAuthor" } } }, "ageAssuranceState": { diff --git a/src/screens/PostThread/components/ThreadItemPostNumber.tsx b/src/screens/PostThread/components/ThreadItemPostNumber.tsx index 12be469598..7d55adf50b 100644 --- a/src/screens/PostThread/components/ThreadItemPostNumber.tsx +++ b/src/screens/PostThread/components/ThreadItemPostNumber.tsx @@ -1,9 +1,9 @@ import {Text, View} from 'react-native' -import {type AppBskyUnspeccedDefs} from '@atproto/api' import {Trans, useLingui} from '@lingui/react/macro' import {atoms as a, ios, platform, useTheme} from '#/alf' import {useAnalytics} from '#/analytics' +import {type app} from '#/lexicons' /** * How far the inline badge is nudged below the text baseline. Android's @@ -12,7 +12,7 @@ import {useAnalytics} from '#/analytics' export const POST_NUMBER_INLINE_OFFSET = 6 export function useHasThreadItemPostNumber( - value: AppBskyUnspeccedDefs.ThreadItemPost, + value: app.bsky.unspecced.defs.ThreadItemPost, ) { const ax = useAnalytics() const index = value.opThreadPostIndex @@ -32,7 +32,7 @@ export function ThreadItemPostNumber({ value, inline = true, }: { - value: AppBskyUnspeccedDefs.ThreadItemPost + value: app.bsky.unspecced.defs.ThreadItemPost inline?: boolean }) { const t = useTheme()